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 966A714A4F7; Mon, 1 Jul 2024 00:14:04 +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=1719792844; cv=none; b=YVWmIBER1/hxw6PySMhFe0GlAQTfVEOpBaTm7qo3n13ezIaJBm2ADwaagfffM3pKAsjf79Yp2RMw8K20CSSfFysOSE/FkPIdQDOXaiHqq6iHf5lMGl5kNQoECAt5IlEX5sylARVXqokViRmRvICCAi0kWNHa02VRiVpjxcTmVj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719792844; c=relaxed/simple; bh=p3EN7FK246yZq7ZJYoFjN4WYgTILLsYkYVjtqauABbM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YBULSkEqIWU9Re6yYe0ZLp+I98nZ67m3rPHGk5MPwE67ntpcVOZ892saADDKIcwws7ZWSlcZdxhnzRjFY/R4BaR+x/VfqJKTjcjhC3MbQ2nm6DUj2Smst8WeQT5+V4/6oezmk6/flWdC1CqZAAKDgTMy+q6VnyfC2/winBcGjsY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XbcFbw3y; 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="XbcFbw3y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4E8AC2BD10; Mon, 1 Jul 2024 00:14:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719792844; bh=p3EN7FK246yZq7ZJYoFjN4WYgTILLsYkYVjtqauABbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XbcFbw3yXspEnwz2EhqPaUqAptYT8Mx18htd5icj01GX+fSJDZktV6fuYajJskBOj mmeDccpo9Z2y3PV/Bnhn4mz4EJxCRXnGxJOEclsWPih6JA+132PEueds6lVzbjtry9 WUbhYtJzeeQUAzVZheBqbOIYXWA8wdDCwRjMBFtZpDda/okQklGpQoCzp8UjGddB0M g2fAVllgKDlzvc9HEdjOI5mv24lyF7ZWmAjEJv9IpZtKSuRbQq5Ufj9uXvsWq6VATx Y73kJvybWw8Fmt6KcZSGcbWZYCF/K6QT8RfqEH9UYZw44cb8C6X+SJKK8oMGdN5bpr /s17WGHFZyylw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Adrian Moreno , Aaron Conole , "David S . Miller" , Sasha Levin , pshelar@ovn.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, netdev@vger.kernel.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 09/12] selftests: openvswitch: Set value to nla flags. Date: Sun, 30 Jun 2024 20:13:28 -0400 Message-ID: <20240701001342.2920907-9-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240701001342.2920907-1-sashal@kernel.org> References: <20240701001342.2920907-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.36 Content-Transfer-Encoding: 8bit From: Adrian Moreno [ Upstream commit a8763466669d21b570b26160d0a5e0a2ee529d22 ] Netlink flags, although they don't have payload at the netlink level, are represented as having "True" as value in pyroute2. Without it, trying to add a flow with a flag-type action (e.g: pop_vlan) fails with the following traceback: Traceback (most recent call last): File "[...]/ovs-dpctl.py", line 2498, in sys.exit(main(sys.argv)) ^^^^^^^^^^^^^^ File "[...]/ovs-dpctl.py", line 2487, in main ovsflow.add_flow(rep["dpifindex"], flow) File "[...]/ovs-dpctl.py", line 2136, in add_flow reply = self.nlm_request( ^^^^^^^^^^^^^^^^^ File "[...]/pyroute2/netlink/nlsocket.py", line 822, in nlm_request return tuple(self._genlm_request(*argv, **kwarg)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "[...]/pyroute2/netlink/generic/__init__.py", line 126, in nlm_request return tuple(super().nlm_request(*argv, **kwarg)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "[...]/pyroute2/netlink/nlsocket.py", line 1124, in nlm_request self.put(msg, msg_type, msg_flags, msg_seq=msg_seq) File "[...]/pyroute2/netlink/nlsocket.py", line 389, in put self.sendto_gate(msg, addr) File "[...]/pyroute2/netlink/nlsocket.py", line 1056, in sendto_gate msg.encode() File "[...]/pyroute2/netlink/__init__.py", line 1245, in encode offset = self.encode_nlas(offset) ^^^^^^^^^^^^^^^^^^^^^^^^ File "[...]/pyroute2/netlink/__init__.py", line 1560, in encode_nlas nla_instance.setvalue(cell[1]) File "[...]/pyroute2/netlink/__init__.py", line 1265, in setvalue nlv.setvalue(nla_tuple[1]) ~~~~~~~~~^^^ IndexError: list index out of range Signed-off-by: Adrian Moreno Acked-by: Aaron Conole Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- tools/testing/selftests/net/openvswitch/ovs-dpctl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py index 5e0e539a323d5..8b120718768ec 100644 --- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py +++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py @@ -531,7 +531,7 @@ class ovsactions(nla): for flat_act in parse_flat_map: if parse_starts_block(actstr, flat_act[0], False): actstr = actstr[len(flat_act[0]):] - self["attrs"].append([flat_act[1]]) + self["attrs"].append([flat_act[1], True]) actstr = actstr[strspn(actstr, ", ") :] parsed = True -- 2.43.0