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 87233A0C46; Wed, 18 Aug 2021 10:23:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7069E4118E; Wed, 18 Aug 2021 10:23:19 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 6530440042 for ; Wed, 18 Aug 2021 10:23:17 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10079"; a="280017877" X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="280017877" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 01:23:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="505588253" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga001.jf.intel.com with ESMTP; 18 Aug 2021 01:23:16 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 18 Aug 2021 01:23:15 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 18 Aug 2021 01:23:15 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Wed, 18 Aug 2021 01:23:15 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Wed, 18 Aug 2021 01:23:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YB5iuzgMGR0uwVzR6LtZtD2MlJQhHsQs3kjvwTHiULPVvrE09rAWYGXA0LFWnZn3TjNMckcYQPxGlP7BOcXXl5q55mdH6OQO7pZ8wl6XITiAo+oBkCiZ7Cc5AIQ5tXDvQNeIELTf9opM1iie+oswIkFcpMzzWBGfjGS6gBFIqaM0Xyp+4vzpQAxi+pgcP3MvAfU8z3vb8COsZv1RsxedGps/axPkvmcvVwsUBiFVwTmPNcC4vMRdmZAbV+NGY2bML2fpxNVusQC/Zf6xWH677uiabSQTtdgRv8pfnoUKY+s5MoIEqgaVEI07jLR6kLqRbLgLB2SV8SUblpxtJmxisQ== 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-SenderADCheck; bh=spDUZeXlqExh1QfvzU+BGi7QlXDzHFP1kLV92xOONNU=; b=KkV7B0hlkBghAdIF5/vT/SC59ej36XF9/iqGsbbXsPnjzThsKWOEqumjPUv4r6R00gcoy7+ndOGsxMNRLjGhYcj043IbOlUD48AzaRzdjJkjFPKTbfFlrK3ACgmxwy59b8ToQUMvMU8ogcLofFsKGhVXaxLNl2mkR/nvawy705K5+oFowyLxA3Le/2xom/grSdFrhYano2mnetVJpU+PMzuxokTkMzpW2P5X+20NguKLycT5OKkB67WmCcTVc4KqPxIjrPytTwHGExiHICIJRAnNv2bBJZUoaCTq0GIR1cb26GBhUVGxDGD0/8VlKUbld0ryB9adyV/qjGgl2cVLwA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=spDUZeXlqExh1QfvzU+BGi7QlXDzHFP1kLV92xOONNU=; b=LWVQkHIQLN6PerYWz209OOBKabhLgIBM1P2Y6pizumIpeaM2w8qbXkOnM84yfElLIy53Jp23hyYLitgPQUEI1m8x/dvwAp//VaM3FQ+QC5HjarISIlTl1p2gLTVEGy1WqV0zUqdi4xYlz9HZ/S20siAUg8QWjvoBjU7SCWWxopc= Authentication-Results: oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5079.namprd11.prod.outlook.com (2603:10b6:510:3d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.17; Wed, 18 Aug 2021 08:23:14 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::2979:70ca:38a:dbaf]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::2979:70ca:38a:dbaf%7]) with mapi id 15.20.4415.024; Wed, 18 Aug 2021 08:23:14 +0000 To: Stephen Hemminger CC: Aman Singh , , Andrew Rybchenko References: <20210816095728.17193-1-aman.deep.singh@intel.com> <20210816095728.17193-3-aman.deep.singh@intel.com> <20210816160347.0a35723a@hermes.local> <8b0c151c-fc49-59f2-863c-233f419f4d40@intel.com> <20210817082543.21ae2483@hermes.local> <31c1c42e-317d-d10f-ebe0-8d5058c09f75@intel.com> <20210817100040.08518200@hermes.local> From: Ferruh Yigit X-User: ferruhy Message-ID: <4d013531-152c-d282-25ea-78786d314f47@intel.com> Date: Wed, 18 Aug 2021 09:23:09 +0100 In-Reply-To: <20210817100040.08518200@hermes.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SJ0PR05CA0110.namprd05.prod.outlook.com (2603:10b6:a03:334::25) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.206] (37.228.236.146) by SJ0PR05CA0110.namprd05.prod.outlook.com (2603:10b6:a03:334::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.12 via Frontend Transport; Wed, 18 Aug 2021 08:23:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73834c80-b9b7-43ec-ade0-08d962216c53 X-MS-TrafficTypeDiagnostic: PH0PR11MB5079: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iqty3OZ0wYAhNMBVMH/hYehGBX02/SeenOzK5BljbwApNAJzA8xDU0X0M9Zv0BcL4GSiH7PGG63i8Q6Fb7U4IQziEmGfGD8yuEAmnydc4p8SPsSc29ezUZjqf3P6Oi2kL0w/KxqN0XH3aui7AK0YhNs9kW63pxKMYvavdPGVZujY9WTKQk7xkLIWVsvqVP6GoqQ0WWfNNsjpzpskGerKHzU9unPG7OAjoCz93hXjHfxjo353E6a4ld1lxEJSZVPC74jyd8v1W0rrLNdy074NwlNkH+Ia95u6SA1dy/SLzkVVxXU79jlTieXhHc97o4c6AZlgEAvIclGyRXVJwVlrUSA3SWS+njn01v8b3+RaB4PsvLzg9tnfFpFWMeBpqfpUPi+NCn0KPg40oGLbNkpi8ekUb0BqeEf5oGDNUHdaodxAh2R+Dj4FC5sJv7Kl+uIv6DYIobaZJT5lwFIfVSPOEd+9BuzR5wvyPK9tYemlwZRAUsVLjW3zcL8xIVxyDNdUpQlgr8Ix6ebN8sd7OVUVUdT2RB0fY6VmqOL2ldKt6ZeadrJcAZi00J9pz2gOefULAFd6Hgs4f6+ZwKkrm5xGimULeHKiWfey7ahBBnosKP7q9QHKrgzEBM8S06+1tghCR2pqFRs4Z/RWrxtxvgnN5GcLkvSD9gzIjKTZ8NaqKQWnlQcdatvlcbgxOXrMkyAw+h68bhTkdLh7AGlcDYr1Lg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(346002)(376002)(396003)(136003)(366004)(2616005)(38100700002)(316002)(956004)(44832011)(31686004)(53546011)(2906002)(16576012)(54906003)(8936002)(26005)(186003)(8676002)(6666004)(36756003)(66556008)(4326008)(66946007)(66476007)(86362001)(6486002)(31696002)(83380400001)(6916009)(478600001)(5660300002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M1Nudi85Y2ZxenlMMEdYL1l0aHVNdlhXNS92eFNac28wUWZWcXgySFh0eEZC?= =?utf-8?B?RVhVT0IwdytrRllWNklWZ2U1cDhPOXlCYk5mdjI2S2hoVGtmSVUzSnNTSzB4?= =?utf-8?B?NkFFNEFVSXhBTHZCUkRCR3IzWFFHR29iVWFob0xtNlJNR3QzWVJDR2xmOGJU?= =?utf-8?B?Zk4yS1h5Y3NNalEzYXBkSmhZU2d3ZTFnQVkrWkcxNHdEYzJQOFdrSHlnT015?= =?utf-8?B?SUNlajgrNHczWXduaTN1WVd3TGpaekF4clpoQW1mYVBqM1hoKzlMT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dUZLcFJEL2dDOEJ3NG5ua1dwNUgwYjQr?= =?utf-8?B?ZGwxTHVQVThOcjBTT2xuYW1DV0x1VzlKWkxNZ1lXWEFVMVpIWVErck4yTjM2?= =?utf-8?B?NGM4MTBQOTVIT2hBVko0aElwM1I0Y256ejFxVkdXQlRzTzB5WmxpQU0yanBv?= =?utf-8?B?L1NOdXhRcWVVMzBvUzdLYzMxZ29WSTUrcFdUTHIvZ2FZcEtNNWx3YWgyUFlG?= =?utf-8?B?RWtlK09abS8rRG9ZazdQZ1lwUHljVHNIMDB4SStlSFBRdXBlb3BkQkJRaU5l?= =?utf-8?B?UEZ0Y3FSVnlTRml6eUV5VkhGcG1UakFCYnhyaTRsaUhWT2RNajZGRVcvVGFD?= =?utf-8?B?cFJoYVFpWG5aSC9QVXNWM0Q1RGFRWnRNVmVTVnR5Zm1FRG5vVHNmeUpvK2VG?= =?utf-8?B?Y0tDUjM0SHNKN2dzMURJV3NJVzZxSSt1aXVZSHdWcmYwenMweFM4TWc4S04v?= =?utf-8?B?NjI0Z29KaUYvRE5kallKUWRUWG52TDA2ZzVnTjJDcUowQjd2R1VpRml0cWpH?= =?utf-8?B?cGJiQnZ5NlBQNXQ2REdSQWE1M20xa29FbFprVWdKRzB2SEQ3RHJTckJFSlMz?= =?utf-8?Q?twItT1RYVXzd/LCfKXtmouexjImutcjM/XiY+u6?= X-MS-Exchange-CrossTenant-Network-Message-Id: 73834c80-b9b7-43ec-ade0-08d962216c53 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2021 08:23:14.1861 (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: V9tjxYWZlNNxa2Z1/GK5rkGFVK73Q4pD4I5gg3NDg3Vw9fS8VPXdxwH0/pobf4sL6ohdqQ1NJ+v7EAwy2Q5WzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5079 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 2/2] net: added macro to extract MAC address bytes 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 Sender: "dev" On 8/17/2021 6:00 PM, Stephen Hemminger wrote: > On Tue, 17 Aug 2021 17:44:51 +0100 > Ferruh Yigit wrote: > >> On 8/17/2021 4:25 PM, Stephen Hemminger wrote: >>> On Tue, 17 Aug 2021 09:11:17 +0100 >>> Ferruh Yigit wrote: >>> >>>> On 8/17/2021 12:03 AM, Stephen Hemminger wrote: >>>>> On Mon, 16 Aug 2021 15:27:28 +0530 >>>>> Aman Singh wrote: >>>>> >>>>>> Added macros to simplify print of MAC address. >>>>>> The six bytes of a MAC address are extracted in >>>>>> a macro here, to improve code readablity. >>>>>> >>>>>> Signed-off-by: Aman Singh >>>>>> Reviewed-by: Ferruh Yigit >>>>>> --- >>>>>> The change in the document will be done in seperate patch. >>>>>> To ensure document has direct reference of the code as shown in >>>>>> commit 413c75c33c40 ("doc: show how to include code in guides"). >>>>> >>>>> NAK >>>>> The DPDK already has rte_ether_format_addr() >>>>> why does so much code not use it? >>>>> >>>> >>>> 'rte_ether_format_addr()' formats string to a buffer, but most of the times the >>>> need is just to log and having a buffer for it is unnecessary. >>>> >>>> Both macros look useful to me. >>> >>> Yes, but it would be good if same format was used everywhere. >>> >> >> Agree, and 'RTE_ETHER_ADDR_PRT_FMT' macro helps to unify the format without >> forcing to create the buffer. >> >> We can use 'RTE_ETHER_ADDR_PRT_FMT' in the 'rte_ether_format_addr()' to unify >> all output, the downside is it may change the output of the API, which may cause >> trouble for some customers. >> Other option is define 'RTE_ETHER_ADDR_PRT_FMT' as whatever >> 'rte_ether_format_addr()' has, to not cause a change in the API, what do you think? > > > Why change the format using spaces between parts is not standard. > The standard ways of printing ether addresses on Linux is 00:01:02:03:04:05 > (and on Windows 00-01-02-03-04-05). > It is not changing the format in a way to use spaces, macro is: #define RTE_ETHER_ADDR_PRT_FMT "%02x:%02x:%02x:%02x:%02x:%02x" API is 'rte_ether_format_addr()': "%02X:%02X:%02X:%02X:%02X:%02X" So only case changes (if we update 'rte_ether_format_addr()').