Commit a1264177 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

pkgdep/git: Adjust ICE driver to kernel >= 6.8.x



Change-Id: I5188750fe98a410b28a3c0b5caa48590b134b1b4
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22803


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent af95268b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -405,6 +405,10 @@ function install_ice() {
			< "$rootdir/test/common/config/pkgdep/patches/ice/0001-xdp_do_flush_map.patch"
	fi

	if ge "$kernel_ver" 6.8.0; then
		patch --dir="$GIT_REPOS/ice-$ICE_VERSION/src"
	fi < "$rootdir/test/common/config/pkgdep/patches/ice/0001-ethtool-set-get-rxfh-params.patch"

	(
		cd "$GIT_REPOS/ice-$ICE_VERSION/src"
		sudo make -j"$(nproc)" install
+121 −0
Original line number Diff line number Diff line
Adjust use of ethtool_ops as per recent changes in 6.8.x. This patch is
based on changes applied to the upstream ICE driver via the following
commit:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fb6e30a72539

---
 src/ice_ethtool.c | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/src/ice_ethtool.c b/src/ice_ethtool.c
index e1eeb16..155d38d 100644
--- a/src/ice_ethtool.c
+++ b/src/ice_ethtool.c
@@ -4739,7 +4739,7 @@ static u32 ice_get_rxfh_indir_size(struct net_device *netdev)
  * Reads the indirection table directly from the hardware.
  */
 static int
-ice_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, u8 *hfunc)
+ice_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
 #else
 static int ice_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
 #endif
@@ -4751,11 +4751,10 @@ static int ice_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
 	u8 *lut;
 
 #ifdef HAVE_RXFH_HASHFUNC
-	if (hfunc)
-		*hfunc = ETH_RSS_HASH_TOP;
+	rxfh->hfunc = ETH_RSS_HASH_TOP;
 #endif
 
-	if (!indir)
+	if (!rxfh->indir)
 		return 0;
 
 	if (!test_bit(ICE_FLAG_RSS_ENA, pf->flags)) {
@@ -4768,7 +4767,7 @@ static int ice_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
 	if (!lut)
 		return -ENOMEM;
 
-	err = ice_get_rss_key(vsi, key);
+	err = ice_get_rss_key(vsi, rxfh->key);
 	if (err)
 		goto out;
 
@@ -4777,7 +4776,7 @@ static int ice_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
 		goto out;
 
 	for (i = 0; i < vsi->rss_table_size; i++)
-		indir[i] = (u32)(lut[i]);
+		rxfh->indir[i] = (u32)(lut[i]);
 
 out:
 	kfree(lut);
@@ -4796,8 +4795,7 @@ out:
  * returns 0 after programming the table.
  */
 static int
-ice_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key,
-	     const u8 hfunc)
+ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh, struct netlink_ext_ack *extack)
 #elif defined(HAVE_RXFH_NONCONST)
 static int ice_set_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
 #else
@@ -4813,7 +4811,7 @@ ice_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key)
 
 	dev = ice_pf_to_dev(pf);
 #ifdef HAVE_RXFH_HASHFUNC
-	if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
+	if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && rxfh->hfunc != ETH_RSS_HASH_TOP)
 		return -EOPNOTSUPP;
 #endif
 
@@ -4824,11 +4822,11 @@ ice_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key)
 	}
 
 	/* Verify user input. */
-	if (indir) {
+	if (rxfh->indir) {
 		int i;
 
 		for (i = 0; i < vsi->rss_table_size; i++)
-			if (indir[i] >= vsi->rss_size)
+			if (rxfh->indir[i] >= vsi->rss_size)
 				return -EINVAL;
 	}
 
@@ -4839,7 +4837,7 @@ ice_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key)
 	}
 
 #endif /* NETIF_F_HW_TC */
-	if (key) {
+	if (rxfh->key) {
 		if (!vsi->rss_hkey_user) {
 			vsi->rss_hkey_user = devm_kzalloc(dev,
 							  ICE_VSIQF_HKEY_ARRAY_SIZE,
@@ -4847,7 +4845,7 @@ ice_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key)
 			if (!vsi->rss_hkey_user)
 				return -ENOMEM;
 		}
-		memcpy(vsi->rss_hkey_user, key, ICE_VSIQF_HKEY_ARRAY_SIZE);
+		memcpy(vsi->rss_hkey_user, rxfh->key, ICE_VSIQF_HKEY_ARRAY_SIZE);
 
 		err = ice_set_rss_key(vsi, vsi->rss_hkey_user);
 		if (err)
@@ -4862,11 +4860,11 @@ ice_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key)
 	}
 
 	/* Each 32 bits pointed by 'indir' is stored with a lut entry */
-	if (indir) {
+	if (rxfh->indir) {
 		int i;
 
 		for (i = 0; i < vsi->rss_table_size; i++)
-			vsi->rss_lut_user[i] = (u8)(indir[i]);
+			vsi->rss_lut_user[i] = (u8)(rxfh->indir[i]);
 	} else {
 		ice_fill_rss_lut(vsi->rss_lut_user, vsi->rss_table_size,
 				 vsi->rss_size);
--