From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 178E7606A320 for ; Tue, 1 Dec 2026 21:38:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=zrQhZKIM; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gH/i9AeX Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E7C4A80F38; Tue, 1 Dec 2026 21:38:22 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UwdZMO6nJTiZ; Tue, 1 Dec 2026 21:38:22 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org 0DAF980F42 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796161102; b=eUPw02A4Ef+uOUGQL1gE0OAfXFEz5LQsPm0TPerviziDPqOoD1uLcc0ZeFDFCjxxzKqw aJEJYfOYLswRcGhHX1f34EgJi5T270SA5jGXUZqPe9KfqIxooMAkkNi6f+P9N+CJh8WiQ 2xWtWXWC1o+bkiLl7/FxqcQAf7ijvc+ehBmdvT0icBfH2Tv51fKowxW5pk7qYz6vci6RX jn/0bscQBnLtQtVigYULgz9C/Q183JrjR65Qeii9qqRL4Y/rJF+hDvJB57cIdriI1EkzS zRID900HZMAPBZPgrzP4S8E53LF4DEocc+G6G4+TuvYQQ7ZQOUBcSLDlQRcOzzGkRLA== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796161102; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: Received:DKIM-Signature:Message-ID:From:Subject:To:Cc:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:Date:X-BeenThere: X-Mailman-Version:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Reply-To:Errors-To; bh=qtDJApcT9uMjAGTduwQ5DGrbPnt9chxocSrOmIhQdUk=; b=dHCSQGMBrhLbxO+AfsH2jxrgdhnYc6JY4sgQJD0KVPPH4RIpckdTDyyAWFdsZb/Z5ncI pDSbnbDzmDG2GMWq2xmjwlAIhvss9OZx0CF3OIlX08xFGkflAQ/Bhz7Npsb0Q5M75rVYd dde+87Onkcb6emNSo/dsQq7rVgfJkwFvDrprrLEZI0WXYANY7/ovftQmthmxVBLLCdhCe xlx6xDUMXRv6Ew+9RM723Ru2b0hve6jzlikEu5qxdWHQ5tv+e8hQKYmL/gIQgwhhDLAzf DQIwcoMFwPkzURjh2PJbXDatw5O9Z+TPYom6L1bm/8PZ38wK5M+ojRnRBCX3ZB6eaow== ARC-Authentication-Results: i=1; smtp1.osuosl.org; dmarc=pass header.from=kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="gH/i9AeX"; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1796161102; bh=qtDJApcT9uMjAGTduwQ5DGrbPnt9chxocSrOmIhQdUk=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Reply-To:From; b=zrQhZKIMXpx4LxfHsVNZ+9LoMlRw4vHkE3NwzlM/G29b7cx0vKFluPfxp93sOXA1d U2g8lBXoF5MAd81HRQ6R3s+3/YlwdwczRX2IcpYoFX+sevVU7mW3eTKLP4rwutTmoi 1nrTto1FzMj5oXcFM5H8Vol1BljtAZWBdfNxqhHEwsekoCLqbiNIUd3zqHukNxYbBN A1irT9Qw+lplACQIMDtDe40z4HYN3oxLp8MIDlgT5vOkWL5zOymyoVhKn9AwMdad23 yr4j7+A9qoaJ5ZL+OEIsR3eKe2SQ1jByKeQPp2CRXoYHrwZCkN0AZbXOL6WQsEMvOg CqT2acpwITl6Q== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 0DAF980F42; Tue, 1 Dec 2026 21:38:22 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 1C1C9AFC for ; Tue, 1 Dec 2026 21:38:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0D7B6808A9 for ; Tue, 1 Dec 2026 21:38:20 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 96X7B8zUim1d for ; Tue, 1 Dec 2026 21:38:19 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org F2FB980847 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=172.105.4.254 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.4.254; helo=tor.source.kernel.org; envelope-from=sashiko-bot@kernel.org; receiver= Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gH/i9AeX Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by smtp1.osuosl.org (Postfix) with ESMTPS id F2FB980847 for ; Tue, 1 Dec 2026 21:38:18 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 9BEB1613A3; Tue, 1 Dec 2026 21:38:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32E261F00899; Tue, 1 Dec 2026 21:38:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796161096; bh=qtDJApcT9uMjAGTduwQ5DGrbPnt9chxocSrOmIhQdUk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=gH/i9AeXD2DbedGbPh6yB7UdM41DcR4Y8mJ+kDj5sBrFJXpqZMx13ha8/WUR2ffYA JAUdQYBkdoixTUssx9ZT5ANBHaNLZ9m9jp+8Bkkx7PRhdMOlx+nkp7qQvejFqseqS9 FXAlkBaKIH11dxiolyc0RE8+AKLMSfPBZEyKsaB3d5aba6fhz0qSBapRVGQykgx78K Fazbt8Ylt36pJ9NsKv6Okcd1/7S+0r7XVrm+igMIQ+vnSPD6SOJF3lccAbgJstoj61 N5lgPCkgy7Ctvc18b+d7GXWLv+O3MQxtSy6COtJKm8cMyyqKyLucF5u/Jk7o6Vom8K T5pBSRvxsJKxQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net v6 6/7] igb: resume the device before changing XDP or XSK settings To: "Antonio Quartulli" , intel-wired-lan@lists.osuosl.org Cc: bpf@vger.kernel.org In-Reply-To: <20261130213740.3323814-7-antonio@mandelbit.com> References: <20261130213740.3323814-1-antonio@mandelbit.com> <20261130213740.3323814-7-antonio@mandelbit.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 21:38:15 +0000 X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] igb: broken failed-resume and 3K-buffer checks in igb_xdp_setup() -- commit 7c39c9b9bbe9f71a6d6b0fe773ef6680942f2a1f Author: Antonio Quartulli igb: resume the device before changing XDP or XSK settings This commit resumes the device across igb_xdp() via pm_runtime_get_sync() and handles failed resumes in igb_xdp_setup() and the XSK pool setup paths. > diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethe= rnet/intel/igb/igb_main.c > index 11c136d7bea75..79652ccbfdf00 100644 > --- a/drivers/net/ethernet/intel/igb/igb_main.c > +++ b/drivers/net/ethernet/intel/igb/igb_main.c > @@ -2909,6 +2909,16 @@ static int igb_xdp_setup(struct net_device *dev, s= truct netdev_bpf *bpf) > } > } > =20 > + /* After a failed resume the device is detached and its rings have no > + * resources: only update the software state, and don't add a program > + */ > + if (running && !netif_device_present(dev) && > + (!adapter->num_rx_queues || !adapter->rx_ring[0]->desc)) { > + if (prog && !adapter->xdp_prog) > + return -ENODEV; > + running =3D false; > + } > + > old_prog =3D xchg(&adapter->xdp_prog, prog); > need_reset =3D (!!prog !=3D !!old_prog); [Severity: Medium] Can this failed-resume check miss detached devices when !running, or be blocked from removing an XDP program by the earlier igb_rx_bufsz() check? __igb_shutdown() detaches the netdev and calls igb_clear_interrupt_scheme(), which frees all rings and zeroes adapter->num_rx_queues even when the interface is down. If resuming fails while !running (or the interface is brought down after a failed resume), gating this check on running lets a new XDP program be attached on a detached device and skips the frame_size > igb_rx_bufsz(ring) loop completely when adapter->num_rx_queues is 0. igb_xsk_pool_enable() similarly gates its !adapter->rx_ring[qid]->desc check on netif_running(netdev) instead of !netif_device_present(netdev). Conversely, IGB_RING_FLAG_RX_3K_BUFFER is only set on rx_ring during igb_configure_rx() in __igb_open(), not when igb_init_interrupt_scheme() allocates the rings: drivers/net/ethernet/intel/igb/igb_main.c:igb_set_rx_buffer_len() { ... if (adapter->max_frame_size > IGB_MAX_FRAME_BUILD_SKB || IGB_2K_TOO_SMALL_WITH_PADDING || rd32(E1000_RCTL) & E1000_RCTL_SBP) set_ring_uses_large_buffer(rx_ring); ... } If an XDP program was attached with a frame_size requiring 3K buffers (2048= < frame_size <=3D 3072) and __igb_resume() later allocates fresh rings in igb_init_interrupt_scheme() without reaching igb_configure_rx() (because __igb_open() fails when allocating ring resources, or the interface is down), igb_rx_bufsz(ring) returns 2048 and the loop above returns -EINVAL before reaching the failed-resume check, preventing removal or replacement of the program and leaking old_prog. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130213740.3323= 814-1-antonio@mandelbit.com?part=3D6