developer | 7e32f7e | 2022-05-18 21:10:08 +0800 | [diff] [blame] | 1 | From a249f8050624f92f844605274de3367e2c8ac706 Mon Sep 17 00:00:00 2001 |
| 2 | From: Dmitry Bogdanov <dbogdanov@marvell.com> |
| 3 | Date: Wed, 25 Mar 2020 15:52:35 +0300 |
| 4 | Subject: net: macsec: allow multiple macsec devices with offload |
| 5 | |
| 6 | Offload engine can setup several SecY. Each macsec interface shall have |
| 7 | its own mac address. It will filter a traffic by dest mac address. |
| 8 | |
| 9 | Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com> |
| 10 | Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com> |
| 11 | Signed-off-by: Igor Russkikh <irusskikh@marvell.com> |
| 12 | Signed-off-by: David S. Miller <davem@davemloft.net> |
| 13 | --- |
| 14 | drivers/net/macsec.c | 25 +------------------------ |
| 15 | 1 file changed, 1 insertion(+), 24 deletions(-) |
| 16 | |
| 17 | diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c |
| 18 | index 093e81d605ec7..146a7881a20ac 100644 |
| 19 | --- a/drivers/net/macsec.c |
| 20 | +++ b/drivers/net/macsec.c |
| 21 | @@ -2553,11 +2553,10 @@ static int macsec_upd_offload(struct sk_buff *skb, struct genl_info *info) |
| 22 | enum macsec_offload offload, prev_offload; |
| 23 | int (*func)(struct macsec_context *ctx); |
| 24 | struct nlattr **attrs = info->attrs; |
| 25 | - struct net_device *dev, *loop_dev; |
| 26 | + struct net_device *dev; |
| 27 | const struct macsec_ops *ops; |
| 28 | struct macsec_context ctx; |
| 29 | struct macsec_dev *macsec; |
| 30 | - struct net *loop_net; |
| 31 | int ret; |
| 32 | |
| 33 | if (!attrs[MACSEC_ATTR_IFINDEX]) |
| 34 | @@ -2585,28 +2584,6 @@ static int macsec_upd_offload(struct sk_buff *skb, struct genl_info *info) |
| 35 | !macsec_check_offload(offload, macsec)) |
| 36 | return -EOPNOTSUPP; |
| 37 | |
| 38 | - if (offload == MACSEC_OFFLOAD_OFF) |
| 39 | - goto skip_limitation; |
| 40 | - |
| 41 | - /* Check the physical interface isn't offloading another interface |
| 42 | - * first. |
| 43 | - */ |
| 44 | - for_each_net(loop_net) { |
| 45 | - for_each_netdev(loop_net, loop_dev) { |
| 46 | - struct macsec_dev *priv; |
| 47 | - |
| 48 | - if (!netif_is_macsec(loop_dev)) |
| 49 | - continue; |
| 50 | - |
| 51 | - priv = macsec_priv(loop_dev); |
| 52 | - |
| 53 | - if (priv->real_dev == macsec->real_dev && |
| 54 | - priv->offload != MACSEC_OFFLOAD_OFF) |
| 55 | - return -EBUSY; |
| 56 | - } |
| 57 | - } |
| 58 | - |
| 59 | -skip_limitation: |
| 60 | /* Check if the net device is busy. */ |
| 61 | if (netif_running(dev)) |
| 62 | return -EBUSY; |
| 63 | -- |
| 64 | cgit 1.2.3-1.el7 |
| 65 | |