From patchwork Mon Apr 16 08:38:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Xueqin" X-Patchwork-Id: 38176 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 886541B1B7; Mon, 16 Apr 2018 10:38:13 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id A45A41B1AC; Mon, 16 Apr 2018 10:38:11 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2018 01:38:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,459,1517904000"; d="scan'208";a="34574766" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 16 Apr 2018 01:38:09 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 16 Apr 2018 01:38:09 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 16 Apr 2018 01:38:08 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.239]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.197]) with mapi id 14.03.0319.002; Mon, 16 Apr 2018 16:38:07 +0800 From: "Lin, Xueqin" To: "Dai, Wei" , "Lu, Wenzhuo" , "Ananyev, Konstantin" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip Thread-Index: AQHT1V2dpacKdr7K60mQtP48t0zvcqQDELvw Date: Mon, 16 Apr 2018 08:38:07 +0000 Message-ID: <0D300480287911409D9FF92C1FA2A3355B2E8573@SHSMSX104.ccr.corp.intel.com> References: <1523866465-26067-1-git-send-email-wei.dai@intel.com> In-Reply-To: <1523866465-26067-1-git-send-email-wei.dai@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip 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" Tested-by: Xueqin Lin 1. Branch: master 2. NIC: Niantic Steps: 1. Pull branch code to newest and apply the patch 2. Create one VF port using kernel PF echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/sriov_numvfs 3. Bind VF to igb_uio 4. Start testpmd, find VF testpmd could startup successfully. ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 4 -- -i Result: This patch could fix VF can't setup successfully in Niantic NIC. Best regards, Xueqin -----Original Message----- From: Dai, Wei Sent: Monday, April 16, 2018 4:14 PM To: Lu, Wenzhuo ; Ananyev, Konstantin ; Zhang, Qi Z ; Lin, Xueqin Cc: dev@dpdk.org; Dai, Wei ; stable@dpdk.org Subject: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip This patch fixes a segment fault in ixgbevf_vlan_offload_set( ) when a Rx queue with index < max_rx_queues is not setup. For such queue, rxq = dev->data->rx_queues[i] is null pointer. Fixes: 860a94d3c692 ("net/ixgbe: support VLAN strip per queue offloading in VF") Cc: stable@dpdk.org Signed-off-by: Wei Dai --- drivers/net/ixgbe/ixgbe_ethdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index a5e2fc0..33ee52e 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -5184,15 +5184,13 @@ ixgbevf_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on) static int ixgbevf_vlan_offload_set(struct rte_eth_dev *dev, int mask) { - struct ixgbe_hw *hw = - IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct ixgbe_rx_queue *rxq; uint16_t i; int on = 0; /* VF function only support hw strip feature, others are not support */ if (mask & ETH_VLAN_STRIP_MASK) { - for (i = 0; i < hw->mac.max_rx_queues; i++) { + for (i = 0; i < dev->data->nb_rx_queues; i++) { rxq = dev->data->rx_queues[i]; on = !!(rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP); ixgbevf_vlan_strip_queue_set(dev, i, on); -- 2.7.5