From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796161096; b=mY6pL0dudJ0oTYrgNd7BfJcB2GqtZQSOISysxsdnP7raHg6phY65D0JbzO/OJcuta3ZQ MfYpI/92hvzCr99PSPNtwBwXkAlQaQf2xAuODeeYX3bbO9FJvbTrtK3FyRbCM0HnfdwD5 IqmRMvoQBcwzLMbXjx/s9MBQc7oN6jXSkOEPtWDiz+nDLjX3lTC0k9lMcBgHmajBHfdby I/xo+SxQ92SMMIEbOgrihTrJFHetMvH+iNtM2KZwvcjZGmMTQzmA2qxy8Y2c08PJuJFCr o8h34o+Kxr9gA2FTNrmPYmdW1yisHEBzdjbwlQ2gjpb5LrGMEBlgAKwVGcdqKCl+UwA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796161096; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=qtDJApcT9uMjAGTduwQ5DGrbPnt9chxocSrOmIhQdUk=; b=Uu9xaPrJ40ZHWWGbDOIXYzNSV5UjfDUWns7AYg5fjonCYnzJxWE5lqaKY6iFAtdfnTP3 DcB4JfyFGcrUr0rpDYYeqo+Zj6kALLcvEe3aLV0kpHS2AGvfQ106YFG5dFFobRv0SSATQ mWzRnTCewzaHmpb5hKdj0WDczsQG4Ytrt/otKjcDRRlLORSWVvBkj94HdIz+3vZf8aw0d iku2ik4vDuf/tRvO4dwmPhR8Ncu1Z/1828GwMmw2HSueHm1GZ9WtkKt+uHK9ZDEAU9qlE sog4teK57C8p1I8QxAzTKZKa9ueAJzlxEAclBizmiSBic3bcd7ifUPNPHLZlhvsAFJw== ARC-Authentication-Results: i=1; smtp.subspace.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=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9500606A320 for ; Tue, 1 Dec 2026 21:38:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; 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: 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 Reply-To: sashiko-reviews@lists.linux.dev 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-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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