[dpdk-dev,v3,1/8] mbuf: support GTP in software packet type parser

Message ID 1506119714-53437-2-git-send-email-beilei.xing@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xing, Beilei Sept. 22, 2017, 10:35 p.m. UTC
  Add support of GTP-C and GTP-U tunnels in rte_net_get_ptype().

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 lib/librte_mbuf/rte_mbuf_ptype.c |  2 ++
 lib/librte_mbuf/rte_mbuf_ptype.h | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
  

Comments

Olivier Matz Sept. 25, 2017, 9:21 a.m. UTC | #1
On Sat, Sep 23, 2017 at 06:35:07AM +0800, Beilei Xing wrote:
> Add support of GTP-C and GTP-U tunnels in rte_net_get_ptype().
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>
  
Xing, Beilei Sept. 28, 2017, 2:17 a.m. UTC | #2
This patch set enables RSS/FDIR/cloud filter for GPT-C and GTP-U.
It depends on Kirill's patch:
http://dpdk.org/ml/archives/dev/2017-September/076035.html.
However, Kirill's patchset needs to be updated.

v4 changes:
 - Refine fdir related code.
 - Rework profile metadata parsing function.
 - Fix code style.

v3 changes:
 - Rework implementation to support the new profile.
 - Add GTPC and GTPU tunnel type in software packet type parser.
 - Update ptype info when loading profile.
 - Fix bug of updating pctype info.


v2 changes:
 - Enable RSS/FDIR/cloud filter dinamicly by checking profile
 - Add GTPC and GTPU items to distinguish rule for GTP-C or GTP-U
 - Rework FDIR/cloud filter enabling function

Beilei Xing (8):
  mbuf: support GTP in software packet type parser
  net/i40e: update ptype and pctype info
  net/i40e: support RSS for new pctype
  ethdev: add GTP items to support flow API
  net/i40e: finish integration FDIR with generic flow API
  net/i40e: add FDIR support for GTP-C and GTP-U
  net/i40e: add cloud filter parsing function for GTP
  net/i40e: enable cloud filter for GTP-C and GTP-U

 app/test-pmd/cmdline_flow.c                 |  40 ++
 app/test-pmd/config.c                       |   3 +
 doc/guides/prog_guide/rte_flow.rst          |  18 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   4 +
 drivers/net/i40e/i40e_ethdev.c              | 530 +++++++++++++++++++++++++-
 drivers/net/i40e/i40e_ethdev.h              | 156 +++++++-
 drivers/net/i40e/i40e_fdir.c                | 572 +++++++++++++++++++++++++++-
 drivers/net/i40e/i40e_flow.c                | 496 ++++++++++++++++++++----
 drivers/net/i40e/rte_pmd_i40e.c             |   6 +-
 lib/librte_ether/rte_flow.h                 |  52 +++
 lib/librte_mbuf/rte_mbuf_ptype.c            |   2 +
 lib/librte_mbuf/rte_mbuf_ptype.h            |  24 ++
 12 files changed, 1775 insertions(+), 128 deletions(-)
  
Xing, Beilei Sept. 28, 2017, 8:13 a.m. UTC | #3
This patch set enables RSS/FDIR/cloud filter for GPT-C and GTP-U.
It depends on Kirill's patch:
http://dpdk.org/ml/archives/dev/2017-September/076035.html.
However, Kirill's patchset needs to be updated.

v5 changes:
 - Fix code style.
 - Reword commit log.

v4 changes:
 - Refine fdir related code.
 - Rework profile metadata parsing function.
 - Fix code style.

v3 changes:
 - Rework implementation to support the new profile.
 - Add GTPC and GTPU tunnel type in software packet type parser.
 - Update ptype info when loading profile.
 - Fix bug of updating pctype info.


v2 changes:
 - Enable RSS/FDIR/cloud filter dinamicly by checking profile
 - Add GTPC and GTPU items to distinguish rule for GTP-C or GTP-U
 - Rework FDIR/cloud filter enabling function

