[v2] net/iavf: fix PROT filed for rss hash

Message ID 20201103073433.22492-1-jia.guo@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/iavf: fix PROT filed for rss hash |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing fail Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Guo, Jia Nov. 3, 2020, 7:34 a.m. UTC
  Add PROT field into IPv4 and IPv6 protocol headers for rss hash.

Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
v2:
add prot into the new hdr replace of function modify
---
 drivers/net/iavf/iavf_hash.c | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)
  

Comments

Huang, ZhiminX Nov. 3, 2020, 8:31 a.m. UTC | #1
Tested-by: Huang, ZhiminX <zhiminx.huang@intel.com>

Regards,
HuangZhiMin


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jeff Guo
> Sent: Tuesday, November 3, 2020 3:35 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Guo, Jia <jia.guo@intel.com>
> Subject: [dpdk-dev] [PATCH v2] net/iavf: fix PROT filed for rss hash
> 
> Add PROT field into IPv4 and IPv6 protocol headers for rss hash.
> 
> Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> ---
> v2:
> add prot into the new hdr replace of function modify
> ---
>  drivers/net/iavf/iavf_hash.c | 32 ++++++++++++++++++++++++--------
>  1 file changed, 24 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> b56152c5b8..804deec5fe 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -101,11 +101,23 @@ iavf_hash_parse_pattern_action(struct
> iavf_adapter *ad,
>  	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | \
>  	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST),
> {BUFF_NOUSED} }
> 
> +#define proto_hdr_ipv4_with_prot { \
> +	VIRTCHNL_PROTO_HDR_IPV4, \
> +	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | \
> +	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | \
> +	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT),
> {BUFF_NOUSED} }
> +
>  #define proto_hdr_ipv6 { \
>  	VIRTCHNL_PROTO_HDR_IPV6, \
>  	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC) | \
>  	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST),
> {BUFF_NOUSED} }
> 
> +#define proto_hdr_ipv6_with_prot { \
> +	VIRTCHNL_PROTO_HDR_IPV6, \
> +	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC) | \
> +	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST) | \
> +	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT),
> {BUFF_NOUSED} }
> +
>  #define proto_hdr_udp { \
>  	VIRTCHNL_PROTO_HDR_UDP, \
>  	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT) | \ @@ -
> 151,13 +163,15 @@ struct virtchnl_proto_hdrs outer_ipv4_tmplt = {
> 
>  struct virtchnl_proto_hdrs outer_ipv4_udp_tmplt = {
>  	TUNNEL_LEVEL_OUTER, 5,
> -	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv4,
> +	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
> +	 proto_hdr_ipv4_with_prot,
>  	 proto_hdr_udp}
>  };
> 
>  struct virtchnl_proto_hdrs outer_ipv4_tcp_tmplt = {
>  	TUNNEL_LEVEL_OUTER, 5,
> -	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv4,
> +	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
> +	 proto_hdr_ipv4_with_prot,
>  	 proto_hdr_tcp}
>  };
> 
> @@ -174,13 +188,15 @@ struct virtchnl_proto_hdrs outer_ipv6_tmplt = {
> 
>  struct virtchnl_proto_hdrs outer_ipv6_udp_tmplt = {
>  	TUNNEL_LEVEL_OUTER, 5,
> -	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv6,
> +	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
> +	 proto_hdr_ipv6_with_prot,
>  	 proto_hdr_udp}
>  };
> 
>  struct virtchnl_proto_hdrs outer_ipv6_tcp_tmplt = {
>  	TUNNEL_LEVEL_OUTER, 5,
> -	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv6,
> +	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
> +	 proto_hdr_ipv6_with_prot,
>  	 proto_hdr_tcp}
>  };
> 
> @@ -195,11 +211,11 @@ struct virtchnl_proto_hdrs inner_ipv4_tmplt = {  };
> 
>  struct virtchnl_proto_hdrs inner_ipv4_udp_tmplt = {
> -	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4, proto_hdr_udp}
> +	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4_with_prot,
> proto_hdr_udp}
>  };
> 
>  struct virtchnl_proto_hdrs inner_ipv4_tcp_tmplt = {
> -	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4, proto_hdr_tcp}
> +	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4_with_prot,
> proto_hdr_tcp}
>  };
> 
>  struct virtchnl_proto_hdrs inner_ipv4_sctp_tmplt = { @@ -211,11 +227,11
> @@ struct virtchnl_proto_hdrs inner_ipv6_tmplt = {  };
> 
>  struct virtchnl_proto_hdrs inner_ipv6_udp_tmplt = {
> -	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6, proto_hdr_udp}
> +	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6_with_prot,
> proto_hdr_udp}
>  };
> 
>  struct virtchnl_proto_hdrs inner_ipv6_tcp_tmplt = {
> -	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6, proto_hdr_tcp}
> +	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6_with_prot,
> proto_hdr_tcp}
>  };
> 
>  struct virtchnl_proto_hdrs inner_ipv6_sctp_tmplt = {
> --
> 2.20.1
  

Patch

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index b56152c5b8..804deec5fe 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -101,11 +101,23 @@  iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST), {BUFF_NOUSED} }
 
