summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDmitry Bogdanov <dbogdanov@marvell.com>2020-03-10 18:22:25 +0300
committerDavid S. Miller <davem@davemloft.net>2020-03-10 15:59:32 -0700
commit09f4136c5d6b4c5144a965bd086009863d58ff08 (patch)
treeec0166ec2b046c45c7b7742e0e1141931e2d50b9 /drivers/net
parent6fc498bc82929ee23aa2f35a828c6178dfd3f823 (diff)
downloadlinux-09f4136c5d6b4c5144a965bd086009863d58ff08.tar.bz2
net: macsec: invoke mdo_upd_secy callback when mac address changed
Notify the offload engine about MAC address change to reconfigure it accordingly. Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure") Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com> Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/macsec.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 66c6392251bc..6ec6fc191a6e 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -3274,6 +3274,19 @@ static int macsec_set_mac_address(struct net_device *dev, void *p)
out:
ether_addr_copy(dev->dev_addr, addr->sa_data);
macsec->secy.sci = dev_to_sci(dev, MACSEC_PORT_ES);
+
+ /* If h/w offloading is available, propagate to the device */
+ if (macsec_is_offloaded(macsec)) {
+ const struct macsec_ops *ops;
+ struct macsec_context ctx;
+
+ ops = macsec_get_ops(macsec, &ctx);
+ if (ops) {
+ ctx.secy = &macsec->secy;
+ macsec_offload(ops->mdo_upd_secy, &ctx);
+ }
+ }
+
return 0;
}