[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170307183709.GA9094@yuval-lap>
Date: Tue, 7 Mar 2017 20:37:10 +0200
From: Yuval Shaia <yuval.shaia@...cle.com>
To: Leon Romanovsky <leon@...nel.org>
Cc: benve@...co.com, dgoodell@...co.com, dledford@...hat.com,
sean.hefty@...el.com, hal.rosenstock@...il.com, monis@...lanox.com,
davem@...emloft.net, linux-rdma@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH v2] {net,IB}/{rxe,usnic}: Utilize generic mac to eui32
function
On Tue, Mar 07, 2017 at 04:27:11PM +0200, Leon Romanovsky wrote:
> On Mon, Mar 06, 2017 at 08:54:06PM +0200, Yuval Shaia wrote:
> > This logic seems to be duplicated in (at least) three separate files.
> > Move it to one place so code can be re-use.
> >
> > Signed-off-by: Yuval Shaia <yuval.shaia@...cle.com>
> > ---
> > v0 -> v1:
> > * Add missing #include
> > * Rename to genaddrconf_ifid_eui48
> > v1 -> v2:
> > * Reset eui[0] to default if dev_id is used
> > ---
> > drivers/infiniband/hw/usnic/usnic_common_util.h | 11 +++--------
> > drivers/infiniband/sw/rxe/rxe_net.c | 11 ++---------
> > include/net/addrconf.h | 19 +++++++++++++------
> > 3 files changed, 18 insertions(+), 23 deletions(-)
> >
> > * scope according to RFC2373.
> > */
> > if (dev->dev_id) {
> > + eui[0] = dev->dev_addr[0];
> > eui[3] = (dev->dev_id >> 8) & 0xFF;
> > eui[4] = dev->dev_id & 0xFF;
> > - } else {
> > - eui[3] = 0xFF;
> > - eui[4] = 0xFE;
> > - eui[0] ^= 2;
> > }
> > +
> > return 0;
> > }
>
> Technically, the code is correct now, but it doesn't look right
> to set the value and restore it right after that.
Agree.
I will soon send v3 that offers an alternative by adding new helper
function so this re-assignment can be avoid.
>
> Thanks
>
> >
> > --
> > 2.7.4
> >
Powered by blists - more mailing lists