From patchwork Sat Feb 4 20:33:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 93360 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1132570qgi; Sat, 4 Feb 2017 12:33:44 -0800 (PST) X-Received: by 10.200.53.145 with SMTP id k17mr3016276qtb.47.1486240424072; Sat, 04 Feb 2017 12:33:44 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id t76si21930968qki.337.2017.02.04.12.33.43; Sat, 04 Feb 2017 12:33:44 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0D87962D42; Sat, 4 Feb 2017 20:33:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 480C360BE8; Sat, 4 Feb 2017 20:33:39 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 5990262CB6; Sat, 4 Feb 2017 20:33:36 +0000 (UTC) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by lists.linaro.org (Postfix) with ESMTPS id 290B460BD9 for ; Sat, 4 Feb 2017 20:33:35 +0000 (UTC) Received: by mail-lf0-f45.google.com with SMTP id v186so26498579lfa.1 for ; Sat, 04 Feb 2017 12:33:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qrrIGnZINVC0IzTosjw3J0sRk4bl90NjXyZhe4cw9wQ=; b=PsbqtyRRrgz76y3koMBVQQ/2JociMoJQTq/p7pL5GXmfsBgtg4dgI9vvC71bIjIgCY SFmRNOeBiV/Y5kmCObde+Faw+yT8kDsPltQJCep2ePubb/oio5oqr4ns7qX4ObyUJTV+ Kn0/hmua/cgGNXFE1qgaCvqErF2nud9Fycu58bdBiJtIvdwiSA8SmvuvZOH+uKnaM3dQ DvZ8dMfdEudIB2YTrMuTmTHsPGmoGowub4G/IrqqtRB/sJd1bRWbHvYJi+SFbGXdu6eq GL5zkKjGPoMAC9YWPSqZxVdBzVVuQjfvjXmz8T67dB4ypNdIYDxZBd7yjJviYsqB30Xo p8fg== X-Gm-Message-State: AIkVDXJx4HGW2rlrpzP01vRSq21E51Dz5Wy4Q66HgkrmnD04aF4BEnoTZsswlT7XN8J+uub6ygg= X-Received: by 10.46.80.86 with SMTP id v22mr1291532ljd.6.1486240413942; Sat, 04 Feb 2017 12:33:33 -0800 (PST) Received: from localhost.localdomain (ppp109-252-7-40.pppoe.spdop.ru. [109.252.7.40]) by smtp.gmail.com with ESMTPSA id s10sm8944843lja.18.2017.02.04.12.33.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Feb 2017 12:33:33 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Sat, 4 Feb 2017 23:33:24 +0300 Message-Id: <20170204203324.7704-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce Cc: Elo Matias Subject: [lng-odp] [PATCH] linux-gen: fix dpdk pktio init X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" struct rte_eth_dev_info should be initialized before usage with strcmp(dev_info.driver_name, "rte_ixgbe_pmd"). Patch fixes segfault on that compare. CC: Elo Matias Signed-off-by: Maxim Uvarov --- platform/linux-generic/pktio/dpdk.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.11.0.295.gd7dffce diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 0eb025ae..9a9f7a4e 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -560,19 +560,19 @@ static int dpdk_output_queues_config(pktio_entry_t *pktio_entry, return 0; } -static void dpdk_init_capability(pktio_entry_t *pktio_entry) +static void dpdk_init_capability(pktio_entry_t *pktio_entry, + struct rte_eth_dev_info *dev_info) { pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk; odp_pktio_capability_t *capa = &pkt_dpdk->capa; - struct rte_eth_dev_info dev_info; - memset(&dev_info, 0, sizeof(struct rte_eth_dev_info)); + memset(dev_info, 0, sizeof(struct rte_eth_dev_info)); memset(capa, 0, sizeof(odp_pktio_capability_t)); - rte_eth_dev_info_get(pkt_dpdk->port_id, &dev_info); - capa->max_input_queues = RTE_MIN(dev_info.max_rx_queues, + rte_eth_dev_info_get(pkt_dpdk->port_id, dev_info); + capa->max_input_queues = RTE_MIN(dev_info->max_rx_queues, PKTIO_MAX_QUEUES); - capa->max_output_queues = RTE_MIN(dev_info.max_tx_queues, + capa->max_output_queues = RTE_MIN(dev_info->max_tx_queues, PKTIO_MAX_QUEUES); capa->set_op.op.promisc_mode = 1; @@ -631,7 +631,7 @@ static int dpdk_open(odp_pktio_t id ODP_UNUSED, return -1; } - dpdk_init_capability(pktio_entry); + dpdk_init_capability(pktio_entry, &dev_info); mtu = dpdk_mtu_get(pktio_entry); if (mtu == 0) {