After the previous patch, all the callers of ndo_select_queue() provide as a 'fallback' argument netdev_pick_tx. The only exceptions are nested calls to ndo_select_queue(), which pass down the 'fallback' available in the current scope - still netdev_pick_tx. We can drop such argument and replace fallback() invocation with netdev_pick_tx(). This avoids an indirect call per xmit packet in some scenarios (TCP syn, UDP unconnected, XDP generic, pktgen) with device drivers implementing such ndo. It also clean the code a bit. Tested with ixgbe and CONFIG_FCOE=m With pktgen using queue xmit: threads vanilla patched (kpps) (kpps) 1 2334 2428 2 4166 4278 4 7895 8100 v1 -> v2: - rebased after helper's name change
Showing the changes to include/linux (1 of 32 files). Show all
Unified · Split
| @@ -986,8 +986,7 @@ struct devlink; · 985 unmodified lines | |||
| 986 | * those the driver believes to be appropriate. | 986 | * those the driver believes to be appropriate. |
| 987 | * | 987 | * |
| 988 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, | 988 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, |
| 989 | * struct net_device *sb_dev, | 989 | * struct net_device *sb_dev); |
| 990 | * select_queue_fallback_t fallback); | ||
| 991 | * Called to decide which queue to use when device supports multiple | 990 | * Called to decide which queue to use when device supports multiple |
| 992 | * transmit queues. | 991 | * transmit queues. |
| 993 | * | 992 | * |
| @@ -1268,8 +1267,7 @@ struct net_device_ops { · 274 unmodified lines | |||
| 1268 | netdev_features_t features); | 1267 | netdev_features_t features); |
| 1269 | u16 (*ndo_select_queue)(struct net_device *dev, | 1268 | u16 (*ndo_select_queue)(struct net_device *dev, |
| 1270 | struct sk_buff *skb, | 1269 | struct sk_buff *skb, |
| 1271 | struct net_device *sb_dev, | 1270 | struct net_device *sb_dev); |
| 1272 | select_queue_fallback_t fallback); | ||
| 1273 | void (*ndo_change_rx_flags)(struct net_device *dev, | 1271 | void (*ndo_change_rx_flags)(struct net_device *dev, |
| 1274 | int flags); | 1272 | int flags); |
| 1275 | void (*ndo_set_rx_mode)(struct net_device *dev); | 1273 | void (*ndo_set_rx_mode)(struct net_device *dev); |
| @@ -2641,11 +2639,9 @@ void dev_close_many(struct list_head *head, bool unlink); · 1365 unmodified lines | |||
| 2641 | void dev_disable_lro(struct net_device *dev); | 2639 | void dev_disable_lro(struct net_device *dev); |
| 2642 | int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb); | 2640 | int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb); |
| 2643 | u16 dev_pick_tx_zero(struct net_device *dev, struct sk_buff *skb, | 2641 | u16 dev_pick_tx_zero(struct net_device *dev, struct sk_buff *skb, |
| 2644 | struct net_device *sb_dev, | 2642 | struct net_device *sb_dev); |
| 2645 | select_queue_fallback_t fallback); | ||
| 2646 | u16 dev_pick_tx_cpu_id(struct net_device *dev, struct sk_buff *skb, | 2643 | u16 dev_pick_tx_cpu_id(struct net_device *dev, struct sk_buff *skb, |
| 2647 | struct net_device *sb_dev, | 2644 | struct net_device *sb_dev); |
| 2648 | select_queue_fallback_t fallback); | ||
| 2649 | int dev_queue_xmit(struct sk_buff *skb); | 2645 | int dev_queue_xmit(struct sk_buff *skb); |
| 2650 | int dev_queue_xmit_accel(struct sk_buff *skb, struct net_device *sb_dev); | 2646 | int dev_queue_xmit_accel(struct sk_buff *skb, struct net_device *sb_dev); |
| 2651 | int dev_direct_xmit(struct sk_buff *skb, u16 queue_id); | 2647 | int dev_direct_xmit(struct sk_buff *skb, u16 queue_id); |