public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux•org.uk>
To: Matteo Croce <mcroce@linux•microsoft.com>
Cc: netdev@vger•kernel.org, linux-mm@kvack•org,
	Ayush Sawal <ayush.sawal@chelsio•com>,
	Vinay Kumar Yadav <vinay.yadav@chelsio•com>,
	Rohit Maheshwari <rohitm@chelsio•com>,
	"David S. Miller" <davem@davemloft•net>,
	Jakub Kicinski <kuba@kernel•org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin•com>,
	Marcin Wojtas <mw@semihalf•com>,
	Mirko Lindner <mlindner@marvell•com>,
	Stephen Hemminger <stephen@networkplumber•org>,
	Tariq Toukan <tariqt@nvidia•com>,
	Jesper Dangaard Brouer <hawk@kernel•org>,
	Ilias Apalodimas <ilias.apalodimas@linaro•org>,
	Alexei Starovoitov <ast@kernel•org>,
	Daniel Borkmann <daniel@iogearbox•net>,
	John Fastabend <john.fastabend@gmail•com>,
	Boris Pismenny <borisp@nvidia•com>, Arnd Bergmann <arnd@arndb•de>,
	Andrew Morton <akpm@linux-foundation•org>,
	"Peter Zijlstra (Intel)" <peterz@infradead•org>,
	Vlastimil Babka <vbabka@suse•cz>, Yu Zhao <yuzhao@google•com>,
	Will Deacon <will@kernel•org>, Fenghua Yu <fenghua.yu@intel•com>,
	Roman Gushchin <guro@fb•com>, Hugh Dickins <hughd@google•com>,
	Peter Xu <peterx@redhat•com>, Jason Gunthorpe <jgg@ziepe•ca>,
	Jonathan Lemon <jonathan.lemon@gmail•com>,
	Alexander Lobakin <alobakin@pm•me>,
	Cong Wang <cong.wang@bytedance•com>, wenxu <wenxu@ucloud•cn>,
	Kevin Hao <haokexin@gmail•com>,
	Jakub Sitnicki <jakub@cloudflare•com>,
	Marco Elver <elver@google•com>,
	Willem de Bruijn <willemb@google•com>,
	Miaohe Lin <linmiaohe@huawei•com>,
	Yunsheng Lin <linyunsheng@huawei•com>,
	Guillaume Nault <gnault@redhat•com>,
	linux-kernel@vger•kernel.org, linux-rdma@vger•kernel.org,
	bpf@vger•kernel.org, Matthew Wilcox <willy@infradead•org>,
	Eric Dumazet <edumazet@google•com>,
	David Ahern <dsahern@gmail•com>,
	Lorenzo Bianconi <lorenzo@kernel•org>,
	Saeed Mahameed <saeedm@nvidia•com>, Andrew Lunn <andrew@lunn•ch>,
	Paolo Abeni <pabeni@redhat•com>,
	Sven Auhagen <sven.auhagen@voleatech•de>
Subject: Re: [PATCH net-next v5 4/5] mvpp2: recycle buffers
Date: Thu, 13 May 2021 19:20:48 +0100	[thread overview]
Message-ID: <20210513182048.GA12395@shell.armlinux.org.uk> (raw)
In-Reply-To: <20210513165846.23722-5-mcroce@linux.microsoft.com>

