macsec: Use helper macsec_netdev_priv for offload drivers
authorSubbaraya Sundeep <sbhatta@marvell.com>
Wed, 10 May 2023 08:28:09 +0000 (13:58 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 May 2023 10:32:09 +0000 (11:32 +0100)
commitbd9424efc4825ecfc84cd81be777df71ba4404d1
tree4a32bac31f5c2368eb6c2b15612833855d020510
parent2f0f556713f08515f3017fd35309b1f00fbc8932
macsec: Use helper macsec_netdev_priv for offload drivers

Now macsec on top of vlan can be offloaded to macsec offloading
devices so that VLAN tag is sent in clear text on wire i.e,
packet structure is DMAC|SMAC|VLAN|SECTAG. Offloading devices can
simply enable NETIF_F_HW_MACSEC feature in netdev->vlan_features for
this to work. But the logic in offloading drivers to retrieve the
private structure from netdev needs to be changed to check whether
the netdev received is real device or a vlan device and get private
structure accordingly. This patch changes the offloading drivers to
use helper macsec_netdev_priv instead of netdev_priv.

Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_macsec.c
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
include/net/macsec.h