lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMArcTXrryUq_D9i4ezRk7Et6qNC4jD9iGNxSELYt2qWzSREgg@mail.gmail.com>
Date: Tue, 1 Apr 2025 16:17:34 +0900
From: Taehee Yoo <ap420073@...il.com>
To: Michael Chan <michael.chan@...adcom.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com, 
	edumazet@...gle.com, andrew+netdev@...n.ch, horms@...nel.org, 
	pavan.chebbi@...adcom.com, ilias.apalodimas@...aro.org, dw@...idwei.uk, 
	netdev@...r.kernel.org, kuniyu@...zon.com, sdf@...ichev.me, 
	aleksander.lobakin@...el.com
Subject: Re: [RFC net-next 1/2] eth: bnxt: refactor buffer descriptor

On Tue, Apr 1, 2025 at 2:39 PM Michael Chan <michael.chan@...adcom.com> wrote:
>

Hi Michael,
Thanks a lot for the review!

> On Mon, Mar 31, 2025 at 4:47 AM Taehee Yoo <ap420073@...il.com> wrote:
>
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > index 934ba9425857..198a42da3015 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > @@ -915,24 +915,24 @@ static struct page *__bnxt_alloc_rx_page(struct bnxt *bp, dma_addr_t *mapping,
> >         if (!page)
> >                 return NULL;
> >
> > -       *mapping = page_pool_get_dma_addr(page) + *offset;
> > +       *mapping = page_pool_get_dma_addr(page) + bp->rx_dma_offset + *offset;
>
> Why are we changing the logic here by adding bp->rx_dma_offset?
> Please explain this and other similar offset changes in the rest of
> the patch.  It may be more clear if you split this patch into smaller
> patches.

Apologies for a lack of explanation.
This change intends to make the two functions similar.
__bnxt_alloc_rx_page() and __bnxt_alloc_rx_frag().

Original code like this.
```
    __bnxt_alloc_rx_page()
        *mapping = page_pool_get_dma_addr(page) + *offset;
    __bnxt_alloc_rx_frag()
        *mapping = page_pool_get_dma_addr(page) + bp->rx_dma_offset + offset;

Then, we use a mapping value like below.
    bnxt_alloc_rx_data()
        if (BNXT_RX_PAGE_MODE(bp)) {
            ...
            mapping += bp->rx_dma_offset;
        }

    rx_buf->mapping = mapping;

    bnxt_alloc_rx_page()
        page = __bnxt_alloc_rx_page();
        // no mapping offset change.
```

So I changed this logic like below.
```
    __bnxt_alloc_rx_page()
        *mapping = page_pool_get_dma_addr(page) + bp->rx_dma_offset + *offset;
    __bnxt_alloc_rx_frag()
        *mapping = page_pool_get_dma_addr(page) + bp->rx_dma_offset + *offset;

    bnxt_alloc_rx_data()
        // no mapping offset change.
        rx_buf->mapping = mapping;

    bnxt_alloc_rx_page()
        page = __bnxt_alloc_rx_page();
        mapping -= bp->rx_dma_offset; //added for this change.
```

However, including this change is not necessary for this patchset.
Moreover, it makes the patch harder to review.
Therefore, as you mentioned, I would like to drop this change for now
and submit a separate patch for it later.

Also, if you think I missed other points, please let me know!

>
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> > index 21726cf56586..13db8b7bd4b7 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> > @@ -807,7 +807,7 @@ struct nqe_cn {
> >  #define SW_RXBD_RING_SIZE (sizeof(struct bnxt_sw_rx_bd) * RX_DESC_CNT)
> >  #define HW_RXBD_RING_SIZE (sizeof(struct rx_bd) * RX_DESC_CNT)
> >
> > -#define SW_RXBD_AGG_RING_SIZE (sizeof(struct bnxt_sw_rx_agg_bd) * RX_DESC_CNT)
> > +#define SW_RXBD_AGG_RING_SIZE (sizeof(struct bnxt_sw_rx_bd) * RX_DESC_CNT)
>
> I would just eliminate SW_RXBD_AGG_RING_SIZE since it is now identical
> to SW_RXBD_RING_SIZE.
> Thanks.

Okay, I will remove SW_RXBD_AGG_RING_SIZE and then use
SW_RXBD_RING_SIZE instead.

Thanks a lot!
Taehee Yoo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