mirror of https://lore.kernel.org/lkml/
 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>,
	"Fijalkowski, Maciej" <maciej.fijalkowski@intel.com>,
	"andre.guedes@intel.com" <andre.guedes@intel.com>,
	"jithu.joseph@intel.com" <jithu.joseph@intel.com>,
	"vedang.patel@intel.com" <vedang.patel@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 v2] igc: return XSK frame copies on XDP_TX failure
Date: Sat, 28 Nov 2026 22:54:02 +0200	[thread overview]
Message-ID: <04253009-c56b-40c2-a418-a1a694210f73@intel.com> (raw)
In-Reply-To: <CH3PR11MB566895B48741E76FDC7D8BF14DE56F2@CH3PR11MB566895.namprd11.prod.outlook.com>



On 28/10/2026 20:31, Loktionov, Aleksandr wrote:
> 
> 
>> -----Original Message-----
>> From: Paul Moses <p@1g4.org>
>> Sent: Wednesday, October 28, 2026 9:50 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; Fijalkowski,
>> Maciej <maciej.fijalkowski@intel.com>; andre.guedes@intel.com;
>> jithu.joseph@intel.com; vedang.patel@intel.com; linux-
>> kernel@vger.kernel.org; bpf@vger.kernel.org; stable@vger.kernel.org
>> Subject: [PATCH net v2] igc: return XSK frame copies on XDP_TX failure
>>
>> Converting an XSK buffer to an XDP frame allocates a page and returns
>> the original buffer to its pool. If the TX ring is full or DMA mapping
>> fails, igc_xdp_xmit_back() returns an error without freeing the copy.
>> The RX cleaner cannot release it, so the page leaks.
>>
>> Return the copied frame on TX failure. Use the RX memory type so native
>> frames remain RX-owned on failure.
>>
>> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Paul Moses <p@1g4.org>
>> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>> ---
>> v1..v2
>> - Sort declarations
>> - Update the description to match the initialization order
>>
>> v1: https://lore.kernel.org/all/20261023141317.3904442-1-p@1g4.org/
>>
>> v1 testing:
>> Tested on Intel I225-V with baseline and patched kernels. Physical
>> pause-frame backpressure caused 46 leaked copies on the baseline.
>> With the fix, all 72 rejected copies were returned once and freed, and
>> all 192 copies were accounted for.
>>
>>   drivers/net/ethernet/intel/igc/igc_main.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c
>> b/drivers/net/ethernet/intel/igc/igc_main.c
>> index 1fb5f3cbe..d10dfbdb1 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_main.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
>> @@ -2488,6 +2488,7 @@ struct igc_ring *igc_get_tx_ring(struct
>> igc_adapter *adapter, int cpu)  static int igc_xdp_xmit_back(struct
>> igc_adapter *adapter, struct xdp_buff *xdp)  {
>>   	struct xdp_frame *xdpf = xdp_convert_buff_to_frame(xdp);
>> +	enum xdp_mem_type mem_type = xdp->rxq->mem.type;
>>   	int cpu = smp_processor_id();
>>   	struct netdev_queue *nq;
>>   	struct igc_ring *ring;
>> @@ -2504,6 +2505,10 @@ static int igc_xdp_xmit_back(struct igc_adapter
>> *adapter, struct xdp_buff *xdp)
>>   	txq_trans_cond_update(nq);
>>   	res = igc_xdp_init_tx_descriptor(ring, xdpf);
>>   	__netif_tx_unlock(nq);
>> +
>> +	if (res && mem_type == MEM_TYPE_XSK_BUFF_POOL)
>> +		xdp_return_frame(xdpf);
>> +
>>   	return res;
>>   }
>>
>> --
>> 2.56.GIT
>>
> 
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Moriya Kadosh <moriyax.kadosh@intel.com>

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28  8:50 Paul Moses
2026-10-28  8:55 ` netdev-bot+sinfo
2026-10-28 18:31 ` Loktionov, Aleksandr
2026-11-28 20:54   ` 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=04253009-c56b-40c2-a418-a1a694210f73@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=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

all inboxes | Powered by JetHome®