From patchwork Wed Jun 13 16:27:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Mazarguil X-Patchwork-Id: 41073 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 DFB3C1EF35; Wed, 13 Jun 2018 18:28:01 +0200 (CEST) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 147781EF24 for ; Wed, 13 Jun 2018 18:28:00 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id w7-v6so3410648wrn.6 for ; Wed, 13 Jun 2018 09:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=bbIWGVmA7Okm8sQEO21yp/eAbr7FeTc3mWIMi+XhiDE=; b=d6yAkq7nBo66ZFMEQ3YFqK8HqYgF23SczZMbWadYNA+uE54jiUv/uPB4ybql54S9t5 sZrrYt/NsFAUKHs20dabOUfgXO22JCGkgY8YgjIORYx5u7PjIvreHxd3/tlGo/eYo0YX G+ypbI7mBVr9SlNzcgyPl8p86TuHF+C2PFuj/xVaN59429N7psxajorsV/PlsWmc/F9o xEExsal6ewTRxL7/g5GbUD8h9E+KxwkzIkw45ob6fimjE1/u5k0g5YV+iKSdW4GFqecP +zIqll32YF6ZOSSl6xShQbqmbM1UetkpFFqXTnP0QfyutiyJhSH4yEQ+gi5TjLiJbSfx QJ+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=bbIWGVmA7Okm8sQEO21yp/eAbr7FeTc3mWIMi+XhiDE=; b=UOT45MjVvdrxELh112JXtnZOBdcxEjLxpOAlLQyVX/8WPZmpEJ0EqG99hn4YN6veWJ r5FzcOK+fzNcuKZTFdxlq8/OYYIz3qUgouoK6Z36szEtrLkw38cslXntV7EIDmnIsnF9 ueNZacwsvYEE87BlrC27kfvKT//tRzOghd+6xaPVzrecQb9PCbdbWpcOPsfwS1bm6/fc xYJgesKIV47v4uLK0HBRZfylrORy019fnIzKmbsCssY8CR+arLhEJ0rDAK//3NerizZl EnBAbiGEkKcW2uS8lniaPiIqMZhOpPbi/LXAYXhFCfNXv9CjE6+j+02QEUwKxdOZF5PV 3qMA== X-Gm-Message-State: APt69E3pdVDXf5cPGUrZYrCk8LDJsomoEIQhtdjqL/tT4PxEYCvHgEUH pfvCy3ui758HmqqDWAgqJrzJyg== X-Google-Smtp-Source: ADUXVKLFIMZeIlrV1U+RC6JGG9VpT27sgu1dZgx/tnyLbwVijkXtZ1LnOp0SBTvAD6X8kNdgPS2XHQ== X-Received: by 2002:adf:a292:: with SMTP id s18-v6mr4624342wra.114.1528907279832; Wed, 13 Jun 2018 09:27:59 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id t17-v6sm4100789wrr.82.2018.06.13.09.27.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 09:27:59 -0700 (PDT) Date: Wed, 13 Jun 2018 18:27:43 +0200 From: Adrien Mazarguil To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Cc: dev@dpdk.org, stable@dpdk.org, Jasvinder Singh , "Xueming(steven) Li" Message-ID: <20180613162519.19205-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] app/testpmd: fix crash when attaching a device 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" Below commit checks global device information to determine if a port uses the softnic driver once initialized. Problem is that this information is not available at this point when a port is initialized interactively through a "port attach XXX" command, crashing testpmd. This patch systematically initializes global device information to address this issue. Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode") Cc: stable@dpdk.org Cc: Jasvinder Singh Signed-off-by: Adrien Mazarguil Acked-by: Bernard Iremonger --- app/test-pmd/testpmd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 35cf26674..24c199844 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2355,16 +2355,15 @@ init_port_config(void) { portid_t pid; struct rte_port *port; - struct rte_eth_dev_info dev_info; RTE_ETH_FOREACH_DEV(pid) { port = &ports[pid]; port->dev_conf.fdir_conf = fdir_conf; + rte_eth_dev_info_get(pid, &port->dev_info); if (nb_rxq > 1) { - rte_eth_dev_info_get(pid, &dev_info); port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; port->dev_conf.rx_adv_conf.rss_conf.rss_hf = - rss_hf & dev_info.flow_type_rss_offloads; + rss_hf & port->dev_info.flow_type_rss_offloads; } else { port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; port->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0;