Netdev List
 help / color / mirror / Atom feed
From: "Kadosh, MoriyaX" <moriyax.kadosh@intel.com>
To: "Loktionov, Aleksandr" <aleksandr.loktionov@intel.com>,
	Paul Moses <p@1g4.org>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@kernel.org" <edumazet@kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"ast@kernel.org" <ast@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"hawk@kernel.org" <hawk@kernel.org>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	"sdf@fomichev.me" <sdf@fomichev.me>,
	"vedang.patel@intel.com" <vedang.patel@intel.com>,
	"jithu.joseph@intel.com" <jithu.joseph@intel.com>,
	"Fijalkowski, Maciej" <maciej.fijalkowski@intel.com>,
	"andre.guedes@intel.com" <andre.guedes@intel.com>,
	"Dahan, AvigailX" <avigailx.dahan@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH net v3 2/2] igc: fix AF_XDP receive buffer size for 2K UMEM chunks
Date: Sat, 28 Nov 2026 22:55:12 +0200	[thread overview]
Message-ID: <455f4268-2808-4437-81dc-fb59dc94336b@intel.com> (raw)
In-Reply-To: <CH3PR11MB566895FDA70020EC1BC59BD531E56E2@CH3PR11MB566895.namprd11.prod.outlook.com>



On 29/10/2026 10:09, Loktionov, Aleksandr wrote:
> 
> 
>> -----Original Message-----
>> From: Paul Moses <p@1g4.org>
>> Sent: Wednesday, October 28, 2026 9:35 AM
>> To: intel-wired-lan@lists.osuosl.org
>> Cc: netdev@vger.kernel.org; Nguyen, Anthony L
>> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
>> <przemyslaw.kitszel@intel.com>; andrew+netdev@lunn.ch;
>> davem@davemloft.net; edumazet@kernel.org; kuba@kernel.org;
>> pabeni@redhat.com; ast@kernel.org; daniel@iogearbox.net;
>> hawk@kernel.org; john.fastabend@gmail.com; sdf@fomichev.me;
>> vedang.patel@intel.com; jithu.joseph@intel.com; Fijalkowski, Maciej
>> <maciej.fijalkowski@intel.com>; andre.guedes@intel.com; Loktionov,
>> Aleksandr <aleksandr.loktionov@intel.com>; Dahan, AvigailX
>> <avigailx.dahan@intel.com>; linux-kernel@vger.kernel.org;
>> bpf@vger.kernel.org; stable@vger.kernel.org
>> Subject: [PATCH net v3 2/2] igc: fix AF_XDP receive buffer size for 2K
>> UMEM chunks
>>
> nit: Perhaps use "2 KiB" instead of "2K" here, as the latter does not
> specify the unit.
> 
>> From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>>
>> SRRCTL.BSIZEPKT has a granularity of 1 KiB. With a 2 KiB UMEM chunk and
>> the default XDP headroom, xsk_pool_get_rx_frame_size() returns 1792.
>> Programming this value truncates the hardware receive buffer size to 1
>> KiB, even though an MTU-sized frame fits in the usable UMEM area.
>>
>> XDP on igc is limited to MTU 1500, so configure a 2 KiB receive buffer
>> for XSK rings. Limit RLPML to the maximum supported Ethernet frame size
>> while XDP is attached, regardless of PAGE_SIZE, to avoid oversized
>> frames spanning descriptors or exceeding the usable UMEM space.
>>
>> RLPML is currently programmed from igc_set_rx_mode(), which can run
>> without RTNL, for example on an IPv6 multicast join, and could then use
>> a stale XDP state. RLPML does not depend on the address lists.
>> Program it from igc_setup_rctl() instead, next to RCTL.LPE, and from
>> igc_xdp_set_prog() while the rings are disabled. This avoids
>> netif_addr_lock_bh() usage.
>>
>> Validate that the XSK frame size accommodates a maximum-size frame with
>> two VLAN tags, FCS and the optional inline RX timestamp. Check against
>> the maximum supported XDP MTU, rather than the current MTU, which can
>> change after the socket is bound.
>>
>> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
>> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>> Signed-off-by: Paul Moses <p@1g4.org>
>> ---
>>   drivers/net/ethernet/intel/igc/igc.h      |  1 +
>>   drivers/net/ethernet/intel/igc/igc_main.c | 33 +++++++++++++++++------
>> drivers/net/ethernet/intel/igc/igc_xdp.c  | 11 +++++---
>>   3 files changed, 33 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igc/igc.h
>> b/drivers/net/ethernet/intel/igc/igc.h
>> index 17f213cc9..ad1062f85 100644
>> --- a/drivers/net/ethernet/intel/igc/igc.h
>> +++ b/drivers/net/ethernet/intel/igc/igc.h
>> @@ -765,6 +765,7 @@ static inline s32 igc_read_phy_reg(struct igc_hw
>> *hw, u32 offset, u16 *data)
>>   	return -EOPNOTSUPP;
>>   }
>>
>> +void igc_set_rlpml(struct igc_adapter *adapter);
>>   void igc_reinit_locked(struct igc_adapter *);  struct igc_nfc_rule
>> *igc_get_nfc_rule(struct igc_adapter *adapter,
>>   				      u32 location);
>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c
>> b/drivers/net/ethernet/intel/igc/igc_main.c
>> index 41b293dc1..6b418dc71 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_main.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
>> @@ -674,8 +674,11 @@ static void igc_configure_rx_ring(struct
>> igc_adapter *adapter,
>>   	ring->next_to_clean = 0;
>>   	ring->next_to_use = 0;
>>
> 
> Also, below:
> 
>> +	/* igc's XDP limits MTU to 1500; all XSK RX buffers can use 2kb;
>> +	 * RLPML limits the receive length to fit after UMEM headroom.
>> +	 */
> 
> "2kb" normally means 2 kilobits, whereas the buffer size here is
> 2048 bytes. I suggest using "2 KiB" consistently in the subject,
> commit message, and comments.
> 
> ...
> 
> Also, below:
> 
>> +	/* igc's XDP currently does not support jumbo frames. Limit the
>> +	 * accepted packet size regardless of PAGE_SIZE so it fits in a
>> 2kb
>> +	 * XSK chunk.
>> +	 */
>> +	if (igc_xdp_is_enabled(adapter))
>> +		rlpml = ETH_FRAME_LEN + VLAN_HLEN * 2 + ETH_FCS_LEN;
>> +
>> +	wr32(IGC_RLPML, rlpml);
>> +}
>> +
> 
> 
> Otherwise, looks fine for me
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Moriya Kadosh <moriyax.kadosh@intel.com>

      reply	other threads:[~2026-11-28 20:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28  8:34 [PATCH net v3 0/2] igc: fix RX timestamp handling and AF_XDP buffer sizing Paul Moses
2026-10-28  8:35 ` [PATCH net v3 1/2] igc: only strip RX timestamp header from first buffer Paul Moses
2026-10-29 23:37   ` netdev-bot+sashiko
2026-10-30 11:45     ` Maciej Fijalkowski
2026-10-30 16:47       ` Paul Moses
2026-10-30 19:00         ` Maciej Fijalkowski
2026-10-28  8:35 ` [PATCH net v3 2/2] igc: fix AF_XDP receive buffer size for 2K UMEM chunks Paul Moses
2026-10-29  8:09   ` Loktionov, Aleksandr
2026-11-28 20:55     ` Kadosh, MoriyaX [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=455f4268-2808-4437-81dc-fb59dc94336b@intel.com \
    --to=moriyax.kadosh@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andre.guedes@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=avigailx.dahan@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hawk@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jithu.joseph@intel.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=p@1g4.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sdf@fomichev.me \
    --cc=stable@vger.kernel.org \
    --cc=vedang.patel@intel.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