From: Magnus Karlsson <magnus.karlsson@intel.com>
To: magnus.karlsson@intel.com, bjorn.topel@intel.com, ast@kernel.org,
daniel@iogearbox.net, netdev@vger.kernel.org,
jakub.kicinski@netronome.com
Subject: [PATCH bpf-next v2 5/5] xsk: simplify xdp_clear_umem_at_qid implementation
Date: Mon, 1 Oct 2018 14:51:37 +0200 [thread overview]
Message-ID: <1538398297-14862-6-git-send-email-magnus.karlsson@intel.com> (raw)
In-Reply-To: <1538398297-14862-1-git-send-email-magnus.karlsson@intel.com>
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>
---
net/xdp/xdp_umem.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
index 773326f..c6007c5 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,
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;
}
--
2.7.4
next prev parent reply other threads:[~2018-10-01 19:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-01 12:51 [PATCH bpf-next v2 0/5] xsk: fix bug when trying to use both copy and zero-copy mode Magnus Karlsson
2018-10-01 12:51 ` [PATCH bpf-next v2 1/5] net: add umem reference in netdev{_rx}_queue Magnus Karlsson
2018-10-01 12:51 ` [PATCH bpf-next v2 2/5] xsk: fix bug when trying to use both copy and zero-copy on one queue id Magnus Karlsson
2018-10-01 12:51 ` [PATCH bpf-next v2 3/5] ethtool: rename local variable max -> curr Magnus Karlsson
2018-10-01 12:51 ` [PATCH bpf-next v2 4/5] ethtool: don't allow disabling queues with umem installed Magnus Karlsson
2018-10-01 12:51 ` Magnus Karlsson [this message]
2018-10-01 20:31 ` [PATCH bpf-next v2 0/5] xsk: fix bug when trying to use both copy and zero-copy mode Jakub Kicinski
2018-10-02 12:49 ` Magnus Karlsson
2018-10-02 16:58 ` Jakub Kicinski
2018-10-05 7:35 ` Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1538398297-14862-6-git-send-email-magnus.karlsson@intel.com \
--to=magnus.karlsson@intel.com \
--cc=ast@kernel.org \
--cc=bjorn.topel@intel.com \
--cc=daniel@iogearbox.net \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox