[dpdk-dev] [PATCH v3 1/3] port: add kni interface support

2016-06-21 Thread Ethan
Hi Cristian,

New patch has been submitted. All comments are fixed except this one:
"Here is one bug for you, you need to make sure you add the following line
here:
param->parsed = 1;"
I think the new convention is to set this flag by the
macro PARSE_CHECK_DUPLICATE_SECTION.

BTW, although I use the  --cover-letter and --annotate flags in the
send-email command, it seems no cover letter is created.
I am not very familiar with this. So sorry!


B.R.
Ethan

2016-06-19 0:44 GMT+08:00 Dumitrescu, Cristian <
cristian.dumitrescu at intel.com>:

> Hi Ethan,
>
> Thank you, here are some comments inlined below.
>
> Please reorganize this patch in a slightly different way to look similar
> to other DPDK patch sets and also ease up the integration work for Thomas:
> Patch 0: I suggest adding a cover letter;
> Patch 1: all librte_port changes (rte_port_kni.h, rte_port_kni.c,
> Makefile, rte_port_version.map), including the "nodrop" KNI port version
> Patch 2: all ip_pipeline app changes
> Patch 3: ip_pipeline app kni.cfg file
> Patch 4: Documentation changes
>
> > -Original Message-
> > From: WeiJie Zhuang [mailto:zhuangwj at gmail.com]
> > Sent: Thursday, June 16, 2016 12:27 PM
> > To: Dumitrescu, Cristian 
> > Cc: dev at dpdk.org; Singh, Jasvinder ; Yigit,
> > Ferruh ; WeiJie Zhuang 
> > Subject: [PATCH v3 1/3] port: add kni interface support
> >
> > 1. add KNI port type to the packet framework
> > 2. add KNI support to the IP Pipeline sample Application
> > 3. some bug fix
> >
> > Signed-off-by: WeiJie Zhuang 
> > ---
> > v2:
> > * Fix check patch error.
> > v3:
> > * Fix code review comments.
> > ---
> >  doc/api/doxy-api-index.md  |   1 +
> >  examples/ip_pipeline/Makefile  |   2 +-
> >  examples/ip_pipeline/app.h | 181 +++-
> >  examples/ip_pipeline/config/kni.cfg|  67 +
> >  examples/ip_pipeline/config_check.c|  26 +-
> >  examples/ip_pipeline/config_parse.c| 166 ++-
> >  examples/ip_pipeline/init.c| 132 -
> >  examples/ip_pipeline/pipeline/pipeline_common_fe.c |  29 ++
> >  examples/ip_pipeline/pipeline/pipeline_master_be.c |   6 +
> >  examples/ip_pipeline/pipeline_be.h |  27 ++
> >  lib/librte_port/Makefile   |   7 +
> >  lib/librte_port/rte_port_kni.c | 325
> +
> >  lib/librte_port/rte_port_kni.h |  82 ++
> >  lib/librte_port/rte_port_version.map   |   8 +
> >  14 files changed, 1047 insertions(+), 12 deletions(-)
> >  create mode 100644 examples/ip_pipeline/config/kni.cfg
> >  create mode 100644 lib/librte_port/rte_port_kni.c
> >  create mode 100644 lib/librte_port/rte_port_kni.h
> >
> > diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
> > index f626386..5e7f024 100644
> > --- a/doc/api/doxy-api-index.md
> > +++ b/doc/api/doxy-api-index.md
> > @@ -118,6 +118,7 @@ There are many libraries, so their headers may be
> > grouped by topics:
> >  [frag] (@ref rte_port_frag.h),
> >  [reass](@ref rte_port_ras.h),
> >  [sched](@ref rte_port_sched.h),
> > +[kni]  (@ref rte_port_kni.h),
> >  [src/sink] (@ref rte_port_source_sink.h)
> >* [table](@ref rte_table.h):
> >  [lpm IPv4] (@ref rte_table_lpm.h),
> > diff --git a/examples/ip_pipeline/Makefile
> b/examples/ip_pipeline/Makefile
> > index 5827117..6dc3f52 100644
> > --- a/examples/ip_pipeline/Makefile
> > +++ b/examples/ip_pipeline/Makefile
> > @@ -1,6 +1,6 @@
> >  #   BSD LICENSE
> >  #
> > -#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> > +#   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
> >  #   All rights reserved.
> >  #
> >  #   Redistribution and use in source and binary forms, with or without
> > diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
> > index 7611341..abbd6d4 100644
> > --- a/examples/ip_pipeline/app.h
> > +++ b/examples/ip_pipeline/app.h
> > @@ -44,6 +44,9 @@
> >  #include 
> >
> >  #include 
> > +#ifdef RTE_LIBRTE_KNI
> > +#include 
> > +#endif
> >
> >  #include "cpu_core_map.h"
> >  #include "pipeline.h"
> > @@ -132,6 +135,20 @@ struct app_pktq_swq_params {
> >   uint32_t mempool_indirect_id;
> >  };
> >
> > +struct app_pktq_kni_params {
> > + char *name;
> > + uint32_t parsed;
> > +
> > + uint32_t socket_id;
> > + uint32_t core_id;
> > + uint32_t hyper_th_id;
> > + uint32_t force_bind;
> > +
> > + uint32_t mempool_id; /* Position in the app->mempool_params */
> > + uint32_t burst_read;
> > + uint32_t burst_write;
> > +};
> > +
> >  #ifndef APP_FILE_NAME_SIZE
> >  #define APP_FILE_NAME_SIZE   256
> >  #endif
> > @@ -185,6 +202,7 @@ enum app_pktq_in_type {
> >   

[dpdk-dev] [PATCH v3 1/3] port: add kni interface support

2016-06-21 Thread Dumitrescu, Cristian
Hi Ethan,

Thanks very much for sending the new version.

You are absolutely right about the param->parsed issue, sorry, my fault.

I think you need to use the --cover-letter flag for git format-patch command. 
You can practice by sending the patch set to your email address first before 
you send it to the list. Do you want to try sending a new revision of this 
patch set with the cover letter included (preferred) or you want to stop at v3? 
Please let us know.

Thanks,
Cristian

From: zhuangweijie at gmail.com [mailto:zhuangwei...@gmail.com] On Behalf Of 
Ethan
Sent: Tuesday, June 21, 2016 12:11 PM
To: Dumitrescu, Cristian 
Cc: dev at dpdk.org; Singh, Jasvinder ; Yigit, 
Ferruh 
Subject: Re: [PATCH v3 1/3] port: add kni interface support

Hi Cristian,

New patch has been submitted. All comments are fixed except this one:
"Here is one bug for you, you need to make sure you add the following line here:
param->parsed = 1;"
I think the new convention is to set this flag by the macro 
PARSE_CHECK_DUPLICATE_SECTION.

BTW, although I use the  --cover-letter and --annotate flags in the send-email 
command, it seems no cover letter is created.
I am not very familiar with this. So sorry!


B.R.
Ethan

2016-06-19 0:44 GMT+08:00 Dumitrescu, Cristian mailto:cristian.dumitrescu at intel.com>>:
Hi Ethan,

Thank you, here are some comments inlined below.

Please reorganize this patch in a slightly different way to look similar to 
other DPDK patch sets and also ease up the integration work for Thomas:
Patch 0: I suggest adding a cover letter;
Patch 1: all librte_port changes (rte_port_kni.h, rte_port_kni.c, 
Makefile, rte_port_version.map), including the "nodrop" KNI port version
Patch 2: all ip_pipeline app changes
Patch 3: ip_pipeline app kni.cfg file
Patch 4: Documentation changes

> -Original Message-
> From: WeiJie Zhuang [mailto:zhuangwj at gmail.com gmail.com>]
> Sent: Thursday, June 16, 2016 12:27 PM
> To: Dumitrescu, Cristian  intel.com>
> Cc: dev at dpdk.org; Singh, Jasvinder 
> mailto:jasvinder.singh at intel.com>>; Yigit,
> Ferruh mailto:ferruh.yigit at intel.com>>; WeiJie 
> Zhuang mailto:zhuangwj at gmail.com>>
> Subject: [PATCH v3 1/3] port: add kni interface support
>
> 1. add KNI port type to the packet framework
> 2. add KNI support to the IP Pipeline sample Application
> 3. some bug fix
>
> Signed-off-by: WeiJie Zhuang mailto:zhuangwj at 
> gmail.com>>
> ---
> v2:
> * Fix check patch error.
> v3:
> * Fix code review comments.
> ---
>  doc/api/doxy-api-index.md  
> |   1 +
>  examples/ip_pipeline/Makefile  |   2 +-
>  examples/ip_pipeline/app.h | 181 +++-
>  examples/ip_pipeline/config/kni.cfg|  67 +
>  examples/ip_pipeline/config_check.c|  26 +-
>  examples/ip_pipeline/config_parse.c| 166 ++-
>  examples/ip_pipeline/init.c| 132 -
>  examples/ip_pipeline/pipeline/pipeline_common_fe.c |  29 ++
>  examples/ip_pipeline/pipeline/pipeline_master_be.c |   6 +
>  examples/ip_pipeline/pipeline_be.h |  27 ++
>  lib/librte_port/Makefile   |   7 +
>  lib/librte_port/rte_port_kni.c | 325 
> +
>  lib/librte_port/rte_port_kni.h |  82 ++
>  lib/librte_port/rte_port_version.map   |   8 +
>  14 files changed, 1047 insertions(+), 12 deletions(-)
>  create mode 100644 examples/ip_pipeline/config/kni.cfg
>  create mode 100644 lib/librte_port/rte_port_kni.c
>  create mode 100644 lib/librte_port/rte_port_kni.h
>
> diff --git a/doc/api/doxy-api-index.md 
> b/doc/api/doxy-api-index.md
> index f626386..5e7f024 100644
> --- a/doc/api/doxy-api-index.md
> +++ b/doc/api/doxy-api-index.md
> @@ -118,6 +118,7 @@ There are many libraries, so their headers may be
> grouped by topics:
>  [frag] (@ref rte_port_frag.h),
>  [reass](@ref rte_port_ras.h),
>  [sched](@ref rte_port_sched.h),
> +[kni]  (@ref rte_port_kni.h),
>  [src/sink] (@ref rte_port_source_sink.h)
>* [table](@ref rte_table.h):
>  [lpm IPv4] (@ref rte_table_lpm.h),
> diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile
> index 5827117..6dc3f52 100644
> --- a/examples/ip_pipeline/Makefile
> +++ b/examples/ip_pipeline/Makefile
> @@ -1,6 +1,6 @@
>  #   BSD LICENSE
>  #
> -#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> +#   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
>  #   All rights reserved.
>  #
>  #   Redistribution and use in source and binary forms, with or 

[dpdk-dev] [PATCH v3 1/3] port: add kni interface support

2016-06-18 Thread Dumitrescu, Cristian
Hi Ethan,

Thank you, here are some comments inlined below.

Please reorganize this patch in a slightly different way to look similar to 
other DPDK patch sets and also ease up the integration work for Thomas:
Patch 0: I suggest adding a cover letter;
Patch 1: all librte_port changes (rte_port_kni.h, rte_port_kni.c, 
Makefile, rte_port_version.map), including the "nodrop" KNI port version
Patch 2: all ip_pipeline app changes
Patch 3: ip_pipeline app kni.cfg file
Patch 4: Documentation changes

> -Original Message-
> From: WeiJie Zhuang [mailto:zhuangwj at gmail.com]
> Sent: Thursday, June 16, 2016 12:27 PM
> To: Dumitrescu, Cristian 
> Cc: dev at dpdk.org; Singh, Jasvinder ; Yigit,
> Ferruh ; WeiJie Zhuang 
> Subject: [PATCH v3 1/3] port: add kni interface support
> 
> 1. add KNI port type to the packet framework
> 2. add KNI support to the IP Pipeline sample Application
> 3. some bug fix
> 
> Signed-off-by: WeiJie Zhuang 
> ---
> v2:
> * Fix check patch error.
> v3:
> * Fix code review comments.
> ---
>  doc/api/doxy-api-index.md  |   1 +
>  examples/ip_pipeline/Makefile  |   2 +-
>  examples/ip_pipeline/app.h | 181 +++-
>  examples/ip_pipeline/config/kni.cfg|  67 +
>  examples/ip_pipeline/config_check.c|  26 +-
>  examples/ip_pipeline/config_parse.c| 166 ++-
>  examples/ip_pipeline/init.c| 132 -
>  examples/ip_pipeline/pipeline/pipeline_common_fe.c |  29 ++
>  examples/ip_pipeline/pipeline/pipeline_master_be.c |   6 +
>  examples/ip_pipeline/pipeline_be.h |  27 ++
>  lib/librte_port/Makefile   |   7 +
>  lib/librte_port/rte_port_kni.c | 325 
> +
>  lib/librte_port/rte_port_kni.h |  82 ++
>  lib/librte_port/rte_port_version.map   |   8 +
>  14 files changed, 1047 insertions(+), 12 deletions(-)
>  create mode 100644 examples/ip_pipeline/config/kni.cfg
>  create mode 100644 lib/librte_port/rte_port_kni.c
>  create mode 100644 lib/librte_port/rte_port_kni.h
> 
> diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
> index f626386..5e7f024 100644
> --- a/doc/api/doxy-api-index.md
> +++ b/doc/api/doxy-api-index.md
> @@ -118,6 +118,7 @@ There are many libraries, so their headers may be
> grouped by topics:
>  [frag] (@ref rte_port_frag.h),
>  [reass](@ref rte_port_ras.h),
>  [sched](@ref rte_port_sched.h),
> +[kni]  (@ref rte_port_kni.h),
>  [src/sink] (@ref rte_port_source_sink.h)
>* [table](@ref rte_table.h):
>  [lpm IPv4] (@ref rte_table_lpm.h),
> diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile
> index 5827117..6dc3f52 100644
> --- a/examples/ip_pipeline/Makefile
> +++ b/examples/ip_pipeline/Makefile
> @@ -1,6 +1,6 @@
>  #   BSD LICENSE
>  #
> -#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> +#   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
>  #   All rights reserved.
>  #
>  #   Redistribution and use in source and binary forms, with or without
> diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
> index 7611341..abbd6d4 100644
> --- a/examples/ip_pipeline/app.h
> +++ b/examples/ip_pipeline/app.h
> @@ -44,6 +44,9 @@
>  #include 
> 
>  #include 
> +#ifdef RTE_LIBRTE_KNI
> +#include 
> +#endif
> 
>  #include "cpu_core_map.h"
>  #include "pipeline.h"
> @@ -132,6 +135,20 @@ struct app_pktq_swq_params {
>   uint32_t mempool_indirect_id;
>  };
> 
> +struct app_pktq_kni_params {
> + char *name;
> + uint32_t parsed;
> +
> + uint32_t socket_id;
> + uint32_t core_id;
> + uint32_t hyper_th_id;
> + uint32_t force_bind;
> +
> + uint32_t mempool_id; /* Position in the app->mempool_params */
> + uint32_t burst_read;
> + uint32_t burst_write;
> +};
> +
>  #ifndef APP_FILE_NAME_SIZE
>  #define APP_FILE_NAME_SIZE   256
>  #endif
> @@ -185,6 +202,7 @@ enum app_pktq_in_type {
>   APP_PKTQ_IN_HWQ,
>   APP_PKTQ_IN_SWQ,
>   APP_PKTQ_IN_TM,
> + APP_PKTQ_IN_KNI,
>   APP_PKTQ_IN_SOURCE,
>  };
> 
> @@ -197,6 +215,7 @@ enum app_pktq_out_type {
>   APP_PKTQ_OUT_HWQ,
>   APP_PKTQ_OUT_SWQ,
>   APP_PKTQ_OUT_TM,
> + APP_PKTQ_OUT_KNI,
>   APP_PKTQ_OUT_SINK,
>  };
> 
> @@ -420,6 +439,8 @@ struct app_eal_params {
> 
>  #define APP_MAX_PKTQ_TM  APP_MAX_LINKS
> 
> +#define APP_MAX_PKTQ_KNI APP_MAX_LINKS
> +
>  #ifndef APP_MAX_PKTQ_SOURCE
>  #define APP_MAX_PKTQ_SOURCE  64
>  #endif
> @@ -471,6 +492,7 @@ struct app_params {
>   struct app_pktq_hwq_out_params
> hwq_out_params[APP_MAX_HWQ_OUT];
>   struct app_pktq_swq_params 

[dpdk-dev] [PATCH v3 1/3] port: add kni interface support

2016-06-16 Thread WeiJie Zhuang
1. add KNI port type to the packet framework
2. add KNI support to the IP Pipeline sample Application
3. some bug fix

Signed-off-by: WeiJie Zhuang 
---
v2:
* Fix check patch error.
v3:
* Fix code review comments.
---
 doc/api/doxy-api-index.md  |   1 +
 examples/ip_pipeline/Makefile  |   2 +-
 examples/ip_pipeline/app.h | 181 +++-
 examples/ip_pipeline/config/kni.cfg|  67 +
 examples/ip_pipeline/config_check.c|  26 +-
 examples/ip_pipeline/config_parse.c| 166 ++-
 examples/ip_pipeline/init.c| 132 -
 examples/ip_pipeline/pipeline/pipeline_common_fe.c |  29 ++
 examples/ip_pipeline/pipeline/pipeline_master_be.c |   6 +
 examples/ip_pipeline/pipeline_be.h |  27 ++
 lib/librte_port/Makefile   |   7 +
 lib/librte_port/rte_port_kni.c | 325 +
 lib/librte_port/rte_port_kni.h |  82 ++
 lib/librte_port/rte_port_version.map   |   8 +
 14 files changed, 1047 insertions(+), 12 deletions(-)
 create mode 100644 examples/ip_pipeline/config/kni.cfg
 create mode 100644 lib/librte_port/rte_port_kni.c
 create mode 100644 lib/librte_port/rte_port_kni.h

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index f626386..5e7f024 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -118,6 +118,7 @@ There are many libraries, so their headers may be grouped 
by topics:
 [frag] (@ref rte_port_frag.h),
 [reass](@ref rte_port_ras.h),
 [sched](@ref rte_port_sched.h),
+[kni]  (@ref rte_port_kni.h),
 [src/sink] (@ref rte_port_source_sink.h)
   * [table](@ref rte_table.h):
 [lpm IPv4] (@ref rte_table_lpm.h),
diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile
index 5827117..6dc3f52 100644
--- a/examples/ip_pipeline/Makefile
+++ b/examples/ip_pipeline/Makefile
@@ -1,6 +1,6 @@
 #   BSD LICENSE
 #
-#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
index 7611341..abbd6d4 100644
--- a/examples/ip_pipeline/app.h
+++ b/examples/ip_pipeline/app.h
@@ -44,6 +44,9 @@
 #include 

 #include 
+#ifdef RTE_LIBRTE_KNI
+#include 
+#endif

 #include "cpu_core_map.h"
 #include "pipeline.h"
@@ -132,6 +135,20 @@ struct app_pktq_swq_params {
uint32_t mempool_indirect_id;
 };

+struct app_pktq_kni_params {
+   char *name;
+   uint32_t parsed;
+
+   uint32_t socket_id;
+   uint32_t core_id;
+   uint32_t hyper_th_id;
+   uint32_t force_bind;
+
+   uint32_t mempool_id; /* Position in the app->mempool_params */
+   uint32_t burst_read;
+   uint32_t burst_write;
+};
+
 #ifndef APP_FILE_NAME_SIZE
 #define APP_FILE_NAME_SIZE   256
 #endif
@@ -185,6 +202,7 @@ enum app_pktq_in_type {
APP_PKTQ_IN_HWQ,
APP_PKTQ_IN_SWQ,
APP_PKTQ_IN_TM,
+   APP_PKTQ_IN_KNI,
APP_PKTQ_IN_SOURCE,
 };

@@ -197,6 +215,7 @@ enum app_pktq_out_type {
APP_PKTQ_OUT_HWQ,
APP_PKTQ_OUT_SWQ,
APP_PKTQ_OUT_TM,
+   APP_PKTQ_OUT_KNI,
APP_PKTQ_OUT_SINK,
 };

@@ -420,6 +439,8 @@ struct app_eal_params {

 #define APP_MAX_PKTQ_TM  APP_MAX_LINKS

+#define APP_MAX_PKTQ_KNI APP_MAX_LINKS
+
 #ifndef APP_MAX_PKTQ_SOURCE
 #define APP_MAX_PKTQ_SOURCE  64
 #endif
@@ -471,6 +492,7 @@ struct app_params {
struct app_pktq_hwq_out_params hwq_out_params[APP_MAX_HWQ_OUT];
struct app_pktq_swq_params swq_params[APP_MAX_PKTQ_SWQ];
struct app_pktq_tm_params tm_params[APP_MAX_PKTQ_TM];
+   struct app_pktq_kni_params kni_params[APP_MAX_PKTQ_KNI];
struct app_pktq_source_params source_params[APP_MAX_PKTQ_SOURCE];
struct app_pktq_sink_params sink_params[APP_MAX_PKTQ_SINK];
struct app_msgq_params msgq_params[APP_MAX_MSGQ];
@@ -482,6 +504,7 @@ struct app_params {
uint32_t n_pktq_hwq_out;
uint32_t n_pktq_swq;
uint32_t n_pktq_tm;
+   uint32_t n_pktq_kni;
uint32_t n_pktq_source;
uint32_t n_pktq_sink;
uint32_t n_msgq;
@@ -495,6 +518,9 @@ struct app_params {
struct app_link_data link_data[APP_MAX_LINKS];
struct rte_ring *swq[APP_MAX_PKTQ_SWQ];
struct rte_sched_port *tm[APP_MAX_PKTQ_TM];
+#ifdef RTE_LIBRTE_KNI
+   struct rte_kni *kni[APP_MAX_PKTQ_KNI];
+#endif /* RTE_LIBRTE_KNI */
struct rte_ring *msgq[APP_MAX_MSGQ];
struct pipeline_type pipeline_type[APP_MAX_PIPELINE_TYPES];
struct app_pipeline_data