From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4DA2EA00C5; Thu, 28 Jul 2022 18:32:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E118940151; Thu, 28 Jul 2022 18:32:40 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 3EC744014F for ; Thu, 28 Jul 2022 18:32:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659025958; x=1690561958; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=uADXenJ6zJciTvjuf/xVETxS8KXUznDeIAdvFqHYixA=; b=CNw+kI6ewTBoQBQV23nRCYnXqe/hRWL1Thq1CoLvE4t6HYl1+XRoZ0bb Es3+ibjZDquppcGtwtwdVxILj7YbhnA8VsBakvWs0owlYSOJag+Y0eC6v dwJWO/fXj2wnNBgG84qdqX8Sz/Thk1OBGi8/6HdbfHRnw/EvA9qEGlk9J UD1ldy0mSH/Jw02u6tGnvHSp+QienFivdphZFivzpu/nefmhRhDA1uNJy drVWT8hNnjfPrmixgDgKnLk3218I9ZVWBmM9kIRsKNLgCdHW6amhgu99b do3yfSTrq+dhPIhAMvw/2ZU54s1zAMdkT8nVwIZ85UkJ4W47mjp2vkC5M g==; X-IronPort-AV: E=McAfee;i="6400,9594,10422"; a="271597192" X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="271597192" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2022 09:32:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="600934054" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga002.jf.intel.com with ESMTP; 28 Jul 2022 09:32:36 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 28 Jul 2022 09:32:35 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Thu, 28 Jul 2022 09:32:35 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Thu, 28 Jul 2022 09:32:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GRKwIpEs73Dm+ByLGB08pjdxfSH1VQaLEbNdkwU4n5wuW/qps8DNKqKrpsZ7iKyzOgxZPlecJrZPZIttlu/F+4ZwRjuSnjM/SItSFWjdOZUHtoLrrHiEzSFYDjDoEMv3RYZS0SC6OCXJE1luiqyy/Wp3UVrbVxo81u9ABBbQiOmUG4Lwmo8E+tIkayFFPT9N3PN0E1sFbhc2fXOiD7/JQwSjnhHnW8EqON+8aJFld9PK7+V4PRUjSDKgkiXHp7q1G+QbNck9Wk9mQw/nXiB85QheGAeH4n+c5TLFdJ5GqFOYCo9RPsmbZkDRVqKzPmqWrH7hlq3/HcPJbvOYnw+f+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AntBqZSyimYdrEpH3MHP37GGdnabttWFGepBWWRLgeg=; b=f7z87bhSN5E8pwsmDefJ0emrYBNhvihzLs8svadEO/zeVCZux0Y4E/hXvuJUJFvEwD8Wd+FjSnzrguyFB7tjwZXVrJtuuwJ4DyPR9HRTvRmQCuAmQNeTtiReWXWJwyCMX/36owLHKA0ID7J+w/kf6C5IujyS8nvBb8oy0LvPKVfFwpCM1/UI5qKtE794xXDuiqYM9rqg4oUHF/J8mxQFCAwTI831PbTD+kKWqXdCrz8e9BW8XhKzlArS2gMwyT6BcYIxSpNOUh8ttK/EeSwnbV4dE94JM2DRkDtKfYmR1DwiKDICTwudTFMxfLQ0v7d8gDp3j3c9tyuFV9NX7psAbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by PH0PR11MB4949.namprd11.prod.outlook.com (2603:10b6:510:31::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.6; Thu, 28 Jul 2022 16:32:32 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::8e4:e1e9:a851:4b0d]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::8e4:e1e9:a851:4b0d%5]) with mapi id 15.20.5458.024; Thu, 28 Jul 2022 16:32:32 +0000 Date: Thu, 28 Jul 2022 17:32:26 +0100 From: Bruce Richardson To: David Marchand CC: Subject: Re: [RFC v3 06/26] examples/ethtool: prefer device name Message-ID: References: <20220628144643.1213026-1-david.marchand@redhat.com> <20220728152640.547725-1-david.marchand@redhat.com> <20220728152640.547725-7-david.marchand@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220728152640.547725-7-david.marchand@redhat.com> X-ClientProxiedBy: LNXP265CA0094.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:76::34) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d51d7989-e249-4aa4-57fa-08da70b6c536 X-MS-TrafficTypeDiagnostic: PH0PR11MB4949:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V+wfWwoNVPD+eyaTouxCPk4hymwWgZlcEQckcDABCTmH3nrtS1Nssg2K33fb27gD8eaZvfOGSlJYNuKVV/OOfLtjugq30ofnTzkvZu/FUTPFSHI2KmbornGfZqMvq+PWkb8qYTD2Xqw1ILUVFJmHo2iIOF2STRwjAnNUZNiuxOP4VifEv3+HYXph6TvoEanNKc7Y7wDTVE/B8Ui+r3DaV1gGPZppDuHtoNxH1MxHKPVOJfVApewYawDhJggfWVUcfAWtZKanWVezAgDpzLKZAKPZb5bbVYd2yG0xP/NDJTVFqWgWMiPh7xKMLj86+XrJJNSuDFW8EegNEU+z1fn1PSnr8eippVJadYQmDkjlc4pk36w53RzfKoFTQhzRatc8z7A4zaNmPIo5qE1Lj6Wd1fT3If2I4eUfy3N9NnVpX6FaxpuzY3MBX2UoNCDkU9MD0vjYl7uu3ajeDP/X0QmmLGjLceKd9Q5bJsfXs6hQ+11mPtYvXWwKmqBmze5ZiFGancVA2i9ZZmxDekwhTc8V/Ho8GTXB3/3ftwoSsqK5XRFy290yKbwbaMRWfFV0m45ACfKaZdZrhkJ06KXmVBt81PYnlN9zQq4rTTriu1NtDYDx80cm8rBGXEOCGgmK3Yjqf/myOCKSRCXOVHwWPD2UKiN452jgS+HFYuPZCdd8dnfa0C4zV4u80+QAwKWWi+wp8KqH9kb56e15nq9WJZprUIUxV+oy0jTbZYX0qv3Jwat4zWXNoUp+Ef03HW+BU8qA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(396003)(376002)(366004)(346002)(136003)(316002)(6916009)(6512007)(6666004)(478600001)(41300700001)(4326008)(6486002)(26005)(66556008)(86362001)(66946007)(8676002)(66476007)(6506007)(8936002)(5660300002)(2906002)(83380400001)(44832011)(38100700002)(82960400001)(186003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?g6JR0zMHIRzgBDDtpjDBYjhGOcjlHnXnsW4v/O5R3Ptex4HTnMaTxAs8nNbe?= =?us-ascii?Q?YnIJnPlbWkWDva0unpEoonGvzS+uNvobkQGuGR4vFvb2iL4QFlk9Kvbfo4Ng?= =?us-ascii?Q?rqdSFBhMWEHm0SFWQbauaE2DEn6DbZMFgM81eUzUZAa8irssZjey1sSS9957?= =?us-ascii?Q?/ynC8uzTcT0oEO/nCoFLdIlewlYUXacuN2mbZyQ/y3nNigkAsHjwG9EUHkk9?= =?us-ascii?Q?aqZ9I/dSMythF6wz7Tnk6M0TmdbqQZ2kGMM1XFrxozlOmDx243EY8XZFk3wM?= =?us-ascii?Q?dnMIc8+XBjo4BmDBGnfXoUOwBQV0IyAzCUawzIGEQXcim8Io9x0vZIY2FUhz?= =?us-ascii?Q?SKpZFghg8vPKesx+XUIlqdZJxoIQYtEmqBClTpwE+v2gK33IejNO4Y5Ru0Md?= =?us-ascii?Q?C7ReFguR6kebWT/9v4Ma27Y45uGEjluvyRTJ4UJamS+fVzfiuUUWoavC6RQc?= =?us-ascii?Q?ZnHUdjVFZwMyzPJ7NRouprZu8YP0ieUJAksgRqMLTLqcO72vnYVpaYsL671U?= =?us-ascii?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Kb+R?= =?us-ascii?Q?Fw7aJcM3JkZFMq86n8ehO5sRqgXbaa6hTaNQCfOsWcblab5iDupsuUGqKQyX?= =?us-ascii?Q?F/+VKDHlli/gPAz0qV2yRssojkG6uBoLqTZM01EzZlOLfeZw2t8AVD4NWUc1?= =?us-ascii?Q?tkxJXCGpMtUCUPOJankZModzKIDtJ4SWAFmkofmW72DOB1tbWbCXunO6tRll?= =?us-ascii?Q?Gw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: d51d7989-e249-4aa4-57fa-08da70b6c536 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2022 16:32:32.3878 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Wzxq+Oyzd8wZ0AMAi8Wd7MRYpPe45zef80ytaUTLPPC3OQeW29V1LOvCkzzB5iKqfUX671QIy+WFpW0DY9whHi38MSA6MwgP+xblSKQT1k0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4949 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Jul 28, 2022 at 05:26:20PM +0200, David Marchand wrote: > Rely on the generic device name rather than restrict to only supporting > PCI devices. > > Signed-off-by: David Marchand > --- > examples/ethtool/lib/rte_ethtool.c | 17 ++--------------- > 1 file changed, 2 insertions(+), 15 deletions(-) > > diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c > index ffaad96498..88dc917b73 100644 > --- a/examples/ethtool/lib/rte_ethtool.c > +++ b/examples/ethtool/lib/rte_ethtool.c > @@ -8,7 +8,6 @@ > #include > #include > #include > -#include > #ifdef RTE_NET_IXGBE > #include > #endif > @@ -23,8 +22,6 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) > { > struct rte_eth_dev_info dev_info; > struct rte_dev_reg_info reg_info; > - const struct rte_pci_device *pci_dev; > - const struct rte_bus *bus = NULL; > int n; > int ret; > > @@ -52,18 +49,8 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) > strlcpy(drvinfo->driver, dev_info.driver_name, > sizeof(drvinfo->driver)); > strlcpy(drvinfo->version, rte_version(), sizeof(drvinfo->version)); > - /* TODO: replace bus_info by rte_devargs.name */ > - if (dev_info.device) > - bus = rte_bus_find_by_device(dev_info.device); > - if (bus && !strcmp(bus->name, "pci")) { > - pci_dev = RTE_DEV_TO_PCI(dev_info.device); > - snprintf(drvinfo->bus_info, sizeof(drvinfo->bus_info), > - "%04x:%02x:%02x.%x", > - pci_dev->addr.domain, pci_dev->addr.bus, > - pci_dev->addr.devid, pci_dev->addr.function); > - } else { > - snprintf(drvinfo->bus_info, sizeof(drvinfo->bus_info), "N/A"); > - } > + strlcpy(drvinfo->bus_info, dev_info.device->name, > + sizeof(drvinfo->bus_info)); > Does the bus_info field need to be renamed now? It seems strange coping a device name to a bus info field.