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 9DF51A04FD for ; Tue, 8 Nov 2022 05:27:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9813B410EA; Tue, 8 Nov 2022 05:27:45 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 9FC6C40E50; Tue, 8 Nov 2022 05:27:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667881663; x=1699417663; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=efamDdCi19Syh+JptkOKUcR7qn2ERmCkQxTYiuxXdo8=; b=LwHjyRgHtsvmJdHGBdJJseek9VgRyKUkgT6itjORoovdCtxYpiSAAOgt uRXmGZqNq5QRZyjGKXKOSCX+x8f5mUCD1l2mKt04/w3ukuac49oxWh67k SZs9joUK2GWf+l309K4EEJckikvtPqwvQFfmDR4YxZoukWztti/IrDCtV 6MVs43mj0xiJfqUy/OVy7SSs9t/8uJ6P7lY2mJqsxBBTHSrPXqaFFxy// CPL9eBF8aRk0BBjHiZvFZ+uUdijf64T6fkOFU9HllmO04bj+hdgfq6Ahl RP52gwrOUsWQS9qKOrj1xoQheoC0GwI+uAom9d4qD0zApj0QQeM/BOl2E g==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="293969931" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="293969931" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 20:27:42 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="699764733" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="699764733" Received: from unknown (HELO yemj..) ([10.239.252.253]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 20:27:39 -0800 From: Mingjin Ye To: dev@dpdk.org Cc: stable@dpdk.org, yidingx.zhou@intel.com, Mingjin Ye , Qiming Yang , Qi Zhang , Wenzhuo Lu , Xiaoyun Li , Jingjing Wu , Ferruh Yigit Subject: [PATCH v5 2/2] net/ice: fix vlan offload of rxq Date: Tue, 8 Nov 2022 12:14:27 +0000 Message-Id: <20221108121428.713729-2-mingjinx.ye@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221108121428.713729-1-mingjinx.ye@intel.com> References: <20221108121428.713729-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