patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Mingjin Ye <mingjinx.ye@intel.com>
To: dev@dpdk.org
Cc: qiming.yang@intel.com, stable@dpdk.org, yidingx.zhou@intel.com,
	Mingjin Ye <mingjinx.ye@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Xiaoyun Li <xiaoyun.li@intel.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>
Subject: [PATCH v5 2/2] net/ice: fix vlan offload of rxq
Date: Tue,  8 Nov 2022 13:28:04 +0000	[thread overview]
Message-ID: <20221108132804.714764-2-mingjinx.ye@intel.com> (raw)
In-Reply-To: <20221108132804.714764-1-mingjinx.ye@intel.com>

After setting "vlan offload" in pmd, the configuration of rxq is not
updated.

This patch is to sync the rxmode offload config with rxq.

Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
Cc: stable@dpdk.org

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
---
 drivers/net/ice/ice_dcf_ethdev.c | 15 +++++++++++++++
 drivers/net/ice/ice_ethdev.c     |  7 +++++++
 2 files changed, 22 insertions(+)

diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c
index dcbf2af5b0..c32bf4ec03 100644
--- a/drivers/net/ice/ice_dcf_ethdev.c
+++ b/drivers/net/ice/ice_dcf_ethdev.c
@@ -1227,6 +1227,8 @@ dcf_dev_vlan_offload_set_v2(struct rte_eth_dev *dev, int mask)
 	struct ice_dcf_hw *hw = &adapter->real_hw;
 	bool enable;
 	int err;
+	size_t queue_idx;
+	struct ice_rx_queue *rxq;
 
 	if (mask & RTE_ETH_VLAN_FILTER_MASK) {
 		enable = !!(rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_FILTER);
@@ -1245,6 +1247,11 @@ dcf_dev_vlan_offload_set_v2(struct rte_eth_dev *dev, int mask)
 			return -EIO;
 	}
 
+	for (queue_idx = 0; queue_idx < dev->data->nb_rx_queues; queue_idx++) {
+		rxq = dev->data->rx_queues[queue_idx];
+		rxq->offloads = rxmode->offloads;
+	}
+
 	return 0;
 }
 
@@ -1287,6 +1294,8 @@ dcf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	struct ice_dcf_adapter *adapter = dev->data->dev_private;
 	struct ice_dcf_hw *hw = &adapter->real_hw;
 	int err;
+	size_t queue_idx;
+	struct ice_rx_queue *rxq;
 
 	if (hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2)
 		return dcf_dev_vlan_offload_set_v2(dev, mask);
@@ -1305,6 +1314,12 @@ dcf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 		if (err)
 			return -EIO;
 	}
+
+	for (queue_idx = 0; queue_idx < dev->data->nb_rx_queues; queue_idx++) {
+		rxq = dev->data->rx_queues[queue_idx];
+		rxq->offloads = dev_conf->rxmode.offloads;
+	}
+
 	return 0;
 }
 
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 8618a3e6b7..5562ceb671 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -4501,6 +4501,8 @@ ice_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
 	struct rte_eth_rxmode *rxmode;
+	size_t queue_idx;
+	struct ice_rx_queue *rxq;
 
 	rxmode = &dev->data->dev_conf.rxmode;
 	if (mask & RTE_ETH_VLAN_FILTER_MASK) {
@@ -4517,6 +4519,11 @@ ice_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 			ice_vsi_config_vlan_stripping(vsi, false);
 	}
 
+	for (queue_idx = 0; queue_idx < dev->data->nb_rx_queues; queue_idx++) {
+		rxq = dev->data->rx_queues[queue_idx];
+		rxq->offloads = rxmode->offloads;
+	}
+
 	return 0;
 }
 
-- 
2.34.1


  reply	other threads:[~2022-11-08  5:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 17:10 [PATCH v4 1/2] app/testpmd: " Mingjin Ye
2022-10-26  9:52 ` lihuisong (C)
2022-10-27 11:02   ` Ye, MingjinX
2022-10-28  2:09     ` lihuisong (C)
2022-11-03  1:28       ` Ye, MingjinX
2022-11-03  7:01         ` lihuisong (C)
2022-11-04  8:21           ` Ye, MingjinX
2022-11-04 10:17             ` lihuisong (C)
2022-11-04 11:33               ` Ye, MingjinX
2022-11-06 10:32                 ` Andrew Rybchenko
2022-11-07  7:18                   ` Ye, MingjinX
2022-10-26 17:10 ` [PATCH v4 2/2] net/ice: fix vlan offload Mingjin Ye
2022-10-27  8:36   ` Huang, ZhiminX
2022-10-27  8:36 ` [PATCH v4 1/2] app/testpmd: fix vlan offload of rxq Huang, ZhiminX
2022-10-27 13:16   ` Singh, Aman Deep
2022-11-08 13:28 ` [PATCH v5 1/2] net/ice: fix vlan offload Mingjin Ye
2022-11-08 13:28   ` Mingjin Ye [this message]
2022-11-09  1:52     ` [PATCH v5 2/2] net/ice: fix vlan offload of rxq Huang, ZhiminX
2022-11-21  2:54     ` [PATCH v6] doc: add PMD known issue Mingjin Ye
2022-11-25  1:55       ` Ye, MingjinX
2022-12-09 10:20         ` Ye, MingjinX
2022-12-13  1:41       ` Zhang, Qi Z
2022-12-13  4:25         ` Ye, MingjinX
2022-12-23  7:32       ` [PATCH v7] " Mingjin Ye
2022-12-26  2:52       ` Mingjin Ye
2022-12-27  9:00       ` Mingjin Ye
2022-12-27 16:40         ` Stephen Hemminger
2023-01-28  6:01         ` [PATCH v8] " Mingjin Ye
2023-01-28 17:17           ` Stephen Hemminger
2023-02-02  2:30             ` Ye, MingjinX
2022-11-09  1:51   ` [PATCH v5 1/2] net/ice: fix vlan offload Huang, ZhiminX
2022-11-11  3:34   ` Ye, MingjinX
2022-11-08 10:12 Mingjin Ye
2022-11-08 10:12 ` [PATCH v5 2/2] net/ice: fix vlan offload of rxq Mingjin Ye
2022-11-08 12:14 [PATCH v5 1/2] net/ice: fix vlan offload Mingjin Ye
2022-11-08 12:14 ` [PATCH v5 2/2] net/ice: fix vlan offload of rxq Mingjin Ye

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=20221108132804.714764-2-mingjinx.ye@intel.com \
    --to=mingjinx.ye@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    --cc=xiaoyun.li@intel.com \
    --cc=yidingx.zhou@intel.com \
    /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).