Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: mmc@linux.ibm.com
Cc: netdev@vger.kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au,
	npiggin@gmail.com, chleroy@kernel.org, ritesh.list@gmail.com,
	sshegde@linux.ibm.com, nnac123@linux.ibm.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com,
	linuxppc-dev@lists.ozlabs.org, horms@kernel.org,
	davemarq@linux.ibm.com, haren@linux.ibm.com,
	ricklind@linux.ibm.com, bjking1@linux.ibm.com,
	shaik.abdulla1@ibm.com
Subject: Re: [PATCH net-next 8/8] ibmveth: Split RX poll into per-slot helpers for MQ
Date: Mon, 23 Nov 2026 01:06:14 +0000	[thread overview]
Message-ID: <179539597459.3135.8252131963439580422@kernel.org> (raw)
In-Reply-To: <20261119000711.18093-9-mmc@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The helper ibmveth_poll_drop_oversize() in
  drivers/net/ethernet/ibm/ibmveth.c has a misleading name, and the…
- [Low] Two comments still name ibmveth_poll() as the place where per-
  slot RX handling happens, but this patch moved that code into new…

--

ibmveth: Split RX poll into per-slot helpers for MQ

This commit moves three pieces of per-slot RX handling out of
ibmveth_poll() and into new helpers: the invalid-slot recycle, the
bad-frame drop and frame delivery. The bad-frame error message now also
prints the queue index. Otherwise the commit intends no behavior change.

> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index a40d9a6abf51b..a36dafb8e8937 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c
> @@ -1995,6 +1995,148 @@ static void ibmveth_rx_csum_helper(struct sk_buff *skb,

[ ... ]

> +static void ibmveth_poll_deliver_frame(struct napi_struct *napi,
> +				       struct ibmveth_adapter *adapter,
> +				       struct net_device *netdev,
> +				       int queue_index, u64 correlator)
> +{

[ ... ]

> +	skb = ibmveth_rxq_get_buffer(adapter, queue_index, correlator);
> +	if (unlikely(!skb)) {
> +		ibmveth_rxq_advance(adapter, queue_index);
> +		netdev->stats.rx_dropped++;
> +		return;
> +	}

[Severity: Low]
This get_buffer failure branch now lives in ibmveth_poll_deliver_frame().
Are two comments elsewhere in ibmveth.c out of date as a result?

The kernel-doc for ibmveth_rxq_harvest_buffer_test() still says:

 * the toggle at the end. This covers the harvest path; the advance after
 * ibmveth_rxq_get_buffer() fails in ibmveth_poll() is not tested here.

ibmveth_poll() no longer contains that ibmveth_rxq_advance() call.

The kernel-doc for ibmveth_rxq_harvest_buffer() also still says:

 * Context: called from ibmveth_poll

Its direct callers are now ibmveth_poll_recycle_invalid(),
ibmveth_poll_drop_oversize() and ibmveth_poll_deliver_frame(). That one
is still roughly accurate, because these helpers are only reached from
ibmveth_poll(). The test comment, though, now names the wrong function.

> +
> +	pool = correlator >> 32;
> +	bpool = &adapter->rx_buff_pool[queue_index][pool];
> +	room = min_t(unsigned int, skb_tailroom(skb), bpool->buff_size);
> +	off = offset;
> +	len = length;
> +	if (unlikely(len < ETH_HLEN || off >= room || len > room - off)) {
> +		ibmveth_poll_drop_oversize(netdev, adapter, queue_index,
> +					   off, len, room, correlator);
> +		return;
> +	}

[Severity: Low]
This isn't a bug, but does the name ibmveth_poll_drop_oversize() fit
what this helper handles?

It is called when any of these three checks fail:

    len < ETH_HLEN || off >= room || len > room - off

Only the last check means the frame is too large. The first one catches
frames shorter than an Ethernet header. The second catches an offset
that lies outside the buffer.

The message inside the helper is already generic ("bad RX frame offset
%u length %u (buffer %u) on queue %d, dropping"). The commit message,
however, uses the same narrow wording as the helper name:

  Move the invalid-slot recycle, the oversize-frame drop and frame
  delivery out of ibmveth_poll() into helpers.

Would a name like ibmveth_poll_drop_bad_frame() be a better match?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119000711.18093-1-mmc%40linux.ibm.com

      reply	other threads:[~2026-11-23  1:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  0:07 [PATCH net-next 0/8] ibmveth: prepare the RX path for multi-queue Mingming Cao
2026-11-19  0:07 ` [PATCH net-next 1/8] ibmveth: Prepare MQ RX adapter data structures Mingming Cao
2026-11-19  0:07 ` [PATCH net-next 2/8] ibmveth: Refactor RX resource allocation for MQ RX bring-up Mingming Cao
2026-11-23  1:06   ` netdev-bot+sashiko
2026-11-19  0:07 ` [PATCH net-next 3/8] ibmveth: Refactor buffer pool management for per-queue MQ RX Mingming Cao
2026-11-19  0:07 ` [PATCH net-next 4/8] ibmveth: Refactor RX interrupt control for MQ RX queues Mingming Cao
2026-11-23  1:06   ` netdev-bot+sashiko
2026-11-19  0:07 ` [PATCH net-next 5/8] ibmveth: Refactor TX resource allocation in open/close paths Mingming Cao
2026-11-23  1:06   ` netdev-bot+sashiko
2026-11-19  0:07 ` [PATCH net-next 6/8] ibmveth: Add RX queue register helpers for MQ Mingming Cao
2026-11-23  1:06   ` netdev-bot+sashiko
2026-11-19  0:07 ` [PATCH net-next 7/8] ibmveth: Pass the RX queue index through replenish and poll Mingming Cao
2026-11-23  1:06   ` netdev-bot+sashiko
2026-11-19  0:07 ` [PATCH net-next 8/8] ibmveth: Split RX poll into per-slot helpers for MQ Mingming Cao
2026-11-23  1:06   ` netdev-bot+sashiko [this message]

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=179539597459.3135.8252131963439580422@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bjking1@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=davem@davemloft.net \
    --cc=davemarq@linux.ibm.com \
    --cc=edumazet@kernel.org \
    --cc=haren@linux.ibm.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mmc@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=nnac123@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=ricklind@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=shaik.abdulla1@ibm.com \
    --cc=sshegde@linux.ibm.com \
    /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