+#define proto_hdr_ipv4_with_prot { \
+	VIRTCHNL_PROTO_HDR_IPV4, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT), {BUFF_NOUSED} }
+
 #define proto_hdr_ipv6 { \
 	VIRTCHNL_PROTO_HDR_IPV6, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC) | \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST), {BUFF_NOUSED} }
 
+#define proto_hdr_ipv6_with_prot { \
+	VIRTCHNL_PROTO_HDR_IPV6, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED} }
+
 #define proto_hdr_udp { \
 	VIRTCHNL_PROTO_HDR_UDP, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT) | \
@@ -151,13 +163,15 @@  struct virtchnl_proto_hdrs outer_ipv4_tmplt = {
 
 struct virtchnl_proto_hdrs outer_ipv4_udp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 5,
-	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv4,
+	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
+	 proto_hdr_ipv4_with_prot,
 	 proto_hdr_udp}
 };
 
 struct virtchnl_proto_hdrs outer_ipv4_tcp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 5,
-	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv4,
+	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
+	 proto_hdr_ipv4_with_prot,
 	 proto_hdr_tcp}
 };
 
@@ -174,13 +188,15 @@  struct virtchnl_proto_hdrs outer_ipv6_tmplt = {
 
 struct virtchnl_proto_hdrs outer_ipv6_udp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 5,
-	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv6,
+	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
+	 proto_hdr_ipv6_with_prot,
 	 proto_hdr_udp}
 };
 
 struct virtchnl_proto_hdrs outer_ipv6_tcp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 5,
-	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv6,
+	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
+	 proto_hdr_ipv6_with_prot,
 	 proto_hdr_tcp}
 };
 
@@ -195,11 +211,11 @@  struct virtchnl_proto_hdrs inner_ipv4_tmplt = {
 };
 
 struct virtchnl_proto_hdrs inner_ipv4_udp_tmplt = {
-	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4, proto_hdr_udp}
+	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4_with_prot, proto_hdr_udp}
 };
 
 struct virtchnl_proto_hdrs inner_ipv4_tcp_tmplt = {
-	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4, proto_hdr_tcp}
+	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4_with_prot, proto_hdr_tcp}
 };
 
 struct virtchnl_proto_hdrs inner_ipv4_sctp_tmplt = {
@@ -211,11 +227,11 @@  struct virtchnl_proto_hdrs inner_ipv6_tmplt = {
 };
 
 struct virtchnl_proto_hdrs inner_ipv6_udp_tmplt = {
-	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6, proto_hdr_udp}
+	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6_with_prot, proto_hdr_udp}
 };
 
 struct virtchnl_proto_hdrs inner_ipv6_tcp_tmplt = {
-	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6, proto_hdr_tcp}
+	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6_with_prot, proto_hdr_tcp}
 };
 
 struct virtchnl_proto_hdrs inner_ipv6_sctp_tmplt = {