[dpdk-stable] patch 'net/i40e: fix virtual channel conflict' has been queued to LTS release 18.11.11

Kevin Traynor ktraynor at redhat.com
Wed Nov 18 17:35:36 CET 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/24/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/693cd7919ca616107497c8321af326466162a890

Thanks.

Kevin.

---
>From 693cd7919ca616107497c8321af326466162a890 Mon Sep 17 00:00:00 2001
From: Yuying Zhang <yuying.zhang at intel.com>
Date: Mon, 19 Oct 2020 02:20:25 +0000
Subject: [PATCH] net/i40e: fix virtual channel conflict

[ upstream commit 99e47bbe4c074c879bbe5d2c316754859fa00912 ]

i40evf_execute_vf_cmd() uses _atomic_set_cmd() to execute virtual
channel commands safely in multi-process mode and multi-thread mode.
However, it returns error when one process or thread is pending. Add
rte_spinlock_trylock() to handle this issue in concurrent scenarios.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Yuying Zhang <yuying.zhang at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/i40e/i40e_ethdev.h    |  1 +
 drivers/net/i40e/i40e_ethdev_vf.c | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 6cec6cf0c1..3def71bc54 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1029,4 +1029,5 @@ struct i40e_vf {
 	bool promisc_multicast_enabled;
 
+	rte_spinlock_t cmd_send_lock;
 	uint32_t version_major; /* Major version number */
 	uint32_t version_minor; /* Minor version number */
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index e1ebaa55de..522322d3d7 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -314,5 +314,5 @@ _atomic_set_cmd(struct i40e_vf *vf, enum virtchnl_ops ops)
 
 static int
-i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
+_i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
 {
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -383,4 +383,17 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
 }
 
+static int
+i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
+{
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+	int err;
+
+	while (!rte_spinlock_trylock(&vf->cmd_send_lock))
+		rte_delay_us_sleep(50);
+	err = _i40evf_execute_vf_cmd(dev, args);
+	rte_spinlock_unlock(&vf->cmd_send_lock);
+	return err;
+}
+
 /*
  * Check API version with sync wait until version read or fail from admin queue
@@ -1145,4 +1158,5 @@ i40evf_init_vf(struct rte_eth_dev *dev)
 	vf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	vf->dev_data = dev->data;
+	rte_spinlock_init(&vf->cmd_send_lock);
 	err = i40e_set_mac_type(hw);
 	if (err) {
-- 
2.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-18 16:33:38.879944908 +0000
+++ 0050-net-i40e-fix-virtual-channel-conflict.patch	2020-11-18 16:33:37.967215086 +0000
@@ -1 +1 @@
-From 99e47bbe4c074c879bbe5d2c316754859fa00912 Mon Sep 17 00:00:00 2001
+From 693cd7919ca616107497c8321af326466162a890 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 99e47bbe4c074c879bbe5d2c316754859fa00912 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 1466998aa1..508a940dc6 100644
+index 6cec6cf0c1..3def71bc54 100644
@@ -25 +26 @@
-@@ -1210,4 +1210,5 @@ struct i40e_vf {
+@@ -1029,4 +1029,5 @@ struct i40e_vf {
@@ -32 +33 @@
-index 53154c3ef3..6e6eef5a6a 100644
+index e1ebaa55de..522322d3d7 100644
@@ -35 +36 @@
-@@ -315,5 +315,5 @@ _atomic_set_cmd(struct i40e_vf *vf, enum virtchnl_ops ops)
+@@ -314,5 +314,5 @@ _atomic_set_cmd(struct i40e_vf *vf, enum virtchnl_ops ops)
@@ -42 +43 @@
-@@ -406,4 +406,17 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
+@@ -383,4 +383,17 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
@@ -60 +61 @@
-@@ -1247,4 +1260,5 @@ i40evf_init_vf(struct rte_eth_dev *dev)
+@@ -1145,4 +1158,5 @@ i40evf_init_vf(struct rte_eth_dev *dev)



More information about the stable mailing list