mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
netdevsim: add dummy macsec offload
When the kernel is compiled with MACsec support, add the NETIF_F_HW_MACSEC feature to netdevsim devices and implement macsec_ops. To allow easy testing of failure from the device, support is limited to 3 SecY's per netdevsim device, and 1 RXSC per SecY. v2: - nsim_macsec_add_secy, return -ENOSPC if secy_count isn't full but we can't find an empty slot (Simon Horman) - add sci_to_cpu to make sparse happy (Simon Horman) - remove set but not used secy variable (kernel test robot and Simon Horman) Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
633d76ad01
commit
02b34d03a2
@@ -304,6 +304,7 @@ static int nsim_init_netdevsim(struct netdevsim *ns)
|
||||
if (err)
|
||||
goto err_utn_destroy;
|
||||
|
||||
nsim_macsec_init(ns);
|
||||
nsim_ipsec_init(ns);
|
||||
|
||||
err = register_netdevice(ns->netdev);
|
||||
@@ -314,6 +315,7 @@ static int nsim_init_netdevsim(struct netdevsim *ns)
|
||||
|
||||
err_ipsec_teardown:
|
||||
nsim_ipsec_teardown(ns);
|
||||
nsim_macsec_teardown(ns);
|
||||
nsim_bpf_uninit(ns);
|
||||
err_utn_destroy:
|
||||
rtnl_unlock();
|
||||
@@ -374,6 +376,7 @@ void nsim_destroy(struct netdevsim *ns)
|
||||
rtnl_lock();
|
||||
unregister_netdevice(dev);
|
||||
if (nsim_dev_port_is_pf(ns->nsim_dev_port)) {
|
||||
nsim_macsec_teardown(ns);
|
||||
nsim_ipsec_teardown(ns);
|
||||
nsim_bpf_uninit(ns);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user