Beilei Xing (8):
  mbuf: support GTP in software packet type parser
  net/i40e: update ptype and pctype info
  net/i40e: support RSS for new pctype
  ethdev: add GTP items to support flow API
  net/i40e: finish integration FDIR with generic flow API
  net/i40e: add FDIR support for GTP-C and GTP-U
  net/i40e: add cloud filter parsing function for GTP
  net/i40e: enable cloud filter for GTP-C and GTP-U

 app/test-pmd/cmdline_flow.c                 |  40 ++
 app/test-pmd/config.c                       |   3 +
 doc/guides/prog_guide/rte_flow.rst          |  18 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   4 +
 drivers/net/i40e/i40e_ethdev.c              | 534 +++++++++++++++++++++++++-
 drivers/net/i40e/i40e_ethdev.h              | 156 +++++++-
 drivers/net/i40e/i40e_fdir.c                | 570 +++++++++++++++++++++++++++-
 drivers/net/i40e/i40e_flow.c                | 496 ++++++++++++++++++++----
 drivers/net/i40e/rte_pmd_i40e.c             |   6 +-
 lib/librte_ether/rte_flow.h                 |  52 +++
 lib/librte_mbuf/rte_mbuf_ptype.c            |   2 +
 lib/librte_mbuf/rte_mbuf_ptype.h            |  24 ++
 12 files changed, 1775 insertions(+), 130 deletions(-)
  
Xing, Beilei Sept. 29, 2017, 5:18 a.m. UTC | #4
This patch set enables RSS/FDIR/cloud filter for GPT-C and GTP-U.
It depends on Kirill's patch:
http://www.dpdk.org/dev/patchwork/patch/29325/

v6 changes:
 - Reword description of GTP item and GTP structure, mainly support
   GTPv1, not include GTPv0 and GTPv2.

v5 changes:
 - Fix code style.
 - Reword commit log.

v4 changes:
 - Refine fdir related code.
 - Rework profile metadata parsing function.
 - Fix code style.

v3 changes:
 - Rework implementation to support the new profile.
 - Add GTPC and GTPU tunnel type in software packet type parser.
 - Update ptype info when loading profile.
 - Fix bug of updating pctype info.


v2 changes:
 - Enable RSS/FDIR/cloud filter dinamicly by checking profile
 - Add GTPC and GTPU items to distinguish rule for GTP-C or GTP-U
 - Rework FDIR/cloud filter enabling function

Beilei Xing (8):
  mbuf: support GTP in software packet type parser
  net/i40e: update ptype and pctype info
  support RSS for new pctype
  ethdev: add GTP items to support flow API
  net/i40e: finish integration FDIR with generic flow API
  net/i40e: add FDIR support for GTP-C and GTP-U
  net/i40e: add cloud filter parsing function for GTP
  net/i40e: enable cloud filter for GTP-C and GTP-U

 app/test-pmd/cmdline_flow.c                 |  40 ++
 app/test-pmd/config.c                       |   3 +
 doc/guides/prog_guide/rte_flow.rst          |  17 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   4 +
 drivers/net/i40e/i40e_ethdev.c              | 535 +++++++++++++++++++++++++-
 drivers/net/i40e/i40e_ethdev.h              | 156 +++++++-
 drivers/net/i40e/i40e_fdir.c                | 570 +++++++++++++++++++++++++++-
 drivers/net/i40e/i40e_flow.c                | 496 ++++++++++++++++++++----
 drivers/net/i40e/rte_pmd_i40e.c             |   6 +-
 lib/librte_ether/rte_flow.h                 |  52 +++
 lib/librte_mbuf/rte_mbuf_ptype.c            |   2 +
 lib/librte_mbuf/rte_mbuf_ptype.h            |  24 ++
 12 files changed, 1775 insertions(+), 130 deletions(-)
  
Xing, Beilei Sept. 29, 2017, 3:50 p.m. UTC | #5
This patch set enables RSS/FDIR/cloud filter for GPT-C and GTP-U.
It depends on Kirill's patch:
http://www.dpdk.org/dev/patchwork/patch/29325/

v7 changes:
 - Distinguish GTP-C request and response message in mbuf description.
 - Clarify GTP-C response message is not supported.
 - Version_type 0x30 is invalid for GTP-C, replace with 0x32.
 - Refine metadata parsing function.
 - Rework for checking fdir programming status.

v6 changes:
 - Reword description of GTP item and GTP structure, mainly support
   GTPv1, not include GTPv0 and GTPv2.

v5 changes:
 - Fix code style.
 - Reword commit log.

v4 changes:
 - Refine fdir related code.
 - Rework profile metadata parsing function.
 - Fix code style.

v3 changes:
 - Rework implementation to support the new profile.
 - Add GTPC and GTPU tunnel type in software packet type parser.
 - Update ptype info when loading profile.
 - Fix bug of updating pctype info.


v2 changes:
 - Enable RSS/FDIR/cloud filter dinamicly by checking profile
 - Add GTPC and GTPU items to distinguish rule for GTP-C or GTP-U
 - Rework FDIR/cloud filter enabling function

Beilei Xing (8):
  mbuf: support GTP in software packet type parser
  net/i40e: update ptype and pctype info
  net/i40e: support RSS for new pctype
  ethdev: add GTP items to support flow API
  net/i40e: finish integration FDIR with generic flow API
  net/i40e: add FDIR support for GTP-C and GTP-U
  net/i40e: add cloud filter parsing function for GTP
  net/i40e: enable cloud filter for GTP-C and GTP-U

 app/test-pmd/cmdline_flow.c                 |  40 ++
 app/test-pmd/config.c                       |   3 +
 doc/guides/prog_guide/rte_flow.rst          |  17 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   4 +
 drivers/net/i40e/i40e_ethdev.c              | 531 ++++++++++++++++++++++++-
 drivers/net/i40e/i40e_ethdev.h              | 156 +++++++-
 drivers/net/i40e/i40e_fdir.c                | 587 +++++++++++++++++++++++++++-
 drivers/net/i40e/i40e_flow.c                | 502 ++++++++++++++++++++----
 drivers/net/i40e/rte_pmd_i40e.c             |   6 +-
 lib/librte_ether/rte_flow.h                 |  52 +++
 lib/librte_mbuf/rte_mbuf_ptype.c            |   2 +
 lib/librte_mbuf/rte_mbuf_ptype.h            |  32 ++
 12 files changed, 1800 insertions(+), 132 deletions(-)
  
Ferruh Yigit Oct. 4, 2017, 10:43 p.m. UTC | #6
On 9/29/2017 4:50 PM, Beilei Xing wrote:
> This patch set enables RSS/FDIR/cloud filter for GPT-C and GTP-U.
> It depends on Kirill's patch:
> http://www.dpdk.org/dev/patchwork/patch/29325/
> 
> v7 changes:
>  - Distinguish GTP-C request and response message in mbuf description.
>  - Clarify GTP-C response message is not supported.
>  - Version_type 0x30 is invalid for GTP-C, replace with 0x32.
>  - Refine metadata parsing function.
>  - Rework for checking fdir programming status.
> 
> v6 changes:
>  - Reword description of GTP item and GTP structure, mainly support
>    GTPv1, not include GTPv0 and GTPv2.
> 
> v5 changes:
>  - Fix code style.
>  - Reword commit log.
> 
> v4 changes:
>  - Refine fdir related code.
>  - Rework profile metadata parsing function.
>  - Fix code style.
> 
> v3 changes:
>  - Rework implementation to support the new profile.
>  - Add GTPC and GTPU tunnel type in software packet type parser.
>  - Update ptype info when loading profile.
>  - Fix bug of updating pctype info.
> 
> 
> v2 changes:
>  - Enable RSS/FDIR/cloud filter dinamicly by checking profile
>  - Add GTPC and GTPU items to distinguish rule for GTP-C or GTP-U
>  - Rework FDIR/cloud filter enabling function
> 
> Beilei Xing (8):
>   mbuf: support GTP in software packet type parser
>   net/i40e: update ptype and pctype info
>   net/i40e: support RSS for new pctype
>   ethdev: add GTP items to support flow API
>   net/i40e: finish integration FDIR with generic flow API
>   net/i40e: add FDIR support for GTP-C and GTP-U
>   net/i40e: add cloud filter parsing function for GTP
>   net/i40e: enable cloud filter for GTP-C and GTP-U

Series Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

I don't know about GTP internals , but set passes from my scripts.

But there was a merge conflict (on top of master tree) on patch 3, it is
easy to resolve but I wonder if there is a dependency not mentioned? If
not can you please double check the patch.
  
Xing, Beilei Oct. 5, 2017, 8:14 a.m. UTC | #7
This patch set enables RSS/FDIR/cloud filter for GPT-C and GTP-U.

v8 changes:
 - Remove 'enable RSS for new pctype' as it can be set with the
   configuration in Kirill's patch.
 - Resolve conflicts.

v7 changes:
 - Distinguish GTP-C request and response message in mbuf description.
 - Clarify GTP-C response message is not supported.
 - Version_type 0x30 is invalid for GTP-C, replace with 0x32.
 - Refine metadata parsing function.
 - Rework for checking fdir programming status.

v6 changes:
 - Reword description of GTP item and GTP structure, mainly support
   GTPv1, not include GTPv0 and GTPv2.

v5 changes:
 - Fix code style.
 - Reword commit log.

v4 changes:
 - Refine fdir related code.
 - Rework profile metadata parsing function.
 - Fix code style.

v3 changes:
 - Rework implementation to support the new profile.
 - Add GTPC and GTPU tunnel type in software packet type parser.
 - Update ptype info when loading profile.
 - Fix bug of updating pctype info.


v2 changes:
 - Enable RSS/FDIR/cloud filter dinamicly by checking profile
 - Add GTPC and GTPU items to distinguish rule for GTP-C or GTP-U
 - Rework FDIR/cloud filter enabling function

Beilei Xing (7):
  mbuf: support GTP in software packet type parser
  net/i40e: update ptype and pctype info
  ethdev: add GTP items to support flow API
  net/i40e: finish integration FDIR with generic flow API
  net/i40e: add FDIR support for GTP-C and GTP-U
  net/i40e: add cloud filter parsing function for GTP
  net/i40e: enable cloud filter for GTP-C and GTP-U

 app/test-pmd/cmdline_flow.c                 |  40 ++
 app/test-pmd/config.c                       |   3 +
 doc/guides/prog_guide/rte_flow.rst          |  17 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   4 +
 drivers/net/i40e/i40e_ethdev.c              | 505 +++++++++++++++++++++++-
 drivers/net/i40e/i40e_ethdev.h              | 156 +++++++-
 drivers/net/i40e/i40e_fdir.c                | 585 +++++++++++++++++++++++++++-
 drivers/net/i40e/i40e_flow.c                | 503 ++++++++++++++++++++----
 drivers/net/i40e/rte_pmd_i40e.c             |   6 +-
 lib/librte_ether/rte_flow.h                 |  52 +++
 lib/librte_mbuf/rte_mbuf_ptype.c            |   2 +
 lib/librte_mbuf/rte_mbuf_ptype.h            |  32 ++
 12 files changed, 1774 insertions(+), 131 deletions(-)
  
Jingjing Wu Oct. 5, 2017, 8:23 a.m. UTC | #8
> -----Original Message-----
> From: Xing, Beilei
> Sent: Thursday, October 5, 2017 4:15 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: Chilikin, Andrey <andrey.chilikin@intel.com>; dev@dpdk.org
> Subject: [PATCH v8 0/7] net/i40e: GPT-C and GTP-U enabling
> 
> This patch set enables RSS/FDIR/cloud filter for GPT-C and GTP-U.
> 
> v8 changes:
>  - Remove 'enable RSS for new pctype' as it can be set with the
>    configuration in Kirill's patch.
>  - Resolve conflicts.
> 
> v7 changes:
>  - Distinguish GTP-C request and response message in mbuf description.
>  - Clarify GTP-C response message is not supported.
>  - Version_type 0x30 is invalid for GTP-C, replace with 0x32.
>  - Refine metadata parsing function.
>  - Rework for checking fdir programming status.
> 
> v6 changes:
>  - Reword description of GTP item and GTP structure, mainly support
>    GTPv1, not include GTPv0 and GTPv2.
> 
> v5 changes:
>  - Fix code style.
>  - Reword commit log.
> 
> v4 changes:
>  - Refine fdir related code.
>  - Rework profile metadata parsing function.
>  - Fix code style.
> 
> v3 changes:
>  - Rework implementation to support the new profile.
>  - Add GTPC and GTPU tunnel type in software packet type parser.
>  - Update ptype info when loading profile.
>  - Fix bug of updating pctype info.
> 
> 
> v2 changes:
>  - Enable RSS/FDIR/cloud filter dinamicly by checking profile
>  - Add GTPC and GTPU items to distinguish rule for GTP-C or GTP-U
>  - Rework FDIR/cloud filter enabling function
> 
> Beilei Xing (7):
>   mbuf: support GTP in software packet type parser
>   net/i40e: update ptype and pctype info
>   ethdev: add GTP items to support flow API
>   net/i40e: finish integration FDIR with generic flow API
>   net/i40e: add FDIR support for GTP-C and GTP-U
>   net/i40e: add cloud filter parsing function for GTP
>   net/i40e: enable cloud filter for GTP-C and GTP-U
> 
>  app/test-pmd/cmdline_flow.c                 |  40 ++
>  app/test-pmd/config.c                       |   3 +
>  doc/guides/prog_guide/rte_flow.rst          |  17 +
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |   4 +
>  drivers/net/i40e/i40e_ethdev.c              | 505 +++++++++++++++++++++++-
>  drivers/net/i40e/i40e_ethdev.h              | 156 +++++++-
>  drivers/net/i40e/i40e_fdir.c                | 585 +++++++++++++++++++++++++++-
>  drivers/net/i40e/i40e_flow.c                | 503 ++++++++++++++++++++----
>  drivers/net/i40e/rte_pmd_i40e.c             |   6 +-
>  lib/librte_ether/rte_flow.h                 |  52 +++
>  lib/librte_mbuf/rte_mbuf_ptype.c            |   2 +
>  lib/librte_mbuf/rte_mbuf_ptype.h            |  32 ++
>  12 files changed, 1774 insertions(+), 131 deletions(-)
> 
Acked-by: Jingjing Wu <jingjing.wu@intel.com>


Thanks
Jingjing
  
Ferruh Yigit Oct. 5, 2017, 9:13 p.m. UTC | #9
On 10/5/2017 9:14 AM, Beilei Xing wrote:
> This patch set enables RSS/FDIR/cloud filter for GPT-C and GTP-U.
> 

<...>

> 
> Beilei Xing (7):
>   mbuf: support GTP in software packet type parser
>   net/i40e: update ptype and pctype info
>   ethdev: add GTP items to support flow API
>   net/i40e: finish integration FDIR with generic flow API
>   net/i40e: add FDIR support for GTP-C and GTP-U
>   net/i40e: add cloud filter parsing function for GTP
>   net/i40e: enable cloud filter for GTP-C and GTP-U

Series applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index e5c4fae..a450814 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -89,6 +89,8 @@  const char *rte_get_ptype_tunnel_name(uint32_t ptype)
 	case RTE_PTYPE_TUNNEL_NVGRE: return "TUNNEL_NVGRE";
 	case RTE_PTYPE_TUNNEL_GENEVE: return "TUNNEL_GENEVE";
 	case RTE_PTYPE_TUNNEL_GRENAT: return "TUNNEL_GRENAT";
+	case RTE_PTYPE_TUNNEL_GTPC: return "TUNNEL_GTPC";
+	case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
 	default: return "TUNNEL_UNKNOWN";
 	}
 }
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index acd70bb..eb7cd2c 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -383,6 +383,30 @@  extern "C" {
  */
 #define RTE_PTYPE_TUNNEL_GRENAT             0x00006000
 /**
+ * GTP-C (GPRS Tunnelling Protocol) control tunneling packet type.
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=2123>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=2123>
+ */
+#define RTE_PTYPE_TUNNEL_GTPC               0x00007000
+/**
+ * GTP-U (GPRS Tunnelling Protocol) user data tunneling packet type.
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=2152>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=2152>
+ */
+#define RTE_PTYPE_TUNNEL_GTPU               0x00008000
+/**
  * Mask of tunneling packet types.
  */
 #define RTE_PTYPE_TUNNEL_MASK               0x0000f000