From: Simon Horman <simon.horman@corigine.com>
To: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Cc: "Jesper Dangaard Brouer" <hawk@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
netdev@vger.kernel.org,
"Jonathan Lemon" <jonathan.lemon@gmail.com>,
"John Fastabend" <john.fastabend@gmail.com>,
"Jesse Brandeburg" <jesse.brandeburg@intel.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Björn Töpel" <bjorn@kernel.org>,
"Eric Dumazet" <edumazet@google.com>,
"Tony Nguyen" <anthony.l.nguyen@intel.com>,
"Jakub Kicinski" <kuba@kernel.org>,
intel-wired-lan@lists.osuosl.org, bpf@vger.kernel.org,
"Paolo Abeni" <pabeni@redhat.com>,
"David S . Miller" <davem@davemloft.net>,
"Magnus Karlsson" <magnus.karlsson@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3 3/4] igb: add AF_XDP zero-copy Rx support
Date: Sat, 15 Jul 2023 10:23:25 +0100 [thread overview]
Message-ID: <ZLJljUETnhH92kIV@corigine.com> (raw)
In-Reply-To: <20230713104717.29475-4-sriram.yagnaraman@est.tech>
On Thu, Jul 13, 2023 at 12:47:16PM +0200, Sriram Yagnaraman wrote:
> Add support for AF_XDP zero-copy receive path.
>
> When AF_XDP zero-copy is enabled, the rx buffers are allocated from the
> xsk buff pool using igb_alloc_rx_buffers_zc.
>
> Use xsk_pool_get_rx_frame_size to set SRRCTL rx buf size when zero-copy
> is enabled.
>
> Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
...
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 2c1e1d70bcf9..8eed3d0ab4fc 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -502,12 +502,14 @@ static void igb_dump(struct igb_adapter *adapter)
>
> for (i = 0; i < rx_ring->count; i++) {
> const char *next_desc;
> - struct igb_rx_buffer *buffer_info;
> - buffer_info = &rx_ring->rx_buffer_info[i];
> + struct igb_rx_buffer *buffer_info = NULL;
> rx_desc = IGB_RX_DESC(rx_ring, i);
> u0 = (struct my_u0 *)rx_desc;
> staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
>
> + if (!rx_ring->xsk_pool)
> + buffer_info = &rx_ring->rx_buffer_info[i];
> +
> if (i == rx_ring->next_to_use)
> next_desc = " NTU";
> else if (i == rx_ring->next_to_clean)
> @@ -530,7 +532,7 @@ static void igb_dump(struct igb_adapter *adapter)
> (u64)buffer_info->dma,
Hi Sriram,
Here buffer_info is dereferenced...
> next_desc);
>
> - if (netif_msg_pktdata(adapter) &&
> + if (netif_msg_pktdata(adapter) && buffer_info &&
And here buffer_info is checked against NULL.
This combination doesn't seem quite right.
> buffer_info->dma && buffer_info->page) {
> print_hex_dump(KERN_INFO, "",
> DUMP_PREFIX_ADDRESS,
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2023-07-15 9:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 10:47 [Intel-wired-lan] [PATCH iwl-next v3 0/4] igb: Add support for AF_XDP zero-copy Sriram Yagnaraman
2023-07-13 10:47 ` [Intel-wired-lan] [PATCH iwl-next v3 1/4] igb: prepare for AF_XDP zero-copy support Sriram Yagnaraman
2023-07-13 10:47 ` [Intel-wired-lan] [PATCH iwl-next v3 2/4] igb: Introduce XSK data structures and helpers Sriram Yagnaraman
2023-07-13 10:47 ` [Intel-wired-lan] [PATCH iwl-next v3 3/4] igb: add AF_XDP zero-copy Rx support Sriram Yagnaraman
2023-07-15 9:23 ` Simon Horman [this message]
2023-07-18 11:26 ` Sriram Yagnaraman
2023-07-13 10:47 ` [Intel-wired-lan] [PATCH iwl-next v3 4/4] igb: add AF_XDP zero-copy Tx support Sriram Yagnaraman
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=ZLJljUETnhH92kIV@corigine.com \
--to=simon.horman@corigine.com \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=john.fastabend@gmail.com \
--cc=jonathan.lemon@gmail.com \
--cc=kuba@kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sriram.yagnaraman@est.tech \
/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