From patchwork Mon Oct 21 03:12:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13843531 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DD0D208A9; Mon, 21 Oct 2024 03:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729480363; cv=none; b=VzZvOrGZEoq0nzOG6WT9IoNZFxqL+qLs5bR4eHtrFH5p14iEFD199VQHmHm5VL3gsyxDrvKOfe2/SgjIaqEz5RSRJxY/y6R5wHKBM7IDQzFaDi8kLObC7EM6zGNNuvHuzXpxtSsgd7PgV0lwOtDUsoOrMZ4WJRFaunPyUmTYbv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729480363; c=relaxed/simple; bh=tbFZzb3Ngplz3/wJWyh5VQWsoXKO6vWI78ThWMEmht4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PU4Hgch22i0/eCZINdFrzp2z1HcKZZzd8STtZ9MciLJueYZ4w3a+1cfdSDXr9+KszgC2pKTgfjSY8isxSXvbd+KeXo0KHxX7NG7ckTbLLQbJ/9sCvguwnUpg7AJzgjT3FOAgwGZR3Dr7RqCVnzFpFqgUpAbYIo0jOJxXJ0j2LEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Sle9d1sq; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Sle9d1sq" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20ce5e3b116so29947075ad.1; Sun, 20 Oct 2024 20:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729480359; x=1730085159; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W8sXCsn2gCaFNnfySACDJ6PxpYF0rU39snIB3R0VNhY=; b=Sle9d1sqYM6rQPNHd9Zf5YwOzi1hjI7wAuYxs/1SUH8h7v2/6+YVydrC4zmEEKRt5P 0LU/jxnEb6qZJg8AXTVzGEM/NKgChQ0YruwTbUW9GZT2FfqVZImL04XD9rbOGLG4LQSw E/Kif1oBVv8TFLnjbXXvcPMd4d/FajYcIy6JTRVjBBPmvu9ckhU+CycLCT0fFvhuIhCw 1DrVESXYFPAqAZ1o54iBw0O8HRljhJlBH+SPrBZWGF6HSPQZyXwYQPdd/z2PjG5RWKia xgHjO8sxW4X5OgA44NX6AxDx/z1CVKn5Siv2vpQx3o/7YlA/RKLjXDhJiXfBWzn22EJK qn9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729480359; x=1730085159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W8sXCsn2gCaFNnfySACDJ6PxpYF0rU39snIB3R0VNhY=; b=RoHN6R8c2996wMNu9Cl0cbelYFveFraglJJhqahm3Lr21pO8/FwzgWubcXbnQ4+pBS fyjmtngnOBiVvNyF0IIP6ICvvlzntKmdl4Rf8JAAbDOuAb8yM/Mo2SuVZB7vcb2afOcI DxNEb7wfHvyLpR+5/eEvOpmLvPcPDSlkWhryTrFuRUwaMFdAvazb1fl3Hkyp2qeRc+rB diCrBhBV+kEoCYm1rFvwHNAG/BMGBVsTNwVqwkyN5WlHo191yJSYSPCKl9aqZJkBDfFw qxczs6YVmrOH2YhFv/FN2ScbPpNAOSNvq4wx/7kGLWXTtl4Cw1f71vrcs+8L5aWJni8O AwUg== X-Forwarded-Encrypted: i=1; AJvYcCUMpCuVZpux86Aril0diJdTwFFKHUWPZx1WikUdA9Nz+bjCjG6qQovU27aBGJH16M+A+JeQ+s6t6fzC@vger.kernel.org, AJvYcCWUYGJBi4IthXj1+wdBpQkFdbF3Q3qU67V8vF1S3UDJDmN0dQsAmOPIpTSo9jI1sKoWDBM=@vger.kernel.org, AJvYcCXzzMGQ+0hfSBY0rp1FlbDoTPhcAKh3vnizX4ZT5+0NOdg2+QZ2xZeBMjSkAIGLYkrHvkyCTFmzGnWWRwe4@vger.kernel.org X-Gm-Message-State: AOJu0Yzqrjpgq/FUML4W20poJQobwJkryFLK6ojo5iahC3Hqm5d4V4U0 Se2urfo4u648YKdheF1ECOI2IPCFZbyFt4o28j4xScDb/m7cSaciLz3gx1dcHGY= X-Google-Smtp-Source: AGHT+IE8m/zRNXs5mHDN710q9UHS785xxIfQFJD4ErJjU9tsS2pz/tttnZRCX/E7nyvg0EKjIaoIJA== X-Received: by 2002:a17:903:1c2:b0:20c:e262:2560 with SMTP id d9443c01a7336-20e5a95825fmr139194195ad.50.1729480359464; Sun, 20 Oct 2024 20:12:39 -0700 (PDT) Received: from fedora.dns.podman ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e7eee658esm16377845ad.13.2024.10.20.20.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2024 20:12:38 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Jiri Pirko , Sebastian Andrzej Siewior , Lorenzo Bianconi , Andrii Nakryiko , Jussi Maki , Jay Vosburgh , Andy Gospodarek , Jonathan Corbet , Andrew Lunn , Nikolay Aleksandrov , =?utf-8?q?Toke_H=C3=B8iland-J?= =?utf-8?q?=C3=B8rgensen?= , Simon Horman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu Subject: [PATCHv3 net-next 1/2] bonding: return detailed error when loading native XDP fails Date: Mon, 21 Oct 2024 03:12:10 +0000 Message-ID: <20241021031211.814-2-liuhangbin@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241021031211.814-1-liuhangbin@gmail.com> References: <20241021031211.814-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Bonding only supports native XDP for specific modes, which can lead to confusion for users regarding why XDP loads successfully at times and fails at others. This patch enhances error handling by returning detailed error messages, providing users with clearer insights into the specific reasons for the failure when loading native XDP. Reviewed-by: Nikolay Aleksandrov Reviewed-by: Toke Høiland-Jørgensen Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b1bffd8e9a95..f0f76b6ac8be 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -5676,8 +5676,11 @@ static int bond_xdp_set(struct net_device *dev, struct bpf_prog *prog, ASSERT_RTNL(); - if (!bond_xdp_check(bond)) + if (!bond_xdp_check(bond)) { + BOND_NL_ERR(dev, extack, + "No native XDP support for the current bonding mode"); return -EOPNOTSUPP; + } old_prog = bond->xdp_prog; bond->xdp_prog = prog; From patchwork Mon Oct 21 03:12:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13843532 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5481531A60; Mon, 21 Oct 2024 03:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729480373; cv=none; b=L/sK/WDr2iAeS+aob0aSdewfwjLBybt7YMukgyeYPR4e1cmuDHQu8vLjZb5SGKrCHPGvpmBPHyobjvqia8BDOnGeUmWbCcEbZ6Eo+oPdhJZbMZ5ZPitnKjKxtA1sTDGwKjAcGo1jTh6LGWo9/bt4KsAVv473Q/qjRgneN1/Z/yU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729480373; c=relaxed/simple; bh=fOLDmvWp03EDMC/jF5pgUB9+gKQ4S8vdFti47RUJux0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YDNH+HvrCsA1qgSqqoCJJF56YMrrM7yZvBi66VCnfEqwTdHbhXNXhpqs3OcXRvmi5Sx62kUMBMoTF0keMxYW0HVAWVJ8pfORYF191IZWqc2uBxp8ICRPbo56cDiMmEl5VEEztsEG/TY6oVfjymIXUe+3eEfNaeyGjALaehpYODI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=M4B/d0VB; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M4B/d0VB" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-20e576dbc42so25583155ad.0; Sun, 20 Oct 2024 20:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729480370; x=1730085170; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R9uyhhZHz3cwvmGlgJcmKlovJH7fLo1iSETQBpUvqrE=; b=M4B/d0VB1LU5NAIlxbuFYy5ToyR/HVULFEVm4ciuWPbje0mcdD6Ym7y53SzSkA48E7 Nwjf+7JLtZXDU62IEkqbT8bDdBRHiIzMMhp9KlGWbwwd5wvP/Sp6AjhEAju5vMPCdnwG nghhO11LpGYk5ckSyRbWJDr41OwhERxSuS6Ir5YNqB7Ph5CYXClQHwxnR6JT7QeywdKP j3LsHBK1V/8zefmnQL3SJnDVqCdl9oEY3Z3TpBDCHteBIfz7pWLVQDpQN41E5ChKaA+b aNW4dLqxPiyuDMIHPTpz+d/JnrWWu6DOz90HPSk8VIIFWQ1fdYORU+yNRamS9VLvlug/ nepw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729480370; x=1730085170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R9uyhhZHz3cwvmGlgJcmKlovJH7fLo1iSETQBpUvqrE=; b=QLq6l0RN2Ki4TUFqUcTq0HBIzP+mj80TyhqcGkpIi/IoI+Q/jVMpQYw/Jwchx5VNnY P/tqvoWWkItQjvZzTc7uqbC8ODH5ub4cUkz7nF/mhOQv7GuaygxYNyiOYp3On7EWYaTe K5qGkYsN/VW7TfbjACHSTGq3NfXi0PRgN6Sw6WwbeGYB+lAH+uvuooWqo9xTQWqeHLAr 0YgZYpf7/mfn6aoJ+bMJkm1ksQpprsJVDiaXTt67fJch2SOWEI0BxhViR1dJKYaMIUOk ULdvkAeY+WEPD0cCBpDfR5hcIq7Q1PTbcNSSnovjI3yYWseIfGW/NZ90QVTCrL5ZFFS3 T/rA== X-Forwarded-Encrypted: i=1; AJvYcCU4FNHxCHH9cffjOw/4WOeuoEuD+dAFCohiTTnXtbqseHPhuZEEaXkgAOq/YT/j5WHplRYfsUisqrCW@vger.kernel.org, AJvYcCUJujXzUKpKBQN7VHR8eY3YnCZnkj/Zd085laS5qhGxcG1rbeWcz6+fzUQQxC49y09NfW0=@vger.kernel.org, AJvYcCXXx4/bXThSgfLPDh1ZNjsdPOw4HYOQbyU4I0pCKd2Mue4DJJ5/fa64jL4VP81gTMYvuZVtQ/TJkU8shz4a@vger.kernel.org X-Gm-Message-State: AOJu0YzD0macxeZ8wSZQKh0fPX5h7w5a8XEbgVtJeW1vhCl9pA1/jbJB Da/jjAG4nCMVp+YootmKpG7NNu/MhQ5KFYqx4DYR6NwZ1qkuvvFknrvBrmEmAMA= X-Google-Smtp-Source: AGHT+IH+03AHqmQUUE5TU4bSFfRQnNY4XsqORm1ADpzBvIcC549dB6BcgfFw6JBBuF2A2Hw5JWGhFg== X-Received: by 2002:a17:902:e883:b0:20c:7898:a8f5 with SMTP id d9443c01a7336-20e5a90df51mr137221975ad.28.1729480369584; Sun, 20 Oct 2024 20:12:49 -0700 (PDT) Received: from fedora.dns.podman ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e7eee658esm16377845ad.13.2024.10.20.20.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2024 20:12:48 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Jiri Pirko , Sebastian Andrzej Siewior , Lorenzo Bianconi , Andrii Nakryiko , Jussi Maki , Jay Vosburgh , Andy Gospodarek , Jonathan Corbet , Andrew Lunn , Nikolay Aleksandrov , =?utf-8?q?Toke_H=C3=B8iland-J?= =?utf-8?q?=C3=B8rgensen?= , Simon Horman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu Subject: [PATCHv3 net-next 2/2] Documentation: bonding: add XDP support explanation Date: Mon, 21 Oct 2024 03:12:11 +0000 Message-ID: <20241021031211.814-3-liuhangbin@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241021031211.814-1-liuhangbin@gmail.com> References: <20241021031211.814-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add document about which modes have native XDP support. Reviewed-by: Nikolay Aleksandrov Signed-off-by: Hangbin Liu Reviewed-by: Toke Høiland-Jørgensen --- Documentation/networking/bonding.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/networking/bonding.rst b/Documentation/networking/bonding.rst index e774b48de9f5..7c8d22d68682 100644 --- a/Documentation/networking/bonding.rst +++ b/Documentation/networking/bonding.rst @@ -2916,6 +2916,17 @@ from the bond (``ifenslave -d bond0 eth0``). The bonding driver will then restore the MAC addresses that the slaves had before they were enslaved. +9. What bonding modes support native XDP? +------------------------------------------ + + * balance-rr (0) + * active-backup (1) + * balance-xor (2) + * 802.3ad (4) + +Note that the vlan+srcmac hash policy does not support native XDP. +For other bonding modes, the XDP program must be loaded with generic mode. + 16. Resources and Links =======================