[LiSA-Devel] Clear mac address from interface

Ionut Nicu ionut.nicu at mindbit.ro
Tue May 28 14:54:07 EEST 2013


Hi Andreea,

On Tue, 2013-05-28 at 14:40 +0300, Andreea-Cristina Hodea wrote:
> Hi Ionut,
> 
> On Tue, May 21, 2013 at 4:17 PM, Ionut Nicu <ionut.nicu at mindbit.ro> wrote:
> > Hi Andreea,
> >
> > On Tue, 2013-05-21 at 15:53 +0300, Andreea-Cristina Hodea wrote:
> >> Hi,
> >>
> >> The SWCFG_CLEARMACINT command is called only from swctl and not from
> >> swcli. Taking a look at lisa kernel module, CLEARMACINT implementation
> >> is duplicated in DELMACDYN, the latter being more complex. Does it
> >> make sense to get rid of CLEARMACINT?
> >>
> >
> > Thank you for spotting this. Yes, it makes perfect sense to remove the
> > CLEARMACINT ioctl because its functionality can be achieved by using the
> > DELMACDYN ioctl.
> >
> 
> Sorry, I made a confusion regarding CLEARMACINT. Reading the
> description from include/linux/net_switch.h I understand that
> CLEARMACINT should cleanup SW_FDB_MAC_ANY and not SW_FDB_MAC_DYNAMIC
> as it does now in net/switch/sw_ioctl.c.
> 
> If the observation above is correct, there are more ways to solve it.
> A possible solution would be to adapt fdb_cleanup_port implementation
> so that it removes all entries if entry_type is SW_FDB_MAC_ANY and
> call fdb_cleanup_port(, SW_FDB_MAC_ANY) in CLEARMACINT implementation.
> 
> 
> To sum up, DELMACDYN removes dynamic macs of a port/vlan whereas
> CLEARMACINT is supposed to remove all macs for a port, so it would
> somehow make sense to keep both of them. Is this correct?

Clearly the comment in include/linux/net_switch.h is wrong. CLEARMACINT
deletes only dynamic mac addresses:

        case SWCFG_CLEARMACINT:
                PORT_GET;
                fdb_cleanup_port(port, SW_FDB_MAC_DYNAMIC);
                err = 0;
                break;


Instead of keeping this ioctl and changing it to clear both
static/dynamic entries in the fdb, why not remove it like we've
discussed and unify SWCFG_DELMACSTATIC with SWCFG_DELMACDYN (for example
into a ioctl called SWCFG_DELMAC) so that we'll have just one ioctl to
clear either dynamic, static or both types of fdb entries based on a new
parameter?

Please let me know what you think.

Ionut.



More information about the LiSA-Devel mailing list