hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/bonding/bond_main.c
....@@ -1442,6 +1442,11 @@
14421442
14431443 memcpy(bond_dev->broadcast, slave_dev->broadcast,
14441444 slave_dev->addr_len);
1445
+
1446
+ if (slave_dev->flags & IFF_POINTOPOINT) {
1447
+ bond_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST);
1448
+ bond_dev->flags |= (IFF_POINTOPOINT | IFF_NOARP);
1449
+ }
14451450 }
14461451
14471452 /* On bonding slaves other than the currently active slave, suppress
....@@ -2393,12 +2398,21 @@
23932398 /* called with rcu_read_lock() */
23942399 static int bond_miimon_inspect(struct bonding *bond)
23952400 {
2401
+ bool ignore_updelay = false;
23962402 int link_state, commit = 0;
23972403 struct list_head *iter;
23982404 struct slave *slave;
2399
- bool ignore_updelay;
24002405
2401
- ignore_updelay = !rcu_dereference(bond->curr_active_slave);
2406
+ if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) {
2407
+ ignore_updelay = !rcu_dereference(bond->curr_active_slave);
2408
+ } else {
2409
+ struct bond_up_slave *usable_slaves;
2410
+
2411
+ usable_slaves = rcu_dereference(bond->usable_slaves);
2412
+
2413
+ if (usable_slaves && usable_slaves->count == 0)
2414
+ ignore_updelay = true;
2415
+ }
24022416
24032417 bond_for_each_slave_rcu(bond, slave, iter) {
24042418 bond_propose_link_state(slave, BOND_LINK_NOCHANGE);
....@@ -3528,7 +3542,11 @@
35283542 unblock_netpoll_tx();
35293543 break;
35303544 case NETDEV_FEAT_CHANGE:
3531
- bond_compute_features(bond);
3545
+ if (!bond->notifier_ctx) {
3546
+ bond->notifier_ctx = true;
3547
+ bond_compute_features(bond);
3548
+ bond->notifier_ctx = false;
3549
+ }
35323550 break;
35333551 case NETDEV_RESEND_IGMP:
35343552 /* Propagate to master device */
....@@ -4902,7 +4920,9 @@
49024920
49034921 bond_dev->hw_features = BOND_VLAN_FEATURES |
49044922 NETIF_F_HW_VLAN_CTAG_RX |
4905
- NETIF_F_HW_VLAN_CTAG_FILTER;
4923
+ NETIF_F_HW_VLAN_CTAG_FILTER |
4924
+ NETIF_F_HW_VLAN_STAG_RX |
4925
+ NETIF_F_HW_VLAN_STAG_FILTER;
49064926
49074927 bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4;
49084928 #ifdef CONFIG_XFRM_OFFLOAD
....@@ -5351,6 +5371,8 @@
53515371 if (!bond->wq)
53525372 return -ENOMEM;
53535373
5374
+ bond->notifier_ctx = false;
5375
+
53545376 spin_lock_init(&bond->stats_lock);
53555377 netdev_lockdep_set_classes(bond_dev);
53565378