From patchwork Mon Jan 28 07:53:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao1, Wei" X-Patchwork-Id: 50064 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0AEF84F9A; Mon, 28 Jan 2019 09:19:56 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 440FD20BD; Mon, 28 Jan 2019 09:19:55 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2019 00:19:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,533,1539673200"; d="scan'208";a="121851839" Received: from dpdk6.bj.intel.com ([172.16.182.192]) by orsmga003.jf.intel.com with ESMTP; 28 Jan 2019 00:19:51 -0800 From: Wei Zhao To: dev@dpdk.org Cc: stable@dpdk.org, qi.z.zhang@intel.com, Wei Zhao Date: Mon, 28 Jan 2019 15:53:23 +0800 Message-Id: <1548662003-7339-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 Subject: [dpdk-dev] [PATCH] net/ice: enable VLAN filter offloads support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is need to check whether dev_conf.rxmode.offloads is set when start ice device, if one of the vlan related bits is set, for example DEV_RX_OFFLOAD_VLAN_FILTER and so on, sevice start process to enable this offloads request. Signed-off-by: Wei Zhao --- drivers/net/ice/ice_ethdev.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index b145d9c..94bdad3 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -1711,7 +1711,7 @@ ice_dev_start(struct rte_eth_dev *dev) struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); uint16_t nb_rxq = 0; uint16_t nb_txq, i; - int ret; + int mask, ret; /* program Tx queues' context in hardware */ for (nb_txq = 0; nb_txq < data->nb_tx_queues; nb_txq++) { @@ -1739,6 +1739,14 @@ ice_dev_start(struct rte_eth_dev *dev) ice_set_rx_function(dev); + mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK | + ETH_VLAN_EXTEND_MASK; + ret = ice_vlan_offload_set(dev, mask); + if (ret) { + PMD_INIT_LOG(ERR, "Unable to set VLAN offload"); + goto rx_err; + } + /* enable Rx interrput and mapping Rx queue to interrupt vector */ if (ice_rxq_intr_setup(dev)) return -EIO;