From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
bpf@vger.kernel.org, netdev@vger.kernel.org, davem@davemloft.net,
kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net,
alexander.duyck@gmail.com, maciej.fijalkowski@intel.com,
saeed@kernel.org
Subject: Re: [PATCH v3 bpf-next 1/2] net: xdp: introduce xdp_init_buff utility routine
Date: Wed, 16 Dec 2020 15:56:50 +0100 [thread overview]
Message-ID: <20201216145650.GC2036@lore-desk> (raw)
In-Reply-To: <20201216093543.73836860@carbon>
[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]
> On Sat, 12 Dec 2020 18:41:48 +0100
> Lorenzo Bianconi <lorenzo@kernel.org> wrote:
>
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> > index fcc262064766..b7942c3440c0 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> > @@ -133,12 +133,11 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
> > dma_sync_single_for_cpu(&pdev->dev, mapping + offset, *len, bp->rx_dir);
> >
> > txr = rxr->bnapi->tx_ring;
> > + xdp_init_buff(&xdp, PAGE_SIZE, &rxr->xdp_rxq);
> > xdp.data_hard_start = *data_ptr - offset;
> > xdp.data = *data_ptr;
> > xdp_set_data_meta_invalid(&xdp);
> > xdp.data_end = *data_ptr + *len;
> > - xdp.rxq = &rxr->xdp_rxq;
> > - xdp.frame_sz = PAGE_SIZE; /* BNXT_RX_PAGE_MODE(bp) when XDP enabled */
> > orig_data = xdp.data;
>
> I don't like loosing the comment here. Other developers reading this
> code might assume that size is always PAGE_SIZE, which is only the case
> when XDP is enabled. Lets save them from making this mistake.
ack, I will add it back in v4.
Regards,
Lorenzo
>
> --
> Best regards,
> Jesper Dangaard Brouer
> MSc.CS, Principal Kernel Engineer at Red Hat
> LinkedIn: http://www.linkedin.com/in/brouer
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2020-12-16 14:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-12 17:41 [PATCH v3 bpf-next 0/2] introduce xdp_init_buff/xdp_prepare_buff Lorenzo Bianconi
2020-12-12 17:41 ` [PATCH v3 bpf-next 1/2] net: xdp: introduce xdp_init_buff utility routine Lorenzo Bianconi
2020-12-16 8:35 ` Jesper Dangaard Brouer
2020-12-16 14:56 ` Lorenzo Bianconi [this message]
2020-12-12 17:41 ` [PATCH v3 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff " Lorenzo Bianconi
2020-12-15 12:36 ` Maciej Fijalkowski
2020-12-15 13:47 ` Lorenzo Bianconi
2020-12-15 14:51 ` Daniel Borkmann
2020-12-15 15:06 ` Lorenzo Bianconi
2020-12-15 15:13 ` Maciej Fijalkowski
2020-12-15 20:36 ` Lorenzo Bianconi
2020-12-16 8:30 ` Jesper Dangaard Brouer
2020-12-16 8:52 ` Jesper Dangaard Brouer
2020-12-16 15:01 ` Lorenzo Bianconi
2020-12-17 18:16 ` Saeed Mahameed
2020-12-17 18:28 ` Maciej Fijalkowski
2020-12-17 20:31 ` Saeed Mahameed
2020-12-14 15:32 ` [PATCH v3 bpf-next 0/2] introduce xdp_init_buff/xdp_prepare_buff Martin Habets
2020-12-14 17:53 ` Camelia Alexandra Groza
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=20201216145650.GC2036@lore-desk \
--to=lorenzo.bianconi@redhat.com \
--cc=alexander.duyck@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=saeed@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;
as well as URLs for NNTP newsgroup(s).