Commit 71753b8e authored by Maxim Mikityanskiy's avatar Maxim Mikityanskiy Committed by Saeed Mahameed

net/mlx5e: Optimize the common case condition in mlx5e_select_queue

Check all booleans for special queues at once, when deciding whether to
go to the fast path in mlx5e_select_queue. Pack them into bitfields to
have some room for extensibility.
Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 3a9e5fff
......@@ -12,8 +12,13 @@ struct mlx5e_selq_params {
unsigned int num_regular_queues;
unsigned int num_channels;
unsigned int num_tcs;
bool is_htb;
bool is_ptp;
union {
u8 is_special_queues;
struct {
bool is_htb : 1;
bool is_ptp : 1;
};
};
};
int mlx5e_selq_init(struct mlx5e_selq *selq, struct mutex *state_lock)
......@@ -164,7 +169,7 @@ u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb,
if (unlikely(!selq))
return 0;
if (likely(!selq->is_ptp && !selq->is_htb)) {
if (likely(!selq->is_special_queues)) {
/* No special queues, netdev_pick_tx returns one of the regular ones. */
txq_ix = netdev_pick_tx(dev, skb, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment