From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4FA519A288; Fri, 24 Apr 2026 13:35:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037729; cv=none; b=YdGUo9g2taMkJO8lolddz7J1ylF8F+65uyB55Pu5CuhGVKOBfHOTh9qz7hVVL5PcpEd/EhGzgGM1O9UiWAobQ7tpj8fJ9TloBobE99QTGlMT21//5Fx+K2VNkhuDC4v6OysvKMxhYRjbdhHET34q3mlCN3rUd/yHIYO/KRm8Yqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037729; c=relaxed/simple; bh=GwvDlUz5wphDsEvEK0UBhl82wlVlHBxkXG7Tmgu4nek=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rJuZ2tNg97HB2D1ordvzG/xbdjPxgIuxxifb5qBWnniiKl22g1QLggB39QlUnKqlKbP33GbtDGoUDFG0R5fbGJ+FiT0cENBZUs4dbBHha7h+Xn5mYU5hSflmnfuZPANcWFMRgr9TdZBTgqglIEWOKgk7iBMH2RXu1TUfBUvWcec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cf/2gZqz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cf/2gZqz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3257BC19425; Fri, 24 Apr 2026 13:35:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777037729; bh=GwvDlUz5wphDsEvEK0UBhl82wlVlHBxkXG7Tmgu4nek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cf/2gZqzAayOJyyOSY/7FYmEbDpcTyAe0T+Aq0HzqZqGgk9pCtY6km811ucT90PuC hSRsWvT3Oh7MUelFqJChk0btLrXmKZ6+pQhK7xhi2Hsvz8tzOFG7jfYi4W5gdNnPIs oOmHU1Ci7oZRfW8Oey7pjdLS+1TnGvFuDtkzoQrg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Maciej Fijalkowski , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 046/166] xsk: fix XDP_UMEM_SG_FLAG issues Date: Fri, 24 Apr 2026 15:29:20 +0200 Message-ID: <20260424132542.450783298@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260424132532.812258529@linuxfoundation.org> References: <20260424132532.812258529@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maciej Fijalkowski [ Upstream commit 93e84fe45b752d17a5a46b306ed78f0133bbc719 ] Currently xp_assign_dev_shared() is missing XDP_USE_SG being propagated to flags so set it in order to preserve mtu check that is supposed to be done only when no multi-buffer setup is in picture. Also, this flag has the same value as XDP_UMEM_TX_SW_CSUM so we could get unexpected SG setups for software Tx checksums. Since csum flag is UAPI, modify value of XDP_UMEM_SG_FLAG. Fixes: d609f3d228a8 ("xsk: add multi-buffer support for sockets sharing umem") Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalkowski Link: https://patch.msgid.link/20260402154958.562179-4-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- include/net/xdp_sock.h | 2 +- net/xdp/xsk_buff_pool.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h index 660c22521a292..84ff9bb4bfae4 100644 --- a/include/net/xdp_sock.h +++ b/include/net/xdp_sock.h @@ -14,7 +14,7 @@ #include #include -#define XDP_UMEM_SG_FLAG (1 << 1) +#define XDP_UMEM_SG_FLAG BIT(3) struct net_device; struct xsk_queue; diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c index 6789d99fd99e0..52c4204bc224e 100644 --- a/net/xdp/xsk_buff_pool.c +++ b/net/xdp/xsk_buff_pool.c @@ -236,6 +236,10 @@ int xp_assign_dev_shared(struct xsk_buff_pool *pool, struct xdp_sock *umem_xs, return -EINVAL; flags = umem->zc ? XDP_ZEROCOPY : XDP_COPY; + + if (umem->flags & XDP_UMEM_SG_FLAG) + flags |= XDP_USE_SG; + if (umem_xs->pool->uses_need_wakeup) flags |= XDP_USE_NEED_WAKEUP; -- 2.53.0