diff options
author | Magnus Karlsson <magnus.karlsson@intel.com> | 2018-10-01 08:51:37 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-10-05 03:31:01 -0400 |
commit | a41b4f3c58dddcb39b7072a97ac8cb9036ce53f6 (patch) | |
tree | 0b48b06adbcd305542c9e6d526bebdc522d8343a /net/xdp | |
parent | 1661d346628115c364e2b7d5b15a64ca3bd0dbd4 (diff) |
xsk: simplify xdp_clear_umem_at_qid implementation
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 <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net/xdp')
-rw-r--r-- | net/xdp/xdp_umem.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index 773326f682b1..c6007c58231c 100644 --- a/net/xdp/xdp_umem.c +++ b/net/xdp/xdp_umem.c | |||
@@ -68,12 +68,9 @@ struct xdp_umem *xdp_get_umem_from_qid(struct net_device *dev, | |||
68 | 68 | ||
69 | static void xdp_clear_umem_at_qid(struct net_device *dev, u16 queue_id) | 69 | static void xdp_clear_umem_at_qid(struct net_device *dev, u16 queue_id) |
70 | { | 70 | { |
71 | /* Zero out the entry independent on how many queues are configured | 71 | if (queue_id < dev->real_num_rx_queues) |
72 | * at this point in time, as it might be used in the future. | ||
73 | */ | ||
74 | if (queue_id < dev->num_rx_queues) | ||
75 | dev->_rx[queue_id].umem = NULL; | 72 | dev->_rx[queue_id].umem = NULL; |
76 | if (queue_id < dev->num_tx_queues) | 73 | if (queue_id < dev->real_num_tx_queues) |
77 | dev->_tx[queue_id].umem = NULL; | 74 | dev->_tx[queue_id].umem = NULL; |
78 | } | 75 | } |
79 | 76 | ||