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: <90721496-8458-4c57-9d1c-2f2bb4f4325f@intel.com>
Date: Thu, 10 Jul 2025 15:43:20 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Michal Kubiak <michal.kubiak@...el.com>,
	<intel-wired-lan@...ts.osuosl.org>
CC: <maciej.fijalkowski@...el.com>, <aleksander.lobakin@...el.com>,
	<larysa.zaremba@...el.com>, <netdev@...r.kernel.org>,
	<przemyslaw.kitszel@...el.com>, <anthony.l.nguyen@...el.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next 0/3] ice: convert Rx path to
 Page Pool



On 7/7/2025 4:36 PM, Jacob Keller wrote:
>> I tried to apply these and test them, but I ran into several issues :(
>>
>> The iperf3 session starts with some traffic and then very quickly dies
>> to zero:
>>
>>> [  5]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec
>>> [  8]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 10]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 12]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 14]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec
>>> [SUM]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec
>>> - - - - - - - - - - - - - - - - - - - - - - - - -
>>> [  5]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec
>>> [  8]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 10]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 12]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 14]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec
>>> [SUM]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec
>>> - - - - - - - - - - - - - - - - - - - - - - - - -
>>> [  5]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec
>>> [  8]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 10]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 12]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 14]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec
>>> [SUM]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec
>>> - - - - - - - - - - - - - - - - - - - - - - - - -
>>> [  5]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec
>>> [  8]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 10]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 12]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 14]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec
>>> [SUM]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec
>>> - - - - - - - - - - - - - - - - - - - - - - - - -
>>> [  5]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec
>>> [  8]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 10]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 12]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec
>>> [ 14]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec
>>> [SUM]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec
>>> - - - - - - - - - - - - - - - - - - - - - - - - -
>>> [  5]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec
>>> [  8]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec
>>> [ 10]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec
>>> [ 12]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec
>>> [ 14]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec
>>> [SUM]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec
>>

I got this to work with the following diff:

diff --git i/drivers/net/ethernet/intel/ice/ice_txrx.h
w/drivers/net/ethernet/intel/ice/ice_txrx.h
index 42e74925b9df..6b72608a20ab 100644
--- i/drivers/net/ethernet/intel/ice/ice_txrx.h
+++ w/drivers/net/ethernet/intel/ice/ice_txrx.h
@@ -342,7 +342,6 @@ struct ice_rx_ring {
        struct ice_tx_ring *xdp_ring;
        struct ice_rx_ring *next;       /* pointer to next ring in
q_vector */
        struct xsk_buff_pool *xsk_pool;
-       u32 nr_frags;
        u16 rx_buf_len;
        dma_addr_t dma;                 /* physical address of ring */
        u8 dcb_tc;                      /* Traffic class of ring */
diff --git i/drivers/net/ethernet/intel/ice/ice_txrx.c
w/drivers/net/ethernet/intel/ice/ice_txrx.c
index 062291dac99c..403b5c54fd2a 100644
--- i/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ w/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -831,8 +831,7 @@ static int ice_clean_rx_irq(struct ice_rx_ring
*rx_ring, int budget)

                /* retrieve a buffer from the ring */
                rx_buf = &rx_ring->rx_fqes[ntc];
-               if (!libeth_xdp_process_buff(xdp, rx_buf, size))
-                       break;
+               libeth_xdp_process_buff(xdp, rx_buf, size);

                if (++ntc == cnt)
                        ntc = 0;
@@ -852,25 +851,18 @@ static int ice_clean_rx_irq(struct ice_rx_ring
*rx_ring, int budget)

                xdp->data = NULL;
                rx_ring->first_desc = ntc;
-               rx_ring->nr_frags = 0;
                continue;
 construct_skb:
                skb = xdp_build_skb_from_buff(&xdp->base);
+               xdp->data = NULL;
+               rx_ring->first_desc = ntc;

                /* exit if we failed to retrieve a buffer */
                if (!skb) {
-                       rx_ring->ring_stats->rx_stats.alloc_page_failed++;
-                       xdp_verdict = ICE_XDP_CONSUMED;
-                       xdp->data = NULL;
-                       rx_ring->first_desc = ntc;
-                       rx_ring->nr_frags = 0;
+                       rx_ring->ring_stats->rx_stats.alloc_buf_failed++;
                        break;
                }

-               xdp->data = NULL;
-               rx_ring->first_desc = ntc;
-               rx_ring->nr_frags = 0;
-
                stat_err_bits = BIT(ICE_RX_FLEX_DESC_STATUS0_RXE_S);
                if (unlikely(ice_test_staterr(rx_desc->wb.status_error0,
                                              stat_err_bits))) {


--->8---

The essential change is to not break if libeth_xdp_process_buff returns
false, since we still need to move the ring forward in this case, and
the usual reason it returns false is the zero-length descriptor we
sometimes get when using larger MTUs.

I also dropped some of the updates and re-ordered how we assign
xdp->data, and fixed the bug with the ring stats using alloc_page_failed
instead of alloc_buf_failed like we should have. I think this could be
further improved or cleaned up, but might be better to wait until the
full usage of the XDP helpers.

Regardless, we need something like this to fix the issues with larger MTU.


Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