Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2380322lqp; Sun, 24 Mar 2024 16:51:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxNY7QX/dT0327wJsYgJ7nNc6DXI1KUw/DGzt7TlArpmxjo0QEtojgJhkHtaP5vwox5HLx49/7BIxd+XtvUVFST06+S2De46Ahsi8eIQ== X-Google-Smtp-Source: AGHT+IHzfN4x+RqlrNXZKI04a/s/ywk2oKhdwSlt62TF6EEDicqxH4W8Y0rVfK1IJzx23E/6kH6U X-Received: by 2002:a17:907:98c:b0:a47:53be:5e6c with SMTP id bf12-20020a170907098c00b00a4753be5e6cmr1723718ejc.34.1711324270064; Sun, 24 Mar 2024 16:51:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711324270; cv=pass; d=google.com; s=arc-20160816; b=ZSZQLW3ofmk5cadeZdT7l12SxQ1KLoJ3aAyCyerqLG5J/zfRGcFlQcYcvW9IN/qV3T QmRMTGdg/2tYjT85cP31bR9MIE8ANDrqvFqYt7If4ATASTm6Ah97nLhE01xPfFne4Evu 8zIcbCKw/pCfKEbEimMSRacLhDQkuoxnOtpF4TtX8hGGxAG16w57Y2KZCALwf+kHics6 XsQuZs+nfb7lhJ1Zzot3J/5JuxREQ40JWFsEp2NovT57xe1s6JKjzCPVQX4I+V5Evr7g NvO2jrsztg4rZYCuz/3gmd9pksqKRUyO7KajkegUkB9IiROJW311ELc/Wpd807CjE14i 9uGg== 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=y6NlXPbNY0g0e4Na8oPSCVjcLP4nXwYKsoejAw6r3Pc=; fh=EJdb7yf3mSw+2N8jx0NHOxYy7xLurDwBL02JQKLm2U4=; b=jV2w5ivyfDcWIFypZXeUGzkDo3nAZbcBv5I2HN3dbIDBdnjzPmjWifBaLXcfcm3zZT NlU6etkBnuW8UNtbYxSV2XBHId2mJkMOwY6+Ocg6gUeBngrfMvZh1ymLS7NHWZh6B3xg gfpwc8hmfAgmz/KaERF8QkAgrrYEIRYkmGQd9RtPekj0dVaozA+ADsekQYOIHHsNb7XI eyKdpxXwWp4p9s57/Ne/GowLuZypOZH4tLQRZqOV8p9//lLM7naSG6S6n9HEtXDbElkK xu9HZSU8N/PY/XMIZiuvLtClI5RbQeg5tXnc7NdJpbCb2onGx5ajjHOyLl7C7dPbUM8s ElCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WW4SElaF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113234-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c23-20020a170906529700b00a4747bdb536si1602586ejm.255.2024.03.24.16.51.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:51:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WW4SElaF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113234-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C5BB11F21FE9 for ; Sun, 24 Mar 2024 23:51:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0443E184306; Sun, 24 Mar 2024 22:40:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WW4SElaF" 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 14C98183BAA; Sun, 24 Mar 2024 22:40:35 +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=1711320035; cv=none; b=ip0V8uy1Gsmo6c/c+fGPaxds+GRtJHwuEVR46H3fw51lUVNd1MS4gyQA0pCECamxDmcwmmJD/5SeXfiR3dwkPAph/6n7UMLZvsMPHPlMBWNUYAPlIklC8HNnuNYCmPd6sCGQ3OBAvMXuELD6MKcDvnMsO0Zv+eq6BR+Rj9LxFxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320035; c=relaxed/simple; bh=Vgkzwo37Keltrl0Mwke7Q+1JmJcXEaRiYrJXXdkBbTM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZEX1X1jiYKy7TwBLWTfTPi1Wmng/0WTxIwrVSkMJvl9UqNteUabsa05PGi5LwOs3tPx11Y7onx/6lZ/GfLObKmfmC+Q9Z/rhPGOSsB4KaGxzYKu8260NCNQXFyJdE0TaexYFNmzWFf5gjpDVfT4nH7zKxGkkennEEc28Bk4RvTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WW4SElaF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25220C43394; Sun, 24 Mar 2024 22:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320034; bh=Vgkzwo37Keltrl0Mwke7Q+1JmJcXEaRiYrJXXdkBbTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WW4SElaFAdy2NuDNEqJvuJ+bs1k7du0NmT7Tbx6SFRQXjZk68iNJF/EGF/umQfDbB 9UaV0oiJ7ssS2FVvWDB+Wbb8AVwMSdO55ps2JCWgMaXMhm8e9B1JBmRiVHCszRlpBF ETO2N7DPAPKuIQNbnWYfWOzy1hknku1LNgifU3484VE3ZfONRVRfP6PJORdOOUdQXV 6lHCKRbH5kcL4i/beCMlTkVCV439Tu9RfuidXz+q+9wf4DhtfwDkr3S3MeqMgvUQ9D zAEIUnlTL7ZSw3ppY2RQTMykDi2tvLpr8d8LBkHMv74R3e4h25r54xvivS8x5PISMi s84CFHuxd7Vfg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: William Tu , Jiri Pirko , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.8 343/715] devlink: Fix length of eswitch inline-mode Date: Sun, 24 Mar 2024 18:28:42 -0400 Message-ID: <20240324223455.1342824-344-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: William Tu [ Upstream commit 8f4cd89bf10607de08231d6d91a73dd63336808e ] Set eswitch inline-mode to be u8, not u16. Otherwise, errors below $ devlink dev eswitch set pci/0000:08:00.0 mode switchdev \ inline-mode network Error: Attribute failed policy validation. kernel answers: Numerical result out of rang netlink: 'devlink': attribute type 26 has an invalid length. Fixes: f2f9dd164db0 ("netlink: specs: devlink: add the remaining command to generate complete split_ops") Signed-off-by: William Tu Reviewed-by: Jiri Pirko Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20240310164547.35219-1-witu@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- Documentation/netlink/specs/devlink.yaml | 2 +- net/devlink/netlink_gen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netlink/specs/devlink.yaml index cf6eaa0da821b..09fbb4c03fc8d 100644 --- a/Documentation/netlink/specs/devlink.yaml +++ b/Documentation/netlink/specs/devlink.yaml @@ -290,7 +290,7 @@ attribute-sets: enum: eswitch-mode - name: eswitch-inline-mode - type: u16 + type: u8 enum: eswitch-inline-mode - name: dpipe-tables diff --git a/net/devlink/netlink_gen.c b/net/devlink/netlink_gen.c index c81cf2dd154f3..f9786d51f68f9 100644 --- a/net/devlink/netlink_gen.c +++ b/net/devlink/netlink_gen.c @@ -198,7 +198,7 @@ static const struct nla_policy devlink_eswitch_set_nl_policy[DEVLINK_ATTR_ESWITC [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, [DEVLINK_ATTR_ESWITCH_MODE] = NLA_POLICY_MAX(NLA_U16, 1), - [DEVLINK_ATTR_ESWITCH_INLINE_MODE] = NLA_POLICY_MAX(NLA_U16, 3), + [DEVLINK_ATTR_ESWITCH_INLINE_MODE] = NLA_POLICY_MAX(NLA_U8, 3), [DEVLINK_ATTR_ESWITCH_ENCAP_MODE] = NLA_POLICY_MAX(NLA_U8, 1), }; -- 2.43.0