Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
26701fef8b
!41 change download path of the source code
From: @chengyechun 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2022-11-25 06:31:22 +00:00
chengyechun
e9dd495526 change download path of the source code 2022-11-25 11:33:55 +08:00
openeuler-ci-bot
bd4a31be6e
!33 i40e: fix use-after-free in i40e_sync_filters_subtask()
From: @chengyechun 
Reviewed-by: @wangxp006 
Signed-off-by: @wangxp006
2022-03-21 07:15:10 +00:00
chengyechun
181f55d3bf i40e:fix-use-after-free-in-i40e_sync_filter_subtask() 2022-03-21 11:41:35 +08:00
openeuler-ci-bot
860aef0f52
!29 ethtool: extend ringparam setting/getting API with rx_buf_len
Merge pull request !29 from pojunxing/openEuler-22.03-LTS-Next
2022-01-11 01:31:24 +00:00
chengyechun
01ac67e833 ethtool: extend ringparam setting/getting API with rx_buf_len 2022-01-10 17:19:19 +08:00
openeuler-ci-bot
62c82f05ee !25 fix ATR queue selection
From: @gebidelidaye
Reviewed-by: @wangxp006
Signed-off-by: @wangxp006
2021-11-04 03:38:09 +00:00
liaichun
49e8206c7f fix ATR queue selection
Signed-off-by: liaichun <liaichun@huawei.com>

Conflicts:
	Fix-ATR-queue-selection.patch
	i40e.spec
2021-11-04 11:21:58 +08:00
openeuler-ci-bot
c526a13b29 !14 fix i40e build failed
From: @haochenstar
Reviewed-by: @zengwefeng
Signed-off-by: @zengwefeng
2021-09-16 09:14:54 +00:00
haochenstar
106fb008ac fix i40e build failed 2021-09-16 14:07:19 +08:00
5 changed files with 268 additions and 2 deletions

View File

@ -0,0 +1,60 @@
From f3ccfda1931977b80267ba54070a1aeafa18f6ca Mon Sep 17 00:00:00 2001
From: Yufeng Mo <moyufeng@huawei.com>
Date: Fri, 20 Aug 2021 15:35:18 +0800
Subject: [PATCH] ethtool: extend coalesce setting uAPI with CQE mode
In order to support more coalesce parameters through netlink,
add two new parameter kernel_coal and extack for .set_coalesce
and .get_coalesce, then some extra info can return to user with
the netlink API.
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
src/i40e_ethtool.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/i40e_ethtool.c b/src/i40e_ethtool.c
index 456e59c..a892ae2 100644
--- a/src/i40e_ethtool.c
+++ b/src/i40e_ethtool.c
@@ -3278,13 +3278,17 @@ static int __i40e_get_coalesce(struct net_device *netdev,
* i40e_get_coalesce - get a netdev's coalesce settings
* @netdev: the netdev to check
* @ec: ethtool coalesce data structure
+ * @kernel_coal: ethtool CQE mode setting structure
+ * @extack: extack for reporting error messages
*
* Gets the coalesce settings for a particular netdev. Note that if user has
* modified per-queue settings, this only guarantees to represent queue 0. See
* __i40e_get_coalesce for more details.
**/
static int i40e_get_coalesce(struct net_device *netdev,
- struct ethtool_coalesce *ec)
+ struct ethtool_coalesce *ec,
+ struct kernel_ethtool_coalesce *kernel_coal,
+ struct netlink_ext_ack *extack)
{
return __i40e_get_coalesce(netdev, ec, -1);
}
@@ -3503,11 +3507,15 @@ static int __i40e_set_coalesce(struct net_device *netdev,
* i40e_set_coalesce - set coalesce settings for every queue on the netdev
* @netdev: the netdev to change
* @ec: ethtool coalesce settings
+ * @kernel_coal: ethtool CQE mode setting structure
+ * @extack: extack for reporting error messages
*
* This will set each queue to the same coalesce settings.
**/
static int i40e_set_coalesce(struct net_device *netdev,
- struct ethtool_coalesce *ec)
+ struct ethtool_coalesce *ec,
+ struct kernel_ethtool_coalesce *kernel_coal,
+ struct netlink_ext_ack *extack)
{
return __i40e_set_coalesce(netdev, ec, -1);
}
--
2.23.0

View File

