This merge includes updates to bonding driver needed for the rdma stack, to avoid conflicts with the RDMA branch. Maor Gottlieb Says: ==================== Bonding: Add support to get xmit slave The following series adds support to get the LAG master xmit slave by introducing new .ndo - ndo_get_xmit_slave. Every LAG module can implement it and it first implemented in the bond driver. This is follow-up to the RFC discussion [1]. The main motivation for doing this is for drivers that offload part of the LAG functionality. For example, Mellanox Connect-X hardware implements RoCE LAG which selects the TX affinity when the resources are created and port is remapped when it goes down. The first part of this patchset introduces the new .ndo and add the support to the bonding module. The second part adds support to get the RoCE LAG xmit slave by building skb of the RoCE packet based on the AH attributes and call to the new .ndo. The third part change the mlx5 driver driver to set the QP's affinity port according to the slave which found by the .ndo. ====================
Showing the changes to include/linux (2 of 8 files). Show all
Unified · Split
| @@ -1074,6 +1074,8 @@ bool mlx5_lag_is_sriov(struct mlx5_core_dev *dev); · 1073 unmodified lines | |||
| 1074 | bool mlx5_lag_is_multipath(struct mlx5_core_dev *dev); | 1074 | bool mlx5_lag_is_multipath(struct mlx5_core_dev *dev); |
| 1075 | bool mlx5_lag_is_active(struct mlx5_core_dev *dev); | 1075 | bool mlx5_lag_is_active(struct mlx5_core_dev *dev); |
| 1076 | struct net_device *mlx5_lag_get_roce_netdev(struct mlx5_core_dev *dev); | 1076 | struct net_device *mlx5_lag_get_roce_netdev(struct mlx5_core_dev *dev); |
| 1077 | u8 mlx5_lag_get_slave_port(struct mlx5_core_dev *dev, | ||
| 1078 | struct net_device *slave); | ||
| 1077 | int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev, | 1079 | int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev, |
| 1078 | u64 *values, | 1080 | u64 *values, |
| 1079 | int num_counters, | 1081 | int num_counters, |
| @@ -1148,6 +1148,12 @@ struct netdev_net_notifier { · 1147 unmodified lines | |||
| 1148 | * int (*ndo_del_slave)(struct net_device *dev, struct net_device *slave_dev); | 1148 | * int (*ndo_del_slave)(struct net_device *dev, struct net_device *slave_dev); |
| 1149 | * Called to release previously enslaved netdev. | 1149 | * Called to release previously enslaved netdev. |
| 1150 | * | 1150 | * |
| 1151 | * struct net_device *(*ndo_get_xmit_slave)(struct net_device *dev, | ||
| 1152 | * struct sk_buff *skb, | ||
| 1153 | * bool all_slaves); | ||
| 1154 | * Get the xmit slave of master device. If all_slaves is true, function | ||
| 1155 | * assume all the slaves can transmit. | ||
| 1156 | * | ||
| 1151 | * Feature/offload setting functions. | 1157 | * Feature/offload setting functions. |
| 1152 | * netdev_features_t (*ndo_fix_features)(struct net_device *dev, | 1158 | * netdev_features_t (*ndo_fix_features)(struct net_device *dev, |
| 1153 | * netdev_features_t features); | 1159 | * netdev_features_t features); |
| @@ -1391,6 +1397,9 @@ struct net_device_ops { · 237 unmodified lines | |||
| 1391 | struct netlink_ext_ack *extack); | 1397 | struct netlink_ext_ack *extack); |
| 1392 | int (*ndo_del_slave)(struct net_device *dev, | 1398 | int (*ndo_del_slave)(struct net_device *dev, |
| 1393 | struct net_device *slave_dev); | 1399 | struct net_device *slave_dev); |
| 1400 | struct net_device* (*ndo_get_xmit_slave)(struct net_device *dev, | ||
| 1401 | struct sk_buff *skb, | ||
| 1402 | bool all_slaves); | ||
| 1394 | netdev_features_t (*ndo_fix_features)(struct net_device *dev, | 1403 | netdev_features_t (*ndo_fix_features)(struct net_device *dev, |
| 1395 | netdev_features_t features); | 1404 | netdev_features_t features); |
| 1396 | int (*ndo_set_features)(struct net_device *dev, | 1405 | int (*ndo_set_features)(struct net_device *dev, |
| @@ -2745,6 +2754,9 @@ void netdev_freemem(struct net_device *dev); · 1348 unmodified lines | |||
| 2745 | void synchronize_net(void); | 2754 | void synchronize_net(void); |
| 2746 | int init_dummy_netdev(struct net_device *dev); | 2755 | int init_dummy_netdev(struct net_device *dev); |
| 2747 | 2756 | ||
| 2757 | struct net_device *netdev_get_xmit_slave(struct net_device *dev, | ||
| 2758 | struct sk_buff *skb, | ||
| 2759 | bool all_slaves); | ||
| 2748 | struct net_device *dev_get_by_index(struct net *net, int ifindex); | 2760 | struct net_device *dev_get_by_index(struct net *net, int ifindex); |
| 2749 | struct net_device *__dev_get_by_index(struct net *net, int ifindex); | 2761 | struct net_device *__dev_get_by_index(struct net *net, int ifindex); |
| 2750 | struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); | 2762 | struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); |