From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E493FAAEE for ; Fri, 18 May 2018 09:30:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 May 2018 00:30:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,413,1520924400"; d="scan'208";a="59679230" Received: from wuyanglong.sh.intel.com ([10.67.111.132]) by orsmga002.jf.intel.com with ESMTP; 18 May 2018 00:30:31 -0700 From: Yanglong Wu To: dev@dpdk.org Cc: qi.z.zhang@intel.com, wei.dai@intel.com, Yanglong Wu Date: Fri, 18 May 2018 15:23:41 +0800 Message-Id: <20180518072341.27051-1-yanglong.wu@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180517055205.58766-1-yanglong.wu@intel.com> References: <20180517055205.58766-1-yanglong.wu@intel.com> Subject: [dpdk-dev] [PATCH v2] net/ixgbe: fix VLAN strip setting fail for per port 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: , X-List-Received-Date: Fri, 18 May 2018 07:30:34 -0000 rxq->offload should synchronize with dev_conf Fixes: 860a94d3c692 ("net/ixgbe: support VLAN strip per queue offloading in VF") Signed-off-by: Yanglong Wu --- v2: rework as comments asked --- drivers/net/ixgbe/ixgbe_ethdev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index f5006bc94..94d28878a 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2114,6 +2114,14 @@ ixgbe_vlan_hw_strip_config(struct rte_eth_dev *dev) for (i = 0; i < dev->data->nb_rx_queues; i++) { rxq = dev->data->rx_queues[i]; ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxq->reg_idx)); + + /* rxq->offload should synchronize with dev_conf*/ + if (dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_VLAN_STRIP) + rxq->offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; + else + rxq->offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; + if (rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP) { ctrl |= IXGBE_RXDCTL_VME; on = TRUE; @@ -5230,6 +5238,14 @@ ixgbevf_vlan_offload_set(struct rte_eth_dev *dev, int mask) if (mask & ETH_VLAN_STRIP_MASK) { for (i = 0; i < dev->data->nb_rx_queues; i++) { rxq = dev->data->rx_queues[i]; + + /* rxq->offload should synchronize with dev_conf*/ + if (dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_VLAN_STRIP) + rxq->offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; + else + rxq->offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; + on = !!(rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP); ixgbevf_vlan_strip_queue_set(dev, i, on); } -- 2.11.0