From: John Daley <johndale@cisco.com>
To: ferruh.yigit@intel.com
Cc: dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>
Subject: [dpdk-dev] [PATCH 5/6] net/enic: fix RSS hash type advertisement
Date: Thu, 3 May 2018 12:37:12 -0700 [thread overview]
Message-ID: <20180503193713.20622-5-johndale@cisco.com> (raw)
In-Reply-To: <20180503193713.20622-1-johndale@cisco.com>
From: Hyong Youb Kim <hyonkim@cisco.com>
The NIC can hash these RSS packet types, but they are not advertised
via flow_type_rss_offloads. So add them.
- Part of the IPv4 hash:
ETH_RSS_FRAG_IPV4
ETH_RSS_NONFRAG_IPV4_OTHER
- Part of the IPv6 hash:
ETH_RSS_FRAG_IPV6
ETH_RSS_NONFRAG_IPV6_OTHER
- Part of the UDP hash:
ETH_RSS_IPV6_UDP_EX
Also, do not use NIC_CFG_RSS_HASH_TYPE_IPV6_EX and
NIC_CFG_RSS_HASH_TYPE_TCP_IPV6_EX, as they are not needed to enable
RSS over IPv6 with extension headers.
Fixes: c2fec27b5cb0 ("net/enic: allow to change RSS settings")
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
---
drivers/net/enic/enic_main.c | 14 ++++++--------
drivers/net/enic/enic_res.c | 26 ++++++++++++++++++--------
2 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index b3b4e9626..2b1c1347c 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1190,7 +1190,8 @@ int enic_set_rss_conf(struct enic *enic, struct rte_eth_rss_conf *rss_conf)
(eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) &&
rss_hf != 0) {
rss_enable = 1;
- if (rss_hf & ETH_RSS_IPV4)
+ if (rss_hf & (ETH_RSS_IPV4 | ETH_RSS_FRAG_IPV4 |
+ ETH_RSS_NONFRAG_IPV4_OTHER))
rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_IPV4;
if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP)
rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV4;
@@ -1202,18 +1203,15 @@ int enic_set_rss_conf(struct enic *enic, struct rte_eth_rss_conf *rss_conf)
*/
rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV4;
}
- if (rss_hf & ETH_RSS_IPV6)
+ if (rss_hf & (ETH_RSS_IPV6 | ETH_RSS_IPV6_EX |
+ ETH_RSS_FRAG_IPV6 | ETH_RSS_NONFRAG_IPV6_OTHER))
rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_IPV6;
- if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP)
+ if (rss_hf & (ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_IPV6_TCP_EX))
rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV6;
- if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) {
+ if (rss_hf & (ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_IPV6_UDP_EX)) {
/* Again, 'TCP' is not a typo. */
rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV6;
}
- if (rss_hf & ETH_RSS_IPV6_EX)
- rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_IPV6_EX;
- if (rss_hf & ETH_RSS_IPV6_TCP_EX)
- rss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV6_EX;
} else {
rss_enable = 0;
rss_hf = 0;
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index de17a31d0..bdda2c564 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -138,20 +138,30 @@ int enic_get_vnic_config(struct enic *enic)
enic->hash_key_size = ENIC_RSS_HASH_KEY_SIZE;
enic->flow_type_rss_offloads = 0;
if (ENIC_SETTING(enic, RSSHASH_IPV4))
- enic->flow_type_rss_offloads |= ETH_RSS_IPV4;
+ /*
+ * IPV4 hash type handles both non-frag and frag packet types.
+ * TCP/UDP is controlled via a separate flag below.
+ */
+ enic->flow_type_rss_offloads |= ETH_RSS_IPV4 |
+ ETH_RSS_FRAG_IPV4 | ETH_RSS_NONFRAG_IPV4_OTHER;
if (ENIC_SETTING(enic, RSSHASH_TCPIPV4))
enic->flow_type_rss_offloads |= ETH_RSS_NONFRAG_IPV4_TCP;
if (ENIC_SETTING(enic, RSSHASH_IPV6))
- enic->flow_type_rss_offloads |= ETH_RSS_IPV6;
+ /*
+ * The VIC adapter can perform RSS on IPv6 packets with and
+ * without extension headers. An IPv6 "fragment" is an IPv6
+ * packet with the fragment extension header.
+ */
+ enic->flow_type_rss_offloads |= ETH_RSS_IPV6 |
+ ETH_RSS_IPV6_EX | ETH_RSS_FRAG_IPV6 |
+ ETH_RSS_NONFRAG_IPV6_OTHER;
if (ENIC_SETTING(enic, RSSHASH_TCPIPV6))
- enic->flow_type_rss_offloads |= ETH_RSS_NONFRAG_IPV6_TCP;
- if (ENIC_SETTING(enic, RSSHASH_IPV6_EX))
- enic->flow_type_rss_offloads |= ETH_RSS_IPV6_EX;
- if (ENIC_SETTING(enic, RSSHASH_TCPIPV6_EX))
- enic->flow_type_rss_offloads |= ETH_RSS_IPV6_TCP_EX;
+ enic->flow_type_rss_offloads |= ETH_RSS_NONFRAG_IPV6_TCP |
+ ETH_RSS_IPV6_TCP_EX;
if (vnic_dev_capable_udp_rss(enic->vdev)) {
enic->flow_type_rss_offloads |=
- ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV6_UDP;
+ ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV6_UDP |
+ ETH_RSS_IPV6_UDP_EX;
}
/* Zero offloads if RSS is not enabled */
--
2.16.2
next prev parent reply other threads:[~2018-05-03 19:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 19:37 [dpdk-dev] [PATCH 1/6] net/enic: enable RQ first and then post Rx buffers John Daley
2018-05-03 19:37 ` [dpdk-dev] [PATCH 2/6] net/enic: fix the MTU handler to rely on max packet length John Daley
2018-05-03 19:37 ` [dpdk-dev] [PATCH 3/6] net/enic: set rte errno to positive value John Daley
2018-05-03 19:37 ` [dpdk-dev] [PATCH 4/6] doc: update the enic guide and features John Daley
2018-05-03 19:37 ` John Daley [this message]
2018-05-03 19:37 ` [dpdk-dev] [PATCH 6/6] net/enic: update UDP RSS controls John Daley
2018-05-09 18:50 ` [dpdk-dev] [PATCH 1/6] net/enic: enable RQ first and then post Rx buffers Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180503193713.20622-5-johndale@cisco.com \
--to=johndale@cisco.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=hyonkim@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).