Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Aug 2014 05:19:02 +0000
From:      "Pokala, Ravi" <rpokala@panasas.com>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, Brooks Davis <brooks@freebsd.org>
Subject:   Re: Common storage of original MAC address
Message-ID:  <D018246A.11C727%rpokala@panasas.com>
In-Reply-To: <CAFMmRNwDrEY-Z5VP%2B_03-ZGf_6Ye89jCKO-HpfqYAoZjATFAdQ@mail.gmail.com>
References:  <D0168955.11C3AD%rpokala@panasas.com> <20140818081223.GA6099@spindle.one-eyed-alien.net> <D0175C55.11C472%rpokala@panasas.com> <CAFMmRNwDrEY-Z5VP%2B_03-ZGf_6Ye89jCKO-HpfqYAoZjATFAdQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----Original Message-----
From: Ryan Stone <rysto32@gmail.com>
Date: Monday, August 18, 2014 at 11:14 AM
To: Ravi Pokala <rpokala@panasas.com>
Cc: Brooks Davis <brooks@freebsd.org>, "freebsd-hackers@freebsd.org"
<freebsd-hackers@freebsd.org>
Subject: Re: Common storage of original MAC address

>On Mon, Aug 18, 2014 at 11:59 AM, Pokala, Ravi <rpokala@panasas.com>
>wrote:
>
>>...
>
>Personally I think that it would be better to save it in binary format
>and convert it to a string as needed.

I'm fine with that too; the reason I suggested a string is because that's
what's already getting passed to ether_ifattach(). I suppose it's easy
enough to run the string through ether_aton() to get the binary version.

But again, not everything is Ethernet, so we might need to have different
binary representations; if we're doing that, we might as well just use the
string version, and let the caller decide how to parse the string. (I'm
specifically thinking about IP-over-Infiniband - while I'm sure IB cards
must have some type of hardware address, it's probably not the same format
as an Ethernet MAC address.)

>It would be useful to have the MAC address saved aside somewhere so that
>a "Restore MAC to HW default" ioctl could be implemented; this would be
>useful in the if_lagg driver to restore the MAC on a port after it has
>been removed from a lagg.

Or how about an ioctl to get the original MAC (rather than a sysctl). Then
the "restore to default" code would be a two-step process - get the
original MAC with the new ioctl (say "SIOCGHWLLADDR" for "Get Hardware
LLADDR"?), and then set the working MAC to that value w/ the existing
ioctl (SIOCSIFLLADDR).

I actually like this idea more than the sysctl, because it could be done
in one place (probably in net/if.c, next to if_setlladdr() (which is what
implements the guts of SIOCSIFLLADDR)).

Does that sound like a plan?

Thanks,

Ravi




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D018246A.11C727%rpokala>