Re: [PATCH net-next] net/hanic: Add the hanic network interface for high availability links

Andrew Lunn
2022-11-22T00:41:03Z

> +Output R-TAG filter
> +===================
> +
> +In a realistic system, some destinations do not support 802.1cb,
> +or don't need it. The hanic driver has a means to call out these
> +destinations by vlan or by mac and vlan together. For example, if
> +all the destinations on vlan=11 (0x000b) should not receive r-TAG'ed
> +packets, then that can be arranged like so::
> +
> + $ echo 000b: prime > /sys/class/net/\<nic\>/hanic/filters_vlan

Please use netlink for all configuration, not sysfs.

> +Creating interfaces
> +===================
> +
> +The way to create interfaces is with a command like this::
> +
> + $ echo +hanic0 > /sys/class/net/hanic_interfaces

ip link add hanic0 type hanic

> +
> +It is also possible to destroy interfaces thusly::
> +
> + $ echo -hanic0 > /sys/class/net/hanic_interfaces

ip link del handic0

> +The standard IP commands can be used to do the enlistment, like so::
> +
> + $ ip link set sandlan0a master hanic0
> + $ ip link set sandlan0b master hanic0

It is not clear if sandland is going to get merged, so you probably
should just use eth0 and eth1 in the examples.

> +* /sys/class/net/\<nic\>/hanic/test_drop_packet_in
> +
> +Inject faults by dropping input packets from some port. Write to this
> +file the port number and the number of packets to drop. For example,
> +to tell port 1 to drop the next 5 input packets::

The normal way to do this is TC. Please don't reinvent what the kernel
already has.

Probably nobody will look at the code in too much detail until your
get your uAPI accepted. uAPI is nearly impossible to change once it is
merged, so it is important to get correct. So please throw away all
your sysfs code and replace it with netlink.

Andrew