diff options
author | Haiyue Wang <haiyue.wang@intel.com> | 2021-04-13 08:48:43 +0800 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2021-04-22 09:26:23 -0700 |
commit | 7b8f3f957b22746bc9a410d7cd2e9edd0efcc9f5 (patch) | |
tree | d5a8c07ff1b84188be3927f82647a7000ca855c7 /drivers/net/ethernet/intel/iavf/iavf_ethtool.c | |
parent | 5ab91e0593a15652d31d3eb0bd6d28bf0bc9b36c (diff) | |
download | linux-7b8f3f957b22746bc9a410d7cd2e9edd0efcc9f5.tar.gz linux-7b8f3f957b22746bc9a410d7cd2e9edd0efcc9f5.tar.bz2 linux-7b8f3f957b22746bc9a410d7cd2e9edd0efcc9f5.zip |
iavf: Support for modifying UDP RSS flow hashing
Provides the ability to enable UDP RSS hashing by ethtool.
It gives users option of generating RSS hash based on the UDP source
and destination ports numbers, IPv4 or IPv6 source and destination
addresses.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/iavf/iavf_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c index d8dca5645c21..e6169a336694 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -1434,10 +1434,18 @@ static u32 iavf_adv_rss_parse_hdrs(struct ethtool_rxnfc *cmd) hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_TCP | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV4; break; + case UDP_V4_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_UDP | + IAVF_ADV_RSS_FLOW_SEG_HDR_IPV4; + break; case TCP_V6_FLOW: hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_TCP | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6; break; + case UDP_V6_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_UDP | + IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6; + break; default: break; } @@ -1459,12 +1467,14 @@ static u64 iavf_adv_rss_parse_hash_flds(struct ethtool_rxnfc *cmd) if (cmd->data & RXH_IP_SRC || cmd->data & RXH_IP_DST) { switch (cmd->flow_type) { case TCP_V4_FLOW: + case UDP_V4_FLOW: if (cmd->data & RXH_IP_SRC) hfld |= IAVF_ADV_RSS_HASH_FLD_IPV4_SA; if (cmd->data & RXH_IP_DST) hfld |= IAVF_ADV_RSS_HASH_FLD_IPV4_DA; break; case TCP_V6_FLOW: + case UDP_V6_FLOW: if (cmd->data & RXH_IP_SRC) hfld |= IAVF_ADV_RSS_HASH_FLD_IPV6_SA; if (cmd->data & RXH_IP_DST) @@ -1484,6 +1494,13 @@ static u64 iavf_adv_rss_parse_hash_flds(struct ethtool_rxnfc *cmd) if (cmd->data & RXH_L4_B_2_3) hfld |= IAVF_ADV_RSS_HASH_FLD_TCP_DST_PORT; break; + case UDP_V4_FLOW: + case UDP_V6_FLOW: + if (cmd->data & RXH_L4_B_0_1) + hfld |= IAVF_ADV_RSS_HASH_FLD_UDP_SRC_PORT; + if (cmd->data & RXH_L4_B_2_3) + hfld |= IAVF_ADV_RSS_HASH_FLD_UDP_DST_PORT; + break; default: break; } @@ -1617,10 +1634,12 @@ iavf_get_adv_rss_hash_opt(struct iavf_adapter *adapter, IAVF_ADV_RSS_HASH_FLD_IPV6_DA)) cmd->data |= (u64)RXH_IP_DST; - if (hash_flds & IAVF_ADV_RSS_HASH_FLD_TCP_SRC_PORT) + if (hash_flds & (IAVF_ADV_RSS_HASH_FLD_TCP_SRC_PORT | + IAVF_ADV_RSS_HASH_FLD_UDP_SRC_PORT)) cmd->data |= (u64)RXH_L4_B_0_1; - if (hash_flds & IAVF_ADV_RSS_HASH_FLD_TCP_DST_PORT) + if (hash_flds & (IAVF_ADV_RSS_HASH_FLD_TCP_DST_PORT | + IAVF_ADV_RSS_HASH_FLD_UDP_DST_PORT)) cmd->data |= (u64)RXH_L4_B_2_3; return 0; |