From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D271A04FD for ; Tue, 8 Nov 2022 06:41:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1018D42D2A; Tue, 8 Nov 2022 06:41:21 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 6136B42D2A; Tue, 8 Nov 2022 06:41:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667886078; x=1699422078; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=efamDdCi19Syh+JptkOKUcR7qn2ERmCkQxTYiuxXdo8=; b=Ps7sCrQaf7hFut7+442PePf2/WP/Lir+Wg3tXZx+E6YqocEQb3Hkc3uQ R5KkSPoHc31rKt5u02s1ZxD69U5pGO7z/EezGu0/pvjlRfosLcadgoKyg WRMI+dTK3BkruM589Hw/TzKJIpO5u+hPSo0YpGwaA/xkHeW/FhSyDpvFA sfTX2EK1u5e970kFCKTOFfZftIqb9aYC/0408jFp9NNifaug310a3HuEO iyrDr7Y0XJgEVcgIvl/7xbXj4Xms2F1vVduRDduZwM7khdvxJnTuweLAU l/NIeFLZb4A8zB8W5bP991rELO4ubhla29A2Z3SW/1ylgniQbvYOQET5R w==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="396905836" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="396905836" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 21:41:18 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="667459329" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="667459329" Received: from unknown (HELO yemj..) ([10.239.252.253]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 21:41:14 -0800 From: Mingjin Ye To: dev@dpdk.org Cc: qiming.yang@intel.com, stable@dpdk.org, yidingx.zhou@intel.com, Mingjin Ye , Qi Zhang , Ferruh Yigit , Jingjing Wu , Xiaoyun Li , Wenzhuo Lu Subject: [PATCH v5 2/2] net/ice: fix vlan offload of rxq Date: Tue, 8 Nov 2022 13:28:04 +0000 Message-Id: <20221108132804.714764-2-mingjinx.ye@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221108132804.714764-1-mingjinx.ye@intel.com> References: <20221026171007.654038-1-mingjinx.ye@intel.com> <20221108132804.714764-1-mingjinx.ye@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- 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