Skip to content

Commit a249f80

Browse files
logostdavem330
authored andcommitted
net: macsec: allow multiple macsec devices with offload
Offload engine can setup several SecY. Each macsec interface shall have its own mac address. It will filter a traffic by dest mac address. 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>
1 parent 182879f commit a249f80

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

‎drivers/net/macsec.c‎

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,11 +2553,10 @@ static int macsec_upd_offload(struct sk_buff *skb, struct genl_info *info)
25532553
enum macsec_offload offload, prev_offload;
25542554
int (*func)(struct macsec_context *ctx);
25552555
struct nlattr **attrs = info->attrs;
2556-
struct net_device *dev, *loop_dev;
2556+
struct net_device *dev;
25572557
const struct macsec_ops *ops;
25582558
struct macsec_context ctx;
25592559
struct macsec_dev *macsec;
2560-
struct net *loop_net;
25612560
int ret;
25622561

25632562
if (!attrs[MACSEC_ATTR_IFINDEX])
@@ -2585,28 +2584,6 @@ static int macsec_upd_offload(struct sk_buff *skb, struct genl_info *info)
25852584
!macsec_check_offload(offload, macsec))
25862585
return -EOPNOTSUPP;
25872586

2588-
if (offload == MACSEC_OFFLOAD_OFF)
2589-
goto skip_limitation;
2590-
2591-
/* Check the physical interface isn't offloading another interface
2592-
* first.
2593-
*/
2594-
for_each_net(loop_net) {
2595-
for_each_netdev(loop_net, loop_dev) {
2596-
struct macsec_dev *priv;
2597-
2598-
if (!netif_is_macsec(loop_dev))
2599-
continue;
2600-
2601-
priv = macsec_priv(loop_dev);
2602-
2603-
if (priv->real_dev == macsec->real_dev &&
2604-
priv->offload != MACSEC_OFFLOAD_OFF)
2605-
return -EBUSY;
2606-
}
2607-
}
2608-
2609-
skip_limitation:
26102587
/* Check if the net device is busy. */
26112588
if (netif_running(dev))
26122589
return -EBUSY;

0 commit comments

Comments
 (0)