Skip to content

Commit

Permalink
xsk: simplify xdp_clear_umem_at_qid implementation
Browse files Browse the repository at this point in the history
As we now do not allow ethtool to deactivate the queue id we are
running an AF_XDP socket on, we can simplify the implementation of
xdp_clear_umem_at_qid().

Signed-off-by: Magnus Karlsson <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
  • Loading branch information
magnus-karlsson authored and borkmann committed Oct 5, 2018
1 parent 1661d34 commit a41b4f3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/xdp/xdp_umem.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,9 @@ struct xdp_umem *xdp_get_umem_from_qid(struct net_device *dev,

static void xdp_clear_umem_at_qid(struct net_device *dev, u16 queue_id)
{
/* Zero out the entry independent on how many queues are configured
* at this point in time, as it might be used in the future.
*/
if (queue_id < dev->num_rx_queues)
if (queue_id < dev->real_num_rx_queues)
dev->_rx[queue_id].umem = NULL;
if (queue_id < dev->num_tx_queues)
if (queue_id < dev->real_num_tx_queues)
dev->_tx[queue_id].umem = NULL;
}

Expand Down

0 comments on commit a41b4f3

Please sign in to comment.