[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <MWHPR1801MB19182492222AF49BC545FE6CD3799@MWHPR1801MB1918.namprd18.prod.outlook.com>
Date: Tue, 16 May 2023 09:35:49 +0000
From: Ratheesh Kannoth <rkannoth@...vell.com>
To: Paolo Abeni <pabeni@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Sunil Kovvuri Goutham <sgoutham@...vell.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>
Subject: RE: Re: [PATCH net-next] octeontx2-pf: Add support for page pool
> -----Original Message-----
> From: Paolo Abeni <pabeni@...hat.com>
> Sent: Tuesday, May 16, 2023 2:31 PM
> To: Ratheesh Kannoth <rkannoth@...vell.com>; netdev@...r.kernel.org;
> linux-kernel@...r.kernel.org
> Cc: Sunil Kovvuri Goutham <sgoutham@...vell.com>;
> davem@...emloft.net; edumazet@...gle.com; kuba@...nel.org
> Subject: [EXT] Re: [PATCH net-next] octeontx2-pf: Add support for page pool
> ----------------------------------------------------------------------
> On Mon, 2023-05-15 at 11:26 +0530, Ratheesh Kannoth wrote:
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> > b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> > index 7045fedfd73a..df5f45aa6980 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> > @@ -217,9 +217,10 @@ static bool otx2_skb_add_frag(struct otx2_nic
> *pfvf, struct sk_buff *skb,
> > skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
> > va - page_address(page) + off,
> > len - off, pfvf->rbsize);
> > -
> > +#ifndef CONFIG_PAGE_POOL
> > otx2_dma_unmap_page(pfvf, iova - OTX2_HEAD_ROOM,
> > pfvf->rbsize, DMA_FROM_DEVICE);
> > +#endif
>
> Don't you need to do the same even when CONFIG_PAGE_POOL and !pool-
> >page_pool ?
No, if CONFIG_PAGE_POOL is enabled, pool->page_pool would be != NULL. As you suggested earlier, we will select CONFIG_PAGE_POOL on enabling
the driver. This means, all these ifdef checks will go away.
>
> > return true;
> > }
> >
> > @@ -382,6 +383,8 @@ static void otx2_rcv_pkt_handler(struct otx2_nic
> *pfvf,
> > if (pfvf->netdev->features & NETIF_F_RXCSUM)
> > skb->ip_summed = CHECKSUM_UNNECESSARY;
> >
> > + skb_mark_for_recycle(skb);
>
> Don't you need to set the recycle only when pool->page_pool?
No. Page pool is enabled only for RX side. Pool->page_pool will be != NULL if CONFIG_PAGE_POOL is enabled.
skb_mark_for_recycle() function is dummy if CONFIG_PAGE_POOL is not selected.
static inline void skb_mark_for_recycle(struct sk_buff *skb)
{
#ifdef CONFIG_PAGE_POOL
skb->pp_recycle = 1;
#endif
}
>
> Overall it looks like that having both the pool->page_pool and
> CONFIG_PAGE_POOL checks in place add a few possible sources of bugs.
We added #ifdef checks to improve performance incase CONFIG_PAGE_POOL is disabled. As we decided (As per your review comments) to select CONFIG_PAGE_POOL
For the driver, all these #ifdefs will be removed.
Thanks,
Ratheesh Kannoth
Powered by blists - more mailing lists