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