[v5,2/2] net/ice: fix vlan offload of rxq
Checks
Commit Message
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(+)
@@ -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;
}
@@ -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;
}