Article View: linux.kernel.netdev
Article #24394Re: [PATCH net-next v2] bonding: check XDP support before enslaving changes state
From: Hangbin Liu
Date: Mon, 30 Nov 2026 04:34
Date: Mon, 30 Nov 2026 04:34
38 lines
9695 bytes
9695 bytes
On Fri, Nov 27, 2026 at 02:37:28PM +0800, Hangbin Liu wrote: > From: Hangbin Liu <liuhangbin@kylinos.cn> > > The XDP capability checks in bond_enslave() - ndo_bpf/ndo_xdp_xmit > presence and whether the slave already runs an XDP program - run only > after the slave has been opened, linked and published to the > datapath. On failure the slave may already be bond->curr_active_slave > or reachable through bond->slave_cnt and the upper device list, so a > lot of state has to be undone, and bond_xdp_xmit() can observe the > slave before its capability was ever verified. > > Move both checks into the validation section at the top of > bond_enslave(), before the first state change, so a rejected slave > returns directly with nothing mutated. bond_xdp_set() repeats the > same two checks for every slave, so factor them into a common > bond_slave_xdp_check() helper used by both paths. > > Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn> > --- > For Sashiko: > > please ignore the bond's promiscuity/allmulti/ns maddrs leak issue > when xdp setup failed. It will be addressed in another patch. > > please ignore the no unwind for bond_3ad_bind_slave if > dev_xdp_propagate failed. It will be addressed in another patch. > --- > Changes in v2: > - move the duplicate checking in bond_xdp_set to the new check function. > - Move the bond_xdp_xmit() fix in another patch and target to net (sashiko) > - Link to v1: https://patch.msgid.link/20261124-bond_xdp_fix-v1-1-e67983924324@kylinos.cn > --- Patch doesn't apply to latest net-next due to recent 802.3ad update. I will rebase the code and repost a new version. --- pw-bot: cr
Technical Details
Message-ID:
<awz80xvZeZK1PQpN@fedora>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373868-linux-kernel-netdev=dewy.ruReferences:
<20261127-bond_xdp_fix-v2-1-1e05818a41ef@kylinos.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373868-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2] bonding: check XDP support before enslaving changes state Date: Mon, 30 Nov 2026 12:34:27 +0800 Organization: Usenet Network Message-ID: <awz80xvZeZK1PQpN@fedora> References: <20261127-bond_xdp_fix-v2-1-1e05818a41ef@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1333412"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:IKtvnrdgCOUY2lj1tlrUNNSOTfw= sha256:rktwt/wBzWF//ABVDZRl2GH0ouY7wNzMxYqtyy+nQZQ= sha1:lbbgwYiLWr13cSRSe7gz9NqUjUY= sha256:QFcSJVGIvx0bEh1seQyf/T7GtADY9GAiCOewTv5LKBI= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 9C1C5125FBC; Mon, 30 Nov 2026 07:35:03 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pjlyq5ea1hYX; Mon, 30 Nov 2026 07:34:55 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373868-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 32E2C125FC0; Mon, 30 Nov 2026 07:34:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 3C67F28AAE; Mon, 30 Nov 2026 04:34:42 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796013281; b=oZUgqNHaJWoBCB2/5pnl3/qFFsdwt+Ju0OOzT8p7tkcqhxz9U7pj+s84+COgAG65IjLw PaGtQ0wgbR9jm83sENXaydxS17fHqvOUJ5DamLb01tXNbEuI84eSNHr258Rl0QW8GC1y2 +DFrUXncnim7xu/tdbZVExFkxI/++MXUc4jgkTmbD3sFuWjFe8ahISdrV3ziZIUu/7Tpl REbNrhmhXhqRM/w/XcYj1RHgkIX1zjUezgeJyHqEgVCUNQT7E2M2CdeF9J+ghdIjrCXm1 u0dLy8KKNHH8uLaoCfuzBLg3OFVnoWf9E5MnKCLr/GVk/uJHqplmPXN8K7o06M/nWcA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796013281; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=3UYm6L97WiG4/sOrCa38d1+XzZbLjtCMJh8nv2u4zeE=; b=2Q4emaRy9fBOLeAORkTubrepTJxno1iRqDDqlYnOspd4Y+GcN8XJk7c/T/r2IYaYnZp4 DvaPbayVCLc1ifbzQfVBLkS3z4D9PZT712ailuJBFf2KdemBPrGO22qUQIC+RmnGYJ6ln UdiAI3ArmODzu3mhiFZIfmvxgsqth6mtRy2TxTTShF6HjbhVpbMGmhHLTc4Ct0k7kbDHf F+IwHP5HaZDdOvJaamvsjDIHtmNq3TPZQSNFKpxqMsA01Kw48IkpndgBUf7uDaEx95U6Y 1SKJuqjVw9tdk0Fo4qiXuMw+5QmMbmLbwtXYlQd2hTqEfm2pf8nEyphqaJRWGdqHakg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=mdoFcVRu; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5353606A33E; Mon, 30 Nov 2026 04:34:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=mdoFcVRu X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.169 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796013280; b=OWKvNSHeW7aFBw4kxcBzKXjwHF6ZczaAdsQONQ7wDa4iyPNCOGGFCRdQS/ypz5TAtJdJ Zm0rUSk0mUcW8vosJM0bCqfuK7redODBhITdsaygYwnBuOflcDHw9/txP9CgWtE7cfHer 8zwr6tDHKOgDTqoGKHkrFOmjJa7C0aOTB9NEIhxe2JyTLvXPnw8zD3tshbxau+SxPkkU4 jTBErbVnKOPecr4B1fUyqr4/jCg04QKSWBKITJpt4ahfF2MhIoYs70VotDeCzdnL/mtY1 OvQx50exzCOvfcWJpJIn2aCOjBUcNnBz3UppkDcOsfUgV37TyGznrmACsk//jzrhOoQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796013280; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=3UYm6L97WiG4/sOrCa38d1+XzZbLjtCMJh8nv2u4zeE=; b=XFK+XdxGsEUuik2Y4hsczM+nIkKiVbUcxgINWXbB659nOwGkLYzw0dnOmfPL0f2fuFkq oVyGir6NU09UYV90wAy0+DL8BHMy1L2GoQxGJCb3Y7aI/DOJiEylOCUXSx1PJeoB9jJa8 P4SKeUnbM1jxymF/3nfNae1OlV2tRf21Q/1zalFVdhK/RL7fCceOsg7brI2tEfezgGwYj jV/X1P+PofDwhkBX58sesJBvwUhxn//HRNsoQuLlpB3I3GFZV5bEWQ54PL4iSZ/xorrYK q4kU87jlmy90KWtHpG7UpXIzi0asQHkQu6A8CkDlFFBd4l27CcESXyo9qee0VMrzERg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=mdoFcVRu; arc=none smtp.remote-ip=95.215.58.169 X-Received: from mta1.migadu.com (out-169.mta1.migadu.com [95.215.58.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5C0E606A32E for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 04:34:38 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B5C0E606A32E X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=BwwYiFebuwXuIZ/ovDQDKB4z/tfliAStAKvMVoKvF4Y=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796013276; v=1; x=1796618076; b=mdoFcVRu/j/8Wv38wbAu1So+Ovfhxre4QDXWIE2fMyQ7nhBkFklQO2uscpD2yDrXN3gjn649 7WJYTmV/oLeYuwjeACJX/rwYM8vr4Ld1NAAU7ect4DZc7WakxWhvN3ZoXN/rHBoF/RynT58aicH HGwg2f4YVrVbvupHJbRWcU0I= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta12.migadu.com with ESMTPS id 3a63024b67896a95; Mon, 30 Nov 2026 04:34:36 +0000 X-Mizu-Trace-ID: 3a63024b67896a95 X-Migadu-Flow: FLOW_OUT X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261127-bond_xdp_fix-v2-1-1e05818a41ef@kylinos.cn>