linux-stable/drivers/net
Antoine Tenart 3cf3227a21 net: macsec: hardware offloading infrastructure
This patch introduces the MACsec hardware offloading infrastructure.

The main idea here is to re-use the logic and data structures of the
software MACsec implementation. This allows not to duplicate definitions
and structure storing the same kind of information. It also allows to
use a unified genlink interface for both MACsec implementations (so that
the same userspace tool, `ip macsec`, is used with the same arguments).
The MACsec offloading support cannot be disabled if an interface
supports it at the moment.

The MACsec configuration is passed to device drivers supporting it
through macsec_ops which are called from the MACsec genl helpers. Those
functions call the macsec ops of PHY and Ethernet drivers in two steps:
a preparation one, and a commit one. The first step is allowed to fail
and should be used to check if a provided configuration is compatible
with the features provided by a MACsec engine, while the second step is
not allowed to fail and should only be used to enable a given MACsec
configuration. Two extra calls are made: when a virtual MACsec interface
is created and when it is deleted, so that the hardware driver can stay
in sync.

The Rx and TX handlers are modified to take in account the special case
were the MACsec transformation happens in the hardware, whether in a PHY
or in a MAC, as the packets seen by the networking stack on both the
physical and MACsec virtual interface are exactly the same. This leads
to some limitations: the hardware and software implementations can't be
used on the same physical interface, as the policies would be impossible
to fulfill (such as strict validation of the frames). Also only a single
virtual MACsec interface can be offloaded to a physical port supporting
hardware offloading as it would be impossible to guess onto which
interface a given packet should go (for ingress traffic).

Another limitation as of now is that the counters and statistics are not
reported back from the hardware to the software MACsec implementation.
This isn't an issue when using offloaded MACsec transformations, but it
should be added in the future so that the MACsec state can be reported
to the user (which would also improve the debug).

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-14 11:31:41 -08:00
..
appletalk
arcnet
bonding bonding: rename AD_STATE_* to LACP_STATE_* 2019-12-26 13:09:37 -08:00
caif
can can: mscan: mscan_rx_poll(): fix rx path lockup when returning from polling to irq mode 2020-01-02 15:34:27 +01:00
dsa Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-01-09 12:13:43 -08:00
ethernet net: stmmac: selftests: Add a test for TBS feature 2020-01-13 18:31:49 -08:00
fddi
fjes Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 09:54:33 -08:00
ieee802154
ipvlan
netdevsim devlink: rename and expand devlink-trap-netdevsim.rst 2020-01-10 17:07:00 -08:00
phy mdio_bus: Simplify reset handling and extend to non-DT systems 2020-01-14 11:03:10 -08:00
plip
ppp ppp: Remove redundant BUG_ON() check in ppp_pernet 2019-12-27 16:30:52 -08:00
slip
team
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-01-09 12:13:43 -08:00
vmxnet3 vmxnet3: Remove always false conditional statement 2020-01-08 16:07:21 -08:00
wan wan: ixp4xx_hss: prepare compile testing 2020-01-12 12:59:52 -08:00
wimax
wireguard net: introduce skb_list_walk_safe for skb segment walking 2020-01-08 15:19:54 -08:00
wireless net: iwlwifi: use skb_list_walk_safe helper for gso segments 2020-01-08 15:19:55 -08:00
xen-netback xen-netback: support dynamic unbind/bind 2019-12-26 15:16:26 -08:00
dummy.c
eql.c
geneve.c
gtp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-01-09 12:13:43 -08:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: macsec: hardware offloading infrastructure 2020-01-14 11:31:41 -08:00
macvlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-01-09 12:13:43 -08:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: tap: use skb_list_walk_safe helper for gso segments 2020-01-08 15:19:55 -08:00
thunderbolt.c
tun.c
veth.c
virtio_net.c
vrf.c
vsockmon.c
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-01-09 12:13:43 -08:00
xen-netfront.c