From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Slawomir Laba <slawomirx.laba@intel.com>,
Michal Jaron <michalx.jaron@intel.com>,
Mateusz Palczewski <mateusz.palczewski@intel.com>,
Jacob Keller <jacob.e.keller@intel.com>,
Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>,
Gurucharan <gurucharanx.g@intel.com>
Subject: [PATCH 5.4 51/64] i40e: Fix ethtool rx-flow-hash setting for X722
Date: Wed, 2 Nov 2022 03:34:17 +0100 [thread overview]
Message-ID: <20221102022053.463671290@linuxfoundation.org> (raw)
In-Reply-To: <20221102022051.821538553@linuxfoundation.org>
From: Slawomir Laba <slawomirx.laba@intel.com>
[ Upstream commit 54b5af5a438076082d482cab105b1bd484ab5074 ]
When enabling flow type for RSS hash via ethtool:
ethtool -N $pf rx-flow-hash tcp4|tcp6|udp4|udp6 s|d
the driver would fail to setup this setting on X722
device since it was using the mask on the register
dedicated for X710 devices.
Apply a different mask on the register when setting the
RSS hash for the X722 device.
When displaying the flow types enabled via ethtool:
ethtool -n $pf rx-flow-hash tcp4|tcp6|udp4|udp6
the driver would print wrong values for X722 device.
Fix this issue by testing masks for X722 device in
i40e_get_rss_hash_opts function.
Fixes: eb0dd6e4a3b3 ("i40e: Allow RSS Hash set with less than four parameters")
Signed-off-by: Slawomir Laba <slawomirx.laba@intel.com>
Signed-off-by: Michal Jaron <michalx.jaron@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20221024100526.1874914-1-jacob.e.keller@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/intel/i40e/i40e_ethtool.c | 31 ++++++++++++++-----
drivers/net/ethernet/intel/i40e/i40e_type.h | 4 +++
2 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 689deecb4e1a..b9efd379a447 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -3082,10 +3082,17 @@ static int i40e_get_rss_hash_opts(struct i40e_pf *pf, struct ethtool_rxnfc *cmd)
if (cmd->flow_type == TCP_V4_FLOW ||
cmd->flow_type == UDP_V4_FLOW) {
- if (i_set & I40E_L3_SRC_MASK)
- cmd->data |= RXH_IP_SRC;
- if (i_set & I40E_L3_DST_MASK)
- cmd->data |= RXH_IP_DST;
+ if (hw->mac.type == I40E_MAC_X722) {
+ if (i_set & I40E_X722_L3_SRC_MASK)
+ cmd->data |= RXH_IP_SRC;
+ if (i_set & I40E_X722_L3_DST_MASK)
+ cmd->data |= RXH_IP_DST;
+ } else {
+ if (i_set & I40E_L3_SRC_MASK)
+ cmd->data |= RXH_IP_SRC;
+ if (i_set & I40E_L3_DST_MASK)
+ cmd->data |= RXH_IP_DST;
+ }
} else if (cmd->flow_type == TCP_V6_FLOW ||
cmd->flow_type == UDP_V6_FLOW) {
if (i_set & I40E_L3_V6_SRC_MASK)
@@ -3392,12 +3399,15 @@ static int i40e_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
/**
* i40e_get_rss_hash_bits - Read RSS Hash bits from register
+ * @hw: hw structure
* @nfc: pointer to user request
* @i_setc: bits currently set
*
* Returns value of bits to be set per user request
**/
-static u64 i40e_get_rss_hash_bits(struct ethtool_rxnfc *nfc, u64 i_setc)
+static u64 i40e_get_rss_hash_bits(struct i40e_hw *hw,
+ struct ethtool_rxnfc *nfc,
+ u64 i_setc)
{
u64 i_set = i_setc;
u64 src_l3 = 0, dst_l3 = 0;
@@ -3416,8 +3426,13 @@ static u64 i40e_get_rss_hash_bits(struct ethtool_rxnfc *nfc, u64 i_setc)
dst_l3 = I40E_L3_V6_DST_MASK;
} else if (nfc->flow_type == TCP_V4_FLOW ||
nfc->flow_type == UDP_V4_FLOW) {
- src_l3 = I40E_L3_SRC_MASK;
- dst_l3 = I40E_L3_DST_MASK;
+ if (hw->mac.type == I40E_MAC_X722) {
+ src_l3 = I40E_X722_L3_SRC_MASK;
+ dst_l3 = I40E_X722_L3_DST_MASK;
+ } else {
+ src_l3 = I40E_L3_SRC_MASK;
+ dst_l3 = I40E_L3_DST_MASK;
+ }
} else {
/* Any other flow type are not supported here */
return i_set;
@@ -3532,7 +3547,7 @@ static int i40e_set_rss_hash_opt(struct i40e_pf *pf, struct ethtool_rxnfc *nfc)
flow_pctype)) |
((u64)i40e_read_rx_ctl(hw, I40E_GLQF_HASH_INSET(1,
flow_pctype)) << 32);
- i_set = i40e_get_rss_hash_bits(nfc, i_setc);
+ i_set = i40e_get_rss_hash_bits(&pf->hw, nfc, i_setc);
i40e_write_rx_ctl(hw, I40E_GLQF_HASH_INSET(0, flow_pctype),
(u32)i_set);
i40e_write_rx_ctl(hw, I40E_GLQF_HASH_INSET(1, flow_pctype),
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 666a251e8c72..047068120ba7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -1470,6 +1470,10 @@ struct i40e_lldp_variables {
#define I40E_PFQF_CTL_0_HASHLUTSIZE_512 0x00010000
/* INPUT SET MASK for RSS, flow director, and flexible payload */
+#define I40E_X722_L3_SRC_SHIFT 49
+#define I40E_X722_L3_SRC_MASK (0x3ULL << I40E_X722_L3_SRC_SHIFT)
+#define I40E_X722_L3_DST_SHIFT 41
+#define I40E_X722_L3_DST_MASK (0x3ULL << I40E_X722_L3_DST_SHIFT)
#define I40E_L3_SRC_SHIFT 47
#define I40E_L3_SRC_MASK (0x3ULL << I40E_L3_SRC_SHIFT)
#define I40E_L3_V6_SRC_SHIFT 43
--
2.35.1
next prev parent reply other threads:[~2022-11-02 3:25 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 2:33 [PATCH 5.4 00/64] 5.4.223-rc1 review Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 01/64] can: j1939: transport: j1939_session_skb_drop_old(): spin_unlock_irqrestore() before kfree_skb() Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 02/64] can: kvaser_usb: Fix possible completions during init_completion Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 03/64] ALSA: Use del_timer_sync() before freeing timer Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 04/64] ALSA: au88x0: use explicitly signed char Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 05/64] USB: add RESET_RESUME quirk for NVIDIA Jetson devices in RCM Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 06/64] usb: dwc3: gadget: Stop processing more requests on IMI Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 07/64] usb: dwc3: gadget: Dont set IMI for no_interrupt Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 08/64] usb: bdc: change state when port disconnected Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 09/64] usb: xhci: add XHCI_SPURIOUS_SUCCESS to ASM1042 despite being a V0.96 controller Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 10/64] mtd: rawnand: marvell: Use correct logic for nand-keep-config Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 11/64] xhci: Remove device endpoints from bandwidth list when freeing the device Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 12/64] tools: iio: iio_utils: fix digit calculation Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 13/64] iio: light: tsl2583: Fix module unloading Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 14/64] fbdev: smscufx: Fix several use-after-free bugs Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 15/64] mac802154: Fix LQI recording Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 16/64] drm/msm/dsi: fix memory corruption with too many bridges Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 17/64] drm/msm/hdmi: " Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 18/64] mmc: core: Fix kernel panic when remove non-standard SDIO card Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 19/64] kernfs: fix use-after-free in __kernfs_remove Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 20/64] perf auxtrace: Fix address filter symbol name match for modules Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 21/64] s390/futex: add missing EX_TABLE entry to __futex_atomic_op() Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 22/64] s390/pci: add missing EX_TABLE entries to __pcistg_mio_inuser()/__pcilg_mio_inuser() Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 23/64] xfs: finish dfops on every insert range shift iteration Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 24/64] xfs: clear XFS_DQ_FREEING if we cant lock the dquot buffer to flush Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 25/64] xfs: force the log after remapping a synchronous-writes file Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 26/64] Xen/gntdev: dont ignore kernel unmapping error Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 27/64] xen/gntdev: Prevent leaking grants Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 28/64] cgroup-v1: add disabled controller check in cgroup1_parse_param() Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 29/64] mm,hugetlb: take hugetlb_lock before decrementing h->resv_huge_pages Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 30/64] net: ieee802154: fix error return code in dgram_bind() Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 31/64] media: v4l2: Fix v4l2_i2c_subdev_set_name function documentation Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 32/64] drm/msm: Fix return type of mdp4_lvds_connector_mode_valid Greg Kroah-Hartman
2022-11-02 2:33 ` [PATCH 5.4 33/64] arc: iounmap() arg is volatile Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 34/64] ALSA: ac97: fix possible memory leak in snd_ac97_dev_register() Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 35/64] tipc: fix a null-ptr-deref in tipc_topsrv_accept Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 36/64] net: netsec: fix error handling in netsec_register_mdio() Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 37/64] x86/unwind/orc: Fix unreliable stack dump with gcov Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 38/64] amd-xgbe: fix the SFP compliance codes check for DAC cables Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 39/64] amd-xgbe: add the bit rate quirk for Molex cables Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 40/64] kcm: annotate data-races around kcm->rx_psock Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 41/64] kcm: annotate data-races around kcm->rx_wait Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 42/64] net: fix UAF issue in nfqnl_nf_hook_drop() when ops_init() failed Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 43/64] net: lantiq_etop: dont free skb when returning NETDEV_TX_BUSY Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 44/64] tcp: fix indefinite deferral of RTO with SACK reneging Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 45/64] can: mscan: mpc5xxx: mpc5xxx_can_probe(): add missing put_clock() in error path Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 46/64] PM: hibernate: Allow hybrid sleep to work with s2idle Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 47/64] media: vivid: s_fbuf: add more sanity checks Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 48/64] media: vivid: dev->bitmap_cap wasnt freed in all cases Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 49/64] media: v4l2-dv-timings: add sanity checks for blanking values Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 50/64] media: videodev2.h: V4L2_DV_BT_BLANKING_HEIGHT should check interlaced Greg Kroah-Hartman
2022-11-02 2:34 ` Greg Kroah-Hartman [this message]
2022-11-02 2:34 ` [PATCH 5.4 52/64] i40e: Fix VF hang when reset is triggered on another VF Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 53/64] i40e: Fix flow-type by setting GL_HASH_INSET registers Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 54/64] net: ksz884x: fix missing pci_disable_device() on error in pcidev_init() Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 55/64] PM: domains: Fix handling of unavailable/disabled idle states Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 56/64] ALSA: aoa: i2sbus: fix possible memory leak in i2sbus_add_dev() Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 57/64] ALSA: aoa: Fix I2S device accounting Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 58/64] openvswitch: switch from WARN to pr_warn Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 59/64] net: ehea: fix possible memory leak in ehea_register_port() Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 60/64] nh: fix scope used to find saddr when adding non gw nh Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 61/64] net/mlx5e: Do not increment ESN when updating IPsec ESN state Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 62/64] net/mlx5: Fix possible use-after-free in async command interface Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 63/64] net: enetc: survive memory pressure without crashing Greg Kroah-Hartman
2022-11-02 2:34 ` [PATCH 5.4 64/64] can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ storm on global FIFO receive Greg Kroah-Hartman
2022-11-02 17:50 ` [PATCH 5.4 00/64] 5.4.223-rc1 review Florian Fainelli
2022-11-02 20:46 ` Guenter Roeck
2022-11-03 9:18 ` Naresh Kamboju
2022-11-03 12:21 ` Sudip Mukherjee
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=20221102022053.463671290@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=gurucharanx.g@intel.com \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=mateusz.palczewski@intel.com \
--cc=michalx.jaron@intel.com \
--cc=patches@lists.linux.dev \
--cc=sashal@kernel.org \
--cc=slawomirx.laba@intel.com \
--cc=stable@vger.kernel.org \
/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).