Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1847735lql; Wed, 13 Mar 2024 09:43:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbVKxnKV23imeJB6Uc1n4U+lT1TmQnl7bMg7/pfQ4OYmvrmybxejcWg6KsSCK3ZvvZ45MlHM8LAq1hw02hjiSx2kTG4dV0aHu8lIr1+g== X-Google-Smtp-Source: AGHT+IHaVKlbBDU8SA0noVEms9033kM+NAB0AEITzybmJhzv57WS8sYG8d414XbrDy3BXf83QSBI X-Received: by 2002:a05:6358:6f8a:b0:17b:5661:5e2b with SMTP id s10-20020a0563586f8a00b0017b56615e2bmr541936rwn.18.1710348181029; Wed, 13 Mar 2024 09:43:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710348180; cv=pass; d=google.com; s=arc-20160816; b=lIoKErQ1qZhdBC1A8/bYMAI1ceA3l1jdLwCojaiWpIITHGJFu5FZeGoE+9KomujynE bCYKjnHUAC7Iy/NUK49knu96hJcigiGsh5p49hNrYf2ilKMNwK+odEeeRYzXrkFVTui5 NmHr7sdQJRGalKgyMVqOCGaxDQuWN8iO4wKzee4mOhT1cY829LXfZLgqXunAMpY3kE3I tcB9m1+qj6B0Q56wp0kvFWwotd8gy+r2D5QfMhpSGKhzW2hol/xIWmWfPmQ+AfpZ2VIP jNL94r6WWeVPZmo48iKHKbq82koWWlEdcsrzRfNbO3Mk0xCao6kR3WZWpdDRGkXai7Ux gx/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uD6ZXhdIuOOq0K0A7yX1YOS+ZdiaNbjt3wk4kAfPcfU=; fh=mEwjDS9sN4vTTGQbA51cVfFptuGiqkd96FYC4B4tm/s=; b=a3fJiu1ENb0QDOqDNAsj5/VwxcYvd6v3Z7jJWmXi9eluV4YZ0R99h9H3WS8dwueDkh NACx9C1HEkTSqfvxo0qjbkbrF7BxjGOPqxEcHAq6M7l6PG34b7j0qv7vb8D03EPhVyBu H3spGGTvsvz8Rg/GT4/rbZyzM5JBibpQoJZAQlPVWENG3VQYwG7LUUe3Jdz6xQPL5+E2 L/spJ7hBDKFThH5eLhLVJnAbQbVJvY+2h9KIPPyLde3L5wUaw1GY6orVkA8h891HKoxP yxfWkbnbEf9EkCxasHZoEwdCL98e38BvLCRSvUAP8hYlTj+yXw+xYzGjmcVoAluRizid x7XA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F6QQHvjc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h7-20020a631207000000b005d8be4c1250si9320768pgl.554.2024.03.13.09.43.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:43:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F6QQHvjc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 253A6B2136C for ; Wed, 13 Mar 2024 16:40:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C7624F88B; Wed, 13 Mar 2024 16:33:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F6QQHvjc" 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 7C53960EDE; Wed, 13 Mar 2024 16:33: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=1710347602; cv=none; b=aJdvjF07hs4jFhkZONlwIXHn0XEhXd18K8IRnVHU0aK2Zx3SQGCEFKuQ1JUH7EIEgiC5LtTGmPlYvFXpPXntS62x0vpxW3RzZ+EffS712biHb8VudQ6DayzK5X2bJHWB+PFvnaoxZpwzEmrbsLrSjD+OtmLv5Dnnf8iFvowKlfE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347602; c=relaxed/simple; bh=NfGB84W7kSIPl3PnIMLdf/TItkTQIHgCMbPF4hc6y78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XH1gTtT5yjgfo2XFqXB5WX8TiORcAAJaKNq9V+Zqp47Ix3yahqns0Fcxu0il+TK5I1ALzakzPjt3wUer1TvgvTgXXvnUIMRanGWm6EdknDeQa27sNHvGJlhVk0RRNxOZJ4DPBA4c6a2pvI+l/Z2nB8uWYjwMgJq3NyiC8Fei2Ao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F6QQHvjc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD37FC433A6; Wed, 13 Mar 2024 16:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347601; bh=NfGB84W7kSIPl3PnIMLdf/TItkTQIHgCMbPF4hc6y78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F6QQHvjcxN/vIEREE4BZ4Di904MgjlGp0XbZ69WtxC4gEyRsRxMymma4V6ryk/dZy fldCVf6+8nuLDOgWKLf2O51V3HYYmBs3k/Qq0XG9mlYiw0I6XEwDxobpDFR4HHwnOW dRIzvMK2VzJiaPyzuplt0hPuQA6A4NRFU+2dkd9A+vfmNbldzmZFkX0fOkPx55QlXw SyhemljiesJnf5vTEePfwIZZKLUxOEUYRwtxIiBqb7VV4hNXSwyluktrSBpd6FclY6 Sa6RruMVfFk8FTZSSlusq5qOQjUAi+iY+yuUmbAvO/KDLavWykrwHVuPC9yQDRzdZs lPBVhsWpFBl+w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Daniel Borkmann , Magnus Karlsson , Prashant Batra , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Jakub Kicinski , Alexei Starovoitov , Sasha Levin Subject: [PATCH 6.7 35/61] xdp, bonding: Fix feature flags when there are no slave devs anymore Date: Wed, 13 Mar 2024 12:32:10 -0400 Message-ID: <20240313163236.613880-36-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-1-sashal@kernel.org> 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=UTF-8 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Daniel Borkmann [ Upstream commit f267f262815033452195f46c43b572159262f533 ] Commit 9b0ed890ac2a ("bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY") changed the driver from reporting everything as supported before a device was bonded into having the driver report that no XDP feature is supported until a real device is bonded as it seems to be more truthful given eventually real underlying devices decide what XDP features are supported. The change however did not take into account when all slave devices get removed from the bond device. In this case after 9b0ed890ac2a, the driver keeps reporting a feature mask of 0x77, that is, NETDEV_XDP_ACT_MASK & ~NETDEV_XDP_ACT_XSK_ZEROCOPY whereas it should have reported a feature mask of 0. Fix it by resetting XDP feature flags in the same way as if no XDP program is attached to the bond device. This was uncovered by the XDP bond selftest which let BPF CI fail. After adjusting the starting masks on the latter to 0 instead of NETDEV_XDP_ACT_MASK the test passes again together with this fix. Fixes: 9b0ed890ac2a ("bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY") Signed-off-by: Daniel Borkmann Cc: Magnus Karlsson Cc: Prashant Batra Cc: Toke Høiland-Jørgensen Cc: Jakub Kicinski Reviewed-by: Toke Høiland-Jørgensen Message-ID: <20240305090829.17131-1-daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov Signed-off-by: Sasha Levin --- drivers/net/bonding/bond_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6cf7f364704e8..b094c48bebc30 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1811,7 +1811,7 @@ void bond_xdp_set_features(struct net_device *bond_dev) ASSERT_RTNL(); - if (!bond_xdp_check(bond)) { + if (!bond_xdp_check(bond) || !bond_has_slaves(bond)) { xdp_clear_features_flag(bond_dev); return; } -- 2.43.0