DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Aman Singh <aman.deep.singh@intel.com>, <dev@dpdk.org>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [dpdk-dev] [PATCH v4 2/2] net: added macro to extract MAC address bytes
Date: Wed, 18 Aug 2021 09:47:53 -0700	[thread overview]
Message-ID: <20210818094753.375fe50a@hermes.local> (raw)
In-Reply-To: <4d013531-152c-d282-25ea-78786d314f47@intel.com>

On Wed, 18 Aug 2021 09:23:09 +0100
Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 8/17/2021 6:00 PM, Stephen Hemminger wrote:
> > On Tue, 17 Aug 2021 17:44:51 +0100
> > Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >   
> >> On 8/17/2021 4:25 PM, Stephen Hemminger wrote:  
> >>> On Tue, 17 Aug 2021 09:11:17 +0100
> >>> Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >>>     
> >>>> On 8/17/2021 12:03 AM, Stephen Hemminger wrote:    
> >>>>> On Mon, 16 Aug 2021 15:27:28 +0530
> >>>>> Aman Singh <aman.deep.singh@intel.com> 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 <aman.deep.singh@intel.com>
> >>>>>> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >>>>>> ---
> >>>>>> 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()').
> 

Ok, case should not matter

      reply	other threads:[~2021-08-18 16:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16  9:57 [dpdk-dev] [PATCH v4 0/2] Use macro to print MAC address Aman Singh
2021-08-16  9:57 ` [dpdk-dev] [PATCH v4 1/2] net: added macro for MAC address print Aman Singh
2021-08-16  9:57 ` [dpdk-dev] [PATCH v4 2/2] net: added macro to extract MAC address bytes Aman Singh
2021-08-16 23:03   ` Stephen Hemminger
2021-08-17  8:11     ` Ferruh Yigit
2021-08-17 15:25       ` Stephen Hemminger
2021-08-17 16:44         ` Ferruh Yigit
2021-08-17 17:00           ` Stephen Hemminger
2021-08-18  8:23             ` Ferruh Yigit
2021-08-18 16:47               ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210818094753.375fe50a@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).