@ -0,0 +1,48 @@
author Hao Chen <chenhao288@hisilicon.com> 2021-11-18 20:12:43 +0800
committer David S. Miller <davem@davemloft.net> 2021-11-22 12:31:49 +0000
commit 7462494408cd3de8b0bc1e79670bf213288501d0 (patch)
tree 61a9e0eb7e7f2e53c2afca17e284dcef3f85d572
parent 0b70c256eba8448b072d25c95ee65e59da8970de (diff)
download linux-7462494408cd.tar.gz
ethtool: extend ringparam setting/getting API with rx_buf_len
Add two new parameters kernel_ringparam and extack for
.get_ringparam and .set_ringparam to extend more ring params
through netlink.
Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
src/i40e_ethtool.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/i40e_ethtool.c b/src/i40e_ethtool.c
index 456e59c..f80c7d8 100644
--- a/src/i40e_ethtool.c
+++ b/src/i40e_ethtool.c
@@ -2227,7 +2227,9 @@ static void i40e_get_drvinfo(struct net_device *netdev,
}
static void i40e_get_ringparam(struct net_device *netdev,
- struct ethtool_ringparam *ring)
+ struct ethtool_ringparam *ring,
+ struct kernel_ethtool_ringparam *kernel_ring,
+ struct netlink_ext_ack *extack)
{
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_pf *pf = np->vsi->back;
@@ -2255,7 +2257,9 @@ static bool i40e_active_tx_ring_index(struct i40e_vsi *vsi, u16 index)
}
static int i40e_set_ringparam(struct net_device *netdev,
- struct ethtool_ringparam *ring)
+ struct ethtool_ringparam *ring,
+ struct kernel_ethtool_ringparam *kernel_ring,
+ struct netlink_ext_ack *extack)
{
struct i40e_ring *tx_rings = NULL, *rx_rings = NULL;
struct i40e_netdev_priv *np = netdev_priv(netdev);
--
1.8.3.1

View File

@ -0,0 +1,53 @@
From a222be597e316389f9f8c26033352c124ce93056 Mon Sep 17 00:00:00 2001
From: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Date: Wed, 18 Aug 2021 10:42:16 -0700
Subject: i40e: Fix ATR queue selection
Without this patch, ATR does not work. Receive/transmit uses queue
selection based on SW DCB hashing method.
If traffic classes are not configured for PF, then use
netdev_pick_tx function for selecting queue for packet transmission.
Instead of calling i40e_swdcb_skb_tx_hash, call netdev_pick_tx,
which ensures that packet is transmitted/received from CPU that is
running the application.
Reproduction steps:
1. Load i40e driver
2. Map each MSI interrupt of i40e port for each CPU
3. Disable ntuple, enable ATR i.e.:
ethtool -K $interface ntuple off
ethtool --set-priv-flags $interface flow-director-atr
4. Run application that is generating traffic and is bound to a
single CPU, i.e.:
taskset -c 9 netperf -H 1.1.1.1 -t TCP_RR -l 10
5. Observe behavior:
Application's traffic should be restricted to the CPU provided in
taskset.
Fixes: 89ec1f0886c1 ("i40e: Fix queue-to-TC mapping on Tx")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
src/i40e_txrx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/i40e_txrx.c b/src/i40e_txrx.c
index 0ca5a17..8236cde 100644
--- a/src/i40e_txrx.c
+++ b/src/i40e_txrx.c
@@ -4189,8 +4189,7 @@ u16 i40e_lan_select_queue(struct net_device *netdev,
/* is DCB enabled at all? */
if (vsi->tc_config.numtc == 1)
- return i40e_swdcb_skb_tx_hash(netdev, skb,
- netdev->real_num_tx_queues);
+ return netdev_pick_tx(netdev, skb, sb_dev);
prio = skb->priority;
hw = &vsi->back->hw;
--
1.8.3.1

View File

@ -0,0 +1,70 @@
From c9435bc25587a0f20b0bfd9d0d92acb05224e515 Mon Sep 17 00:00:00 2001
From: chengyechun <chengyechun1@huawei.com>
Date: Mon, 21 Mar 2022 10:58:09 +0800
Subject: [PATCH] fix use-after-free in i40e_sync_filter_subtask()
Conflict:NA
Reference:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/log/?id=32845aa6020347fcae8d5e25548ecaef1f0c3e8a
---
src/i40e_main.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/src/i40e_main.c b/src/i40e_main.c
index 9aea7ca..c0f6055 100644
--- a/src/i40e_main.c
+++ b/src/i40e_main.c
@@ -145,6 +145,21 @@ MODULE_VERSION(DRV_VERSION);
static struct workqueue_struct *i40e_wq;
+static void netdev_hw_addr_refcnt(struct i40e_mac_filter *f, struct net_device *netdev, int delta)
+{
+ struct netdev_hw_addr *ha;
+ if (!f || !netdev)
+ return;
+ netdev_for_each_mc_addr(ha, netdev){
+ if (ether_addr_equal(ha->addr, f->macaddr)){
+ ha->refcount += delta;
+ if (ha->refcount <= 0)
+ ha->refcount = 1;
+ break;
+ }
+ }
+}
+
bool i40e_is_l4mode_enabled(void)
{
return l4mode > L4_MODE_DISABLED;
@@ -2177,6 +2192,7 @@ static void i40e_undo_add_filter_entries(struct i40e_vsi *vsi,
hlist_for_each_entry_safe(new, h, from, hlist) {
/* We can simply free the wrapper structure */
hlist_del(&new->hlist);
+ netdev_hw_addr_refcnt(new->f, vsi->netdev, -1);
kfree(new);
}
}
@@ -2578,6 +2594,10 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
retval = i40e_correct_vf_mac_vlan_filters
(vsi, &tmp_add_list, &tmp_del_list,
vlan_filters, pf->vf[vsi->vf_id].trusted);
+
+ hlist_for_each_entry(new, &tmp_add_list, hlist)
+ netdev_hw_addr_refcnt(new->f, vsi->netdev, 1);
+
if (retval)
goto err_no_memory_locked;
@@ -2710,6 +2730,9 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
if (new->f->state == I40E_FILTER_NEW)
new->f->state = new->state;
hlist_del(&new->hlist);
+
+ netdev_hw_addr_refcnt(new->f, vsi->netdev, -1);
+
kfree(new);
}
spin_unlock_bh(&vsi->mac_filter_hash_lock);
--
1.8.3.1

View File

@ -9,14 +9,19 @@
Name: i40e
Summary: Intel(R) 40-10 Gigabit Ethernet Connection Network Driver
Version: 2.14.13
Release: 5
Release: 10
Vendor: Intel Corporation
License: GPL-2.0
URL: http://support.intel.com
Source0: https://downloadcenter.intel.com/download/24411/Intel-Network-Adapter-Driver-for-PCIe-40-Gigabit-Ethernet-Network-Connections-Under-Linux-/%{name}-%{version}.tar.gz
Source0: https://downloadmirror.intel.com/30366/eng/%{name}-%{version}.tar.gz
Patch0001: fix-gcc9-new-warning.patch
Patch6000: backport-extend-coalesce-setting-uAPI-with-CQE-mode.patch
Patch6001: backport-fix-ATR-queue-selection.patch
Patch6002: backport-extend-ringparam-setting-getting-API-with-rx_buf_len.patch
Patch6003: backport-fix-use-after-free-in-i40e_sync_filter_subtask.patch
Requires: kernel, findutils, gawk, bash, hwdata
BuildRequires: kernel-devel hwdata elfutils-devel uname-build-checks gcc
@ -383,6 +388,36 @@ else
fi
%changelog
* Fri Nov 25 2022 chengyechun<chengyechun1@huawei.com> - 2.14.13-10
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:change Download Path of the Source Code
* Mon Mar 21 2022 chengyechun<chengyechun1@huawei.com> - 2.14.13-9
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix-use-after-free-in-i40e_sync_filter_subtask()
* Mon Jan 10 2022 chengyechun<chengyechun1@huawei.com> - 2.14.13-8
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:extend ringparam setting/getting API with rx_buf_len
* Thu Nov 4 2021 Aichun Li <liaichun@huawei.com> - 2.14.13-7
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix ATR queue selection
* Thu Sep 16 2021 xihaochen<xihaochen@huawei.com> - 2.14.13-6
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix i40e build failed
* Wed Jul 7 2021 gaihuiying <gaihuiying1@huawei.com> - 2.14.13-5
- Type:bugfix
- ID:NA