Skip to content

Commit a0680e7

Browse files
author
Sabrina Dubroca
committed
macsec: inherit lower device's TSO limits when offloading
JIRA: https://issues.redhat.com/browse/RHEL-26055 commit de187a3 Author: Sabrina Dubroca <sd@queasysnail.net> Date: Thu Nov 7 00:13:31 2024 +0100 macsec: inherit lower device's TSO limits when offloading If macsec is offloaded, we need to follow the lower device's capabilities, like VLAN devices do. Leave the limits unchanged when the offload is disabled. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/8240c0181e851f169d815f59658a01fb9dfc5073.1730929545.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sabrina Dubroca <sdubroca@redhat.com>
1 parent 4efd001 commit a0680e7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

drivers/net/macsec.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,6 +2621,17 @@ static void macsec_set_head_tail_room(struct net_device *dev)
26212621
dev->needed_tailroom = real_dev->needed_tailroom + needed_tailroom;
26222622
}
26232623

2624+
static void macsec_inherit_tso_max(struct net_device *dev)
2625+
{
2626+
struct macsec_dev *macsec = macsec_priv(dev);
2627+
2628+
/* if macsec is offloaded, we need to follow the lower
2629+
* device's capabilities. otherwise, we can ignore them.
2630+
*/
2631+
if (macsec_is_offloaded(macsec))
2632+
netif_inherit_tso_max(dev, macsec->real_dev);
2633+
}
2634+
26242635
static int macsec_update_offload(struct net_device *dev, enum macsec_offload offload)
26252636
{
26262637
enum macsec_offload prev_offload;
@@ -2666,6 +2677,8 @@ static int macsec_update_offload(struct net_device *dev, enum macsec_offload off
26662677
macsec_set_head_tail_room(dev);
26672678
macsec->insert_tx_tag = macsec_needs_tx_tag(macsec, ops);
26682679

2680+
macsec_inherit_tso_max(dev);
2681+
26692682
netdev_update_features(dev);
26702683

26712684
return ret;
@@ -3537,6 +3550,8 @@ static int macsec_dev_init(struct net_device *dev)
35373550
if (err)
35383551
return err;
35393552

3553+
macsec_inherit_tso_max(dev);
3554+
35403555
dev->hw_features = real_dev->hw_features & MACSEC_OFFLOAD_FEATURES;
35413556
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
35423557

@@ -4479,6 +4494,13 @@ static int macsec_notify(struct notifier_block *this, unsigned long event,
44794494
if (dev->mtu > mtu)
44804495
dev_set_mtu(dev, mtu);
44814496
}
4497+
break;
4498+
case NETDEV_FEAT_CHANGE:
4499+
list_for_each_entry(m, &rxd->secys, secys) {
4500+
macsec_inherit_tso_max(m->secy.netdev);
4501+
netdev_update_features(m->secy.netdev);
4502+
}
4503+
break;
44824504
}
44834505

44844506
return NOTIFY_OK;

0 commit comments

Comments
 (0)