From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.169 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== 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== 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 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 ; Mon, 30 Nov 2026 04:34:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B5C0E606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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-Envelope-To: netdev@vger.kernel.org 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 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 Date: Mon, 30 Nov 2026 12:34:27 +0800 From: Hangbin Liu To: Jay Vosburgh , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Nikolay Aleksandrov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH net-next v2] bonding: check XDP support before enslaving changes state Message-ID: References: <20261127-bond_xdp_fix-v2-1-1e05818a41ef@kylinos.cn> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261127-bond_xdp_fix-v2-1-1e05818a41ef@kylinos.cn> On Fri, Nov 27, 2026 at 02:37:28PM +0800, Hangbin Liu wrote: > From: Hangbin Liu > > 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 > --- > 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