From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id A536E1B4DB for ; Thu, 29 Nov 2018 15:52:28 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2018 06:52:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,295,1539673200"; d="scan'208";a="116502325" Received: from silpixa00381635.ir.intel.com (HELO silpixa00381635.ger.corp.intel.com) ([10.237.222.149]) by fmsmga004.fm.intel.com with ESMTP; 29 Nov 2018 06:52:26 -0800 From: Jasvinder Singh To: stable@dpdk.org Cc: ktraynor@redhat.com, ferruh.yigit@intel.com Date: Thu, 29 Nov 2018 14:52:26 +0000 Message-Id: <20181129145226.58362-1-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH 18.08] net/softnic: fix undefined dev info fields 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: Thu, 29 Nov 2018 14:52:29 -0000 The memcpy operation overwrites the device info fields set by ethdev API and leaves the device field undefined. Thus, replaces memcpy by only updating the required fields at the driver layer. error log: testpmd> show port info 1 **** Infos for port 1 **** MAC address: 00:00:00:00:00:00 Device name: net_softnic0 Segmentation fault. port_infos_display (port_id=1) at /dpdk/app/test-pmd/config.c:418 if (dev_info.device->devargs && dev_info.device->devargs->args) Fixes: cc6d421574fe ("net/softnic: add softnic PMD") Signed-off-by: Jasvinder Singh Reviewed-by: Ferruh Yigit --- drivers/net/softnic/rte_eth_softnic.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c index 3e47c2f98..45a2922b7 100644 --- a/drivers/net/softnic/rte_eth_softnic.c +++ b/drivers/net/softnic/rte_eth_softnic.c @@ -79,28 +79,13 @@ static const char *pmd_valid_args[] = { NULL }; -static const struct rte_eth_dev_info pmd_dev_info = { - .min_rx_bufsize = 0, - .max_rx_pktlen = UINT32_MAX, - .max_rx_queues = UINT16_MAX, - .max_tx_queues = UINT16_MAX, - .rx_desc_lim = { - .nb_max = UINT16_MAX, - .nb_min = 0, - .nb_align = 1, - }, - .tx_desc_lim = { - .nb_max = UINT16_MAX, - .nb_min = 0, - .nb_align = 1, - }, -}; - static void pmd_dev_infos_get(struct rte_eth_dev *dev __rte_unused, struct rte_eth_dev_info *dev_info) { - memcpy(dev_info, &pmd_dev_info, sizeof(*dev_info)); + dev_info->max_rx_pktlen = UINT32_MAX; + dev_info->max_rx_queues = UINT16_MAX; + dev_info->max_tx_queues = UINT16_MAX; } static int -- 2.17.1