From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 75ECB1B1BC for ; Wed, 24 Jan 2018 16:40:34 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 15A3C226C9; Wed, 24 Jan 2018 10:40:34 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:40:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=AVpc2GGxa4QChUgEw uVcD5iQA+dMl2WpIDjhWxRbncU=; b=Vg/zsakojiAof+5OG1Frq7NM64AjME1cD jd9juzQ/ktAB6ZPHln7sEa78C/KUej8VQZagIPKIvi4lqfU26AY743//yix6uv17 bssJQr08zWM2CW8EWGKMZVc3LqOkqbDFZfYlg9dnJSMtDAQKAwqqkI32Td22WR8g 6hnttSFh/V6Ea09ExV5cOBt5aqAgJZ0rOyMU3HV/jRnKtcq3JXy5QDKVJLmWyWub aiOS2IgrZV1Oi2P2u0F6RuVnoNFB3Qb208IkAul5TlDvB4ECNPGgzqxFbQa6AXEC Hoa0797Qzjb3MCnkp0CCoiv8i8DcHrdV1dWex/XlS6rMNXdsG/v6g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=AVpc2GGxa4QChUgEwuVcD5iQA+dMl2WpIDjhWxRbncU=; b=M6NMeph2 aDNI8Y4LjU7UDVjrY3QU9OV+CtcRoO1fAHvFPvQ3M8Qx0MzY++f/RI8ODhSx5NRS Jne952Ax+jqv11AriGO6tTp1PqEkT1crvDsGRMuHEkEOWXUpxmWKpS3PEVWNwkhd 0T9ufahoWZ714ftRF5/9MSPsT2mCSKWExMsuA1i1nmwO8/cG7Dd7H3UZPdOiZSFv B7RD3Aevr28A+LHnDLg/68SotZUKku0BkfISY5dtv6L+qVYTEcZYuQZ03CaL3tHP Sr377gu3MPS0h5KcOqEXnVAVxY7/ZKoiK3oGGUaouG3eNuxh+Mq5PbdGp16LttP/ DuN6Z594uHQvpg== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id F1C6E7E1A2; Wed, 24 Jan 2018 10:40:31 -0500 (EST) From: Yuanhan Liu To: Wei Zhao Cc: Qi Zhang , dpdk stable Date: Wed, 24 Jan 2018 23:32:53 +0800 Message-Id: <1516808026-25523-105-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/i40e: fix port segmentation fault when restart' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 15:40:34 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 79ac724895e5dd92747f3cda154979f909e16c61 Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Fri, 12 Jan 2018 14:59:19 +0800 Subject: [PATCH] net/i40e: fix port segmentation fault when restart [ upstream commit 37b68eacfc9901f9c30f2127c68ef806e2bd2a61 ] This patch will go into the process of clear all queue region related configuration when dev stop even if there is no queue region command before, so this is a bug, it may cause error. So add code to check if there is queue configuration exist when flush queue region config and remove this process when device stop. Queue region clear only do when device initialization or PMD get flush command. Fixes: 7cbecc2f7424 ("net/i40e: support queue region set and flush") Signed-off-by: Wei Zhao Acked-by: Qi Zhang --- drivers/net/i40e/i40e_ethdev.c | 3 --- drivers/net/i40e/rte_pmd_i40e.c | 27 ++++++++++++++------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 5f1faf1..bd83e7b 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2154,9 +2154,6 @@ i40e_dev_stop(struct rte_eth_dev *dev) /* reset hierarchy commit */ pf->tm_conf.committed = false; - /* Remove all the queue region configuration */ - i40e_flush_queue_region_all_conf(dev, hw, pf, 0); - hw->adapter_stopped = 1; } diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index aeb92af..c2e2466 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -2845,22 +2845,23 @@ i40e_flush_queue_region_all_conf(struct rte_eth_dev *dev, return 0; } - info->queue_region_number = 1; - info->region[0].queue_num = main_vsi->nb_used_qps; - info->region[0].queue_start_index = 0; + if (info->queue_region_number) { + info->queue_region_number = 1; + info->region[0].queue_num = main_vsi->nb_used_qps; + info->region[0].queue_start_index = 0; - ret = i40e_vsi_update_queue_region_mapping(hw, pf); - if (ret != I40E_SUCCESS) - PMD_DRV_LOG(INFO, "Failed to flush queue region mapping."); - - ret = i40e_dcb_init_configure(dev, TRUE); - if (ret != I40E_SUCCESS) { - PMD_DRV_LOG(INFO, "Failed to flush dcb."); - pf->flags &= ~I40E_FLAG_DCB; - } + ret = i40e_vsi_update_queue_region_mapping(hw, pf); + if (ret != I40E_SUCCESS) + PMD_DRV_LOG(INFO, "Failed to flush queue region mapping."); - i40e_init_queue_region_conf(dev); + ret = i40e_dcb_init_configure(dev, TRUE); + if (ret != I40E_SUCCESS) { + PMD_DRV_LOG(INFO, "Failed to flush dcb."); + pf->flags &= ~I40E_FLAG_DCB; + } + i40e_init_queue_region_conf(dev); + } return 0; } -- 2.7.4