From mboxrd@z Thu Jan 1 00:00:00 1970 From: Magnus Karlsson Subject: [PATCH bpf-next v2 5/5] xsk: simplify xdp_clear_umem_at_qid implementation Date: Mon, 1 Oct 2018 14:51:37 +0200 Message-ID: <1538398297-14862-6-git-send-email-magnus.karlsson@intel.com> References: <1538398297-14862-1-git-send-email-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 Return-path: Received: from mga07.intel.com ([134.134.136.100]:45529 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729396AbeJATaB (ORCPT ); Mon, 1 Oct 2018 15:30:01 -0400 In-Reply-To: <1538398297-14862-1-git-send-email-magnus.karlsson@intel.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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