On Thu, May 13, 2021 at 06:58:45PM +0200, Matteo Croce wrote:
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index b2259bf1d299..9dceabece56c 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -3847,6 +3847,7 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi,
>  	struct mvpp2_pcpu_stats ps = {};
>  	enum dma_data_direction dma_dir;
>  	struct bpf_prog *xdp_prog;
> +	struct xdp_rxq_info *rxqi;
>  	struct xdp_buff xdp;
>  	int rx_received;
>  	int rx_done = 0;
> @@ -3912,15 +3913,15 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi,
>  		else
>  			frag_size = bm_pool->frag_size;
>  
> +		if (bm_pool->pkt_size == MVPP2_BM_SHORT_PKT_SIZE)
> +			rxqi = &rxq->xdp_rxq_short;
> +		else
> +			rxqi = &rxq->xdp_rxq_long;
>  
> +		if (xdp_prog) {
> +			xdp.rxq = rxqi;
>  
> +			xdp_init_buff(&xdp, PAGE_SIZE, rxqi);
>  			xdp_prepare_buff(&xdp, data,
>  					 MVPP2_MH_SIZE + MVPP2_SKB_HEADROOM,
>  					 rx_bytes, false);
> @@ -3964,7 +3965,7 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi,
>  		}
>  
>  		if (pp)
> +			skb_mark_for_recycle(skb, virt_to_page(data), pp);
>  		else
>  			dma_unmap_single_attrs(dev->dev.parent, dma_addr,
>  					       bm_pool->buf_size, DMA_FROM_DEVICE,

Looking at the above, which I've only quoted the _resulting_ code after
your patch above, I don't see why you have moved the
"bm_pool->pkt_size == MVPP2_BM_SHORT_PKT_SIZE" conditional outside of
the test for xdp_prog - I don't see rxqi being used except within that
conditional. Please can you explain the reasoning there?

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2021-05-13 18:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13 16:58 [PATCH net-next v5 0/5] page_pool: recycle buffers Matteo Croce
2021-05-13 16:58 ` [PATCH net-next v5 1/5] mm: add a signature in struct page Matteo Croce
2021-05-14  1:00   ` Matthew Wilcox
2021-05-14  1:34     ` Matteo Croce
2021-05-18 15:44     ` Matteo Croce
2021-05-13 16:58 ` [PATCH net-next v5 2/5] skbuff: add a parameter to __skb_frag_unref Matteo Croce
2021-05-13 16:58 ` [PATCH net-next v5 3/5] page_pool: Allow drivers to hint on SKB recycling Matteo Croce
2021-05-14  3:39   ` Yunsheng Lin
2021-05-14  7:36     ` Ilias Apalodimas
2021-05-14  8:31       ` Yunsheng Lin
2021-05-14  9:17         ` Ilias Apalodimas
2021-05-15  2:07           ` Yunsheng Lin
2021-05-17  6:38             ` Ilias Apalodimas
2021-05-17  8:25               ` Yunsheng Lin
2021-05-17  9:36                 ` Ilias Apalodimas
2021-05-17 11:10                   ` Yunsheng Lin
2021-05-17 11:35                     ` Ilias Apalodimas
2021-05-13 16:58 ` [PATCH net-next v5 4/5] mvpp2: recycle buffers Matteo Croce
2021-05-13 18:20   ` Russell King (Oracle) [this message]
2021-05-13 23:52     ` Matteo Croce
2021-05-13 16:58 ` [PATCH net-next v5 5/5] mvneta: " Matteo Croce
2021-05-13 18:25   ` Russell King (Oracle)

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=20210513182048.GA12395@shell.armlinux.org.uk \
    --to=linux@armlinux$(echo .)org.uk \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=alobakin@pm$(echo .)me \
    --cc=andrew@lunn$(echo .)ch \
    --cc=arnd@arndb$(echo .)de \
    --cc=ast@kernel$(echo .)org \
    --cc=ayush.sawal@chelsio$(echo .)com \
    --cc=borisp@nvidia$(echo .)com \
    --cc=bpf@vger$(echo .)kernel.org \
    --cc=cong.wang@bytedance$(echo .)com \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=dsahern@gmail$(echo .)com \
    --cc=edumazet@google$(echo .)com \
    --cc=elver@google$(echo .)com \
    --cc=fenghua.yu@intel$(echo .)com \
    --cc=gnault@redhat$(echo .)com \
    --cc=guro@fb$(echo .)com \
    --cc=haokexin@gmail$(echo .)com \
    --cc=hawk@kernel$(echo .)org \
    --cc=hughd@google$(echo .)com \
    --cc=ilias.apalodimas@linaro$(echo .)org \
    --cc=jakub@cloudflare$(echo .)com \
    --cc=jgg@ziepe$(echo .)ca \
    --cc=john.fastabend@gmail$(echo .)com \
    --cc=jonathan.lemon@gmail$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=linmiaohe@huawei$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mm@kvack$(echo .)org \
    --cc=linux-rdma@vger$(echo .)kernel.org \
    --cc=linyunsheng@huawei$(echo .)com \
    --cc=lorenzo@kernel$(echo .)org \
    --cc=mcroce@linux$(echo .)microsoft.com \
    --cc=mlindner@marvell$(echo .)com \
    --cc=mw@semihalf$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=peterx@redhat$(echo .)com \
    --cc=peterz@infradead$(echo .)org \
    --cc=rohitm@chelsio$(echo .)com \
    --cc=saeedm@nvidia$(echo .)com \
    --cc=stephen@networkplumber$(echo .)org \
    --cc=sven.auhagen@voleatech$(echo .)de \
    --cc=tariqt@nvidia$(echo .)com \
    --cc=thomas.petazzoni@bootlin$(echo .)com \
    --cc=vbabka@suse$(echo .)cz \
    --cc=vinay.yadav@chelsio$(echo .)com \
    --cc=wenxu@ucloud$(echo .)cn \
    --cc=will@kernel$(echo .)org \
    --cc=willemb@google$(echo .)com \
    --cc=willy@infradead$(echo .)org \
    --cc=yuzhao@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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