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 CF66340DFA3; Sat, 28 Mar 2026 00:12:22 +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=1774656742; cv=none; b=a4qNlQECKEN7V/WEuaoQnyCArMgePRgf5V1WZpz252tjQvn63FDfmGWDeDQ4G3XCJ71hgUAThgkfQXkLAyty18TQqZKoIGkirU8+Rd6SW+juMz7+gJQ7OMJSeVkZRutZiz5y9zRQ/Pozrp5vKzChcB+2uAsW5MsaQTEwfHapJ2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774656742; c=relaxed/simple; bh=xI4UmJEnokRASbJcfMS56GK0lMPnJmKS4svstiEkqQ4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a2UwDtvUktLwDZMbFxN8eHYpTqtN+rzRhCioVcsOVF9cU/6SqN7jUwZWSJBZ5eSxLl/YA8cOeKc62VLYbD3lOeBk7zvFTvOBPlowFX5zTTmJ6MELLMmKLY4PRMnhnjDbsbEmP4lJpr5q+oUNcXiHMpZXvE/02jQ48rXabIgZz+A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YG6yyyT/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YG6yyyT/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97597C19423; Sat, 28 Mar 2026 00:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774656742; bh=xI4UmJEnokRASbJcfMS56GK0lMPnJmKS4svstiEkqQ4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YG6yyyT/teC+XVHylGg9uEGmj9oNdUXrQXFAxZkU134QrjTqNT6dcPvsxALiLiAjw sEDGzZImGyYamQ9V4erm/hxnYgLYNv+sra22wk/Kicxw4Y/sqBJK4HMIw79yRJUL4W flC0wEClK7JdJ4i1joKF3EiEmJkBM12BdLS9XSIYzyZDoXjihT8jn4pl045bhovY8n sb/Bpeo3qHlSDGLYVbvq9yj/EH1b22lad4kU7PbTGTIMVDmDG93wrycitv74Zoohxp YHCnGcAOu0dYJlXD1gOhlAwtNhDdM3qqq1ZcT/S+ms6BJ2Xsfl/FqzFFHwzb3ibcvp NTvju/PDEfw7w== Date: Fri, 27 Mar 2026 17:12:20 -0700 From: Jakub Kicinski To: Leon Hwang Cc: bpf@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , "David S . Miller" , Jesper Dangaard Brouer , Toke Hoiland-Jorgensen , Lorenzo Bianconi , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, kernel-patches-bot@fb.com Subject: Re: [PATCH bpf-next 1/3] bpf: Disallow freplace on XDP with mismatched xdp_has_frags values Message-ID: <20260327171220.6d10d710@kernel.org> In-Reply-To: <785e0b04-91e4-457f-8d6c-e0a911c0fd88@linux.dev> References: <20260324150444.68166-1-leon.hwang@linux.dev> <20260324150444.68166-2-leon.hwang@linux.dev> <20260326124205.1a3bb825@kernel.org> <785e0b04-91e4-457f-8d6c-e0a911c0fd88@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 27 Mar 2026 14:42:19 +0800 Leon Hwang wrote: > > It may be worth adding a selftest to > > tools/testing/selftests/drivers/net/xdp.py > > which sets MTU to 9k, tries to attach a non-frag-capable prog > > if that fails attaches a frag-capable prog and then checks if > > replacing the capable prog with non-capable fails. > > Drivers may be buggy in this regard. > > Do you mean adding these two tests to xdp.py? > > 1. Verify the failure of attaching non-frag-capable prog to mtu=9k > driver. > 2. Verify the failure of updating frag-capable prog with non-frag- > capable prog via libbpf.c::bpf_link__update_program(). Not directly via libbpf just ip -f link, it uses libbpf internally but testing with ip link is simpler. Also - there are already XDP progs which return XDP_PASS in frag-capable and non-capable mode, so just use those. > As for test #2, it may require a helper to attach prog then update prog > using libbpf's APIs. See above.