From patchwork Wed Apr 4 23:54:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 37215 X-Patchwork-Delegate: ferruh.yigit@amd.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 68FE51C91B; Thu, 5 Apr 2018 01:56:39 +0200 (CEST) Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) by dpdk.org (Postfix) with ESMTP id 40E691C8ED; Thu, 5 Apr 2018 01:56:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1068; q=dns/txt; s=iport; t=1522886198; x=1524095798; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=zGAxHC4DtfB6AQHixOFEDT9fLqxAsWXvOA2dHbu9gMs=; b=Vax3wBIZ8X+8tm0lKtqpFoSS8O191TnUgAd6FEGetmvNBBedBRkNVgDj n7X4gttgY8tBc+R/BO1W83v9Wk4yIaAI626cAIprsxWDE3i8bufc5lhWE kqhVfaTQ/6wRpj7TVJsILmv2ZdCJe8rnu5v0Z96hKf49bPVKkA6uYGdux E=; X-IronPort-AV: E=Sophos;i="5.48,409,1517875200"; d="scan'208";a="93770212" Received: from alln-core-10.cisco.com ([173.36.13.132]) by alln-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2018 23:56:37 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-10.cisco.com (8.14.5/8.14.5) with ESMTP id w34Nub9C017426; Wed, 4 Apr 2018 23:56:37 GMT Received: by cisco.com (Postfix, from userid 392789) id 14E0020F2001; Wed, 4 Apr 2018 16:56:37 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, John Daley , stable@dpdk.org Date: Wed, 4 Apr 2018 16:54:53 -0700 Message-Id: <20180404235455.17241-4-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180404235455.17241-1-johndale@cisco.com> References: <20180404235455.17241-1-johndale@cisco.com> Subject: [dpdk-dev] [PATCH] net/enic: fix seg fault on MTU update with non-setup queues 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" The enic code called from rte_eth_dev_set_mtu() was assuming that the Rx queues are already set up via a call to rte_eth_tx_queue_setup(). OVS calls rte_eth_dev_set_mtu() before rte_eth_rx_queue_setup() and a null pointer was dereferenced. Fixes: c3e09182bcd6 ("net/enic: support scatter Rx in MTU update") Cc: stable@dpdk.org Signed-off-by: John Daley Reviewed-by: Hyong Youb Kim --- drivers/net/enic/enic_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index f01a77c0a..f39dfbe32 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1444,6 +1444,8 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu) /* free and reallocate RQs with the new MTU */ for (rq_idx = 0; rq_idx < enic->rq_count; rq_idx++) { rq = &enic->rq[enic_rte_rq_idx_to_sop_idx(rq_idx)]; + if (!rq->in_use) + continue; enic_free_rq(rq); rc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp,