[dpdk-dev] [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC

Zhang, AlvinX alvinx.zhang at intel.com
Thu Sep 10 11:29:28 CEST 2020


Thanks Guojia,

> -----Original Message-----
> From: Guo, Jia <jia.guo at intel.com>
> Sent: Thursday, September 10, 2020 1:14 PM
> To: Zhang, AlvinX <alvinx.zhang at intel.com>; Zhang, Qi Z
> <qi.z.zhang at intel.com>
> Cc: dev at dpdk.org
> Subject: RE: [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC
> 
> Hi, Alvin
> 
> > -----Original Message-----
> > From: Zhang, AlvinX <alvinx.zhang at intel.com>
> > Sent: Thursday, September 10, 2020 11:37 AM
> > To: Guo, Jia <jia.guo at intel.com>; Zhang, Qi Z <qi.z.zhang at intel.com>
> > Cc: dev at dpdk.org; Zhang, AlvinX <alvinx.zhang at intel.com>
> > Subject: [PATCH v4 2/2] net/iavf: support outer IP hash for GTPC
> >
> > From: Alvin Zhang <alvinx.zhang at intel.com>
> >
> > Add patterns and headers for GTPC, now outer IP hash can be configured
> > as input sets for GTPC packet.
> >
> > Signed-off-by: Alvin Zhang <alvinx.zhang at intel.com>
> > ---
> >
> > V2: Modify codes according to comments.
> > V3: Refact all codes.
> > V4: Fix compatibility issues.
> >
> >  drivers/net/iavf/iavf_generic_flow.c | 18 ++++++++++++++++++
> > drivers/net/iavf/iavf_generic_flow.h |  6 ++++++
> >  drivers/net/iavf/iavf_hash.c         | 13 +++++++++++++
> >  3 files changed, 37 insertions(+)
> >
> > diff --git a/drivers/net/iavf/iavf_generic_flow.c
> > b/drivers/net/iavf/iavf_generic_flow.c
> > index 321a4dc..00e7f15 100644
> > --- a/drivers/net/iavf/iavf_generic_flow.c
> > +++ b/drivers/net/iavf/iavf_generic_flow.c
> > @@ -315,6 +315,15 @@ enum rte_flow_item_type
> > iavf_pattern_eth_qinq_ipv6_icmp6[] = {  RTE_FLOW_ITEM_TYPE_END,  };
> >
> > +/* IPv4 GTPC */
> > +enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[] = {
> > +RTE_FLOW_ITEM_TYPE_ETH, RTE_FLOW_ITEM_TYPE_IPV4,
> > +RTE_FLOW_ITEM_TYPE_UDP, RTE_FLOW_ITEM_TYPE_GTPC,
> > +RTE_FLOW_ITEM_TYPE_END, };
> > +
> >  /* IPV4 GTPU (EH) */
> >  enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[] = {
> > RTE_FLOW_ITEM_TYPE_ETH, @@ -333,6 +342,15 @@ enum
> rte_flow_item_type
> > iavf_pattern_eth_ipv4_gtpu_eh[] = {  RTE_FLOW_ITEM_TYPE_END,  };
> >
> > +/* IPv6 GTPC */
> > +enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[] = {
> > +RTE_FLOW_ITEM_TYPE_ETH, RTE_FLOW_ITEM_TYPE_IPV6,
> > +RTE_FLOW_ITEM_TYPE_UDP, RTE_FLOW_ITEM_TYPE_GTPC,
> > +RTE_FLOW_ITEM_TYPE_END, };
> > +
> >  /* IPV6 GTPU (EH) */
> >  enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[] = {
> > RTE_FLOW_ITEM_TYPE_ETH, diff --git
> > a/drivers/net/iavf/iavf_generic_flow.h
> > b/drivers/net/iavf/iavf_generic_flow.h
> > index f365cc3..dbc7294 100644
> > --- a/drivers/net/iavf/iavf_generic_flow.h
> > +++ b/drivers/net/iavf/iavf_generic_flow.h
> > @@ -182,10 +182,16 @@
> >  extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_icmp6[];
> >  extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[];
> >
> > +/* IPv4 GTPC */
> > +extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[];
> > +
> >  /* IPv4 GTPU (EH) */
> >  extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[];  extern
> > enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[];
> >
> > +/* IPv4 GTPC */
> 
> /* IPv6 GTPC */
> 
> > +extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[];
> > +
> >  /* IPv6 GTPU (EH) */
> >  extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[];  extern
> > enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh[]; diff --git
> > a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> > d0f0057..4e8ee5c 100644
> > --- a/drivers/net/iavf/iavf_hash.c
> > +++ b/drivers/net/iavf/iavf_hash.c
> > @@ -135,6 +135,9 @@ struct iavf_hash_flow_cfg {  #define
> > proto_hdr_gtpu { \  VIRTCHNL_PROTO_HDR_GTPU_IP, 0, {BUFF_NOUSED} }
> >
> > +#define proto_hdr_gtpc { \
> > +VIRTCHNL_PROTO_HDR_GTPC, 0, {BUFF_NOUSED} }
> > +
> >  #define TUNNEL_LEVEL_OUTER0
> >  #define TUNNEL_LEVEL_INNER1
> >
> > @@ -267,6 +270,14 @@ struct virtchnl_proto_hdrs
> > outer_ipv6_udp_gtpu_tmplt = {  TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6,
> > proto_hdr_udp, proto_hdr_gtpu}  };
> >
> > +struct virtchnl_proto_hdrs ipv4_udp_gtpc_tmplt = {
> > +TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp,
> > proto_hdr_gtpc}
> > +};
> > +
> > +struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
> > +TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp,
> > proto_hdr_gtpc}
> > +};
> > +
> >  /* rss type super set */
> >
> >  /* IPv4 outer */
> > @@ -377,6 +388,7 @@ struct virtchnl_proto_hdrs
> > outer_ipv6_udp_gtpu_tmplt = {  {iavf_pattern_eth_ipv4_ah,
> > IAVF_RSS_TYPE_IPV4_AH,&ipv4_ah_tmplt},
> >  {iavf_pattern_eth_ipv4_l2tpv3,
> > IAVF_RSS_TYPE_IPV4_L2TPV3,&ipv4_l2tpv3_tmplt},
> >  {iavf_pattern_eth_ipv4_pfcp,
> > IAVF_RSS_TYPE_IPV4_PFCP,&ipv4_pfcp_tmplt},
> > +{iavf_pattern_eth_ipv4_gtpc,ETH_RSS_IPV4,
> 
> Since the input set hint is the supper set, so I suppose you use the supper set
> "ETH_RSS_IPV4 | ETH_RSS_GTPC" here, and considerate if we need to enable
> GTPC hash at this patch, if not it  could be process when parsing pattern. Want
> to know other's opinion.

In V1 patch I have put TEID field as input set, but the kernel driver did not supported this field and returned success.
That's mean if user really set ETH_RSS_GTPC as input set, the rule will be created succeed, but it don't work

> 
> > &ipv4_udp_gtpc_tmplt},
> >  /* IPv6 */
> >  {iavf_pattern_eth_ipv6,
> > IAVF_RSS_TYPE_OUTER_IPV6,&outer_ipv6_tmplt},
> >  {iavf_pattern_eth_ipv6_udp,
> > IAVF_RSS_TYPE_OUTER_IPV6_UDP,&outer_ipv6_udp_tmplt},
> > @@ -404,6 +416,7 @@ struct virtchnl_proto_hdrs
> > outer_ipv6_udp_gtpu_tmplt = {  {iavf_pattern_eth_ipv6_ah,
> > IAVF_RSS_TYPE_IPV6_AH,&ipv6_ah_tmplt},
> >  {iavf_pattern_eth_ipv6_l2tpv3,
> > IAVF_RSS_TYPE_IPV6_L2TPV3,&ipv6_l2tpv3_tmplt},
> >  {iavf_pattern_eth_ipv6_pfcp,
> > IAVF_RSS_TYPE_IPV6_PFCP,&ipv6_pfcp_tmplt},
> > +{iavf_pattern_eth_ipv6_gtpc,ETH_RSS_IPV6,
> > &ipv6_udp_gtpc_tmplt},
> >  };
> >
> >  struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
> > --
> > 1.8.3.1
> 



More information about the dev mailing list