Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1162488lqj; Mon, 3 Jun 2024 12:04:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3D0serY4xQs4O6GO+qQUspLjZP3QbvqUuq7XLMD0SrEaImqWpNxbrB/QD+EMRQ5o+KKYE5rrlHwPe3csd/9XXNYLuRfpd83rqNlUaQw== X-Google-Smtp-Source: AGHT+IHFmqAqtsgsg1SY+6BaTaKAwYZK65o7vpUO/UT5iZqrMK8jEo62Cmo1hlTCQ6jPOfPiiwxn X-Received: by 2002:a17:902:f68c:b0:1f6:8552:c18c with SMTP id d9443c01a7336-1f68552c499mr24406125ad.49.1717441456562; Mon, 03 Jun 2024 12:04:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717441456; cv=pass; d=google.com; s=arc-20160816; b=w4pc27rDWb4yolt8kXM8K8Z/tLlvgC0eDeOR9VtfNuzMpzLkflBFGUFLHG40SvQoXS Z+68zuuHpvFah6F8UY9cnIeZonpNNX5MO+g18OsMbSNbMxRrEsKUmJQs6aqYHJNulyvs +Xfm5Nf3zhJ17k78oq+siXDiipebzG9PJGf1uSUC7qh5kNg+Dnmo4sOPuZhfUEd3yI3k mIk4JDMVbLjXAZRd2JjOu0jhU8IFs2p1EIE8ZBiylHUBAI+3bO+0ediyguRs5DfsE4wU NYidwfon/UxyQX6rvCHdQ11c6Fa9CsdW27BiN/O5XOifCXXjJ3V8xRcDgLwBZgP6l7wa YpZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=TKPs5UyXdPWSkTr2LDWrvXdNXvQrucoVoL0neTHxTus=; fh=e663OgubmMLFVLzeeLsVyIaIWixyiP1yerxYs35iLRk=; b=Rb25TzexevLmt5lFKEGw9dKEWZ+TyZgyL05/ueA6ytZdk4EWnqmi6oQdMEAbrkNR01 2TFvOGcQlSh5Y0PkRicx29vhmldTeYnx5BMxGQJErgG7ac+KihtkeMpbi+Y7ZOcqr9G+ z+YEr8tz1zyyKBSw/t7hLSJST0O3h52DqHaCp/Xg5WMD0wU52AzJai+pu48uZcYsoU9D kp8CeALvXkG3jst6C/WzU7T5ZmFT9b+mFt+oPL8FSox2/pUZ0li+ufEzvOO2UUpRN+JC bmyiJGCrVCZ/JCfyAu5GF8Sq9RW4yVenukRo5tBLlOrrIqN7j+v2ik0SHL9q2rxrQ3fH e3bQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DNl7k9Ua; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-199593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199593-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f632367173si5465675ad.175.2024.06.03.12.04.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 12:04:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DNl7k9Ua; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-199593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199593-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 8ECBCB21A95 for ; Mon, 3 Jun 2024 19:03:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66E0D13A252; Mon, 3 Jun 2024 19:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DNl7k9Ua" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 286D7259C for ; Mon, 3 Jun 2024 19:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717441373; cv=none; b=uYcm/tVee5DehVf34Wu6pmG3U/Bq9MxXlw9u3aZcY8IPO75k06STXJkhBLug1h268R11ehs3NSOTTrYgAGG7DIkJhfHQPauB6grN0EeGQjfhyk3rvhzLDIbYQc0IPuCTQcWEX7gGY7Xky7YU1xrdAcGx7dKL3KnolP+vyHdOe8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717441373; c=relaxed/simple; bh=o1242Noh5DwPdRlCuDUUZfqQFqyeDP+F6RVt3zLnvi8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=H/H7+Ah6e4JDbaFBRpdXNB8ORQ7IZoONMG4Qib/Gx6qujWO2szEVKewGKdXVTwbzHHG1aWI47xKtlzAb+K4yWy7pjFOwKUYNngedYQy8DQJykyRv7707b49mmCGWd11TxfziOq/v5mmJjvnzQVgdJTtBHaKSLy2yEVkpjVYIBNg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=DNl7k9Ua; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717441371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TKPs5UyXdPWSkTr2LDWrvXdNXvQrucoVoL0neTHxTus=; b=DNl7k9Ua5i2REuCNbejuVUgqh/uVnw/LmvcjkfyDyLW+2Kd6Qa5l+GoTb+LaonD1xcwhKa yKhk7U5migcijeGFnwOIKW2mVgsrnUvmGvsXMI83l3HP4MxIo0FziOjYbjUS+TH95FezBV OdJ3HVztoQFDGPNwed7H3TXGHqFbLuE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-508-kKEZ1Yu9PGSd-Q2E547EFw-1; Mon, 03 Jun 2024 15:02:47 -0400 X-MC-Unique: kKEZ1Yu9PGSd-Q2E547EFw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C1D43C025AD; Mon, 3 Jun 2024 19:02:47 +0000 (UTC) Received: from RHTRH0061144 (unknown [10.22.16.249]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D141C1C0654B; Mon, 3 Jun 2024 19:02:46 +0000 (UTC) From: Aaron Conole To: Adrian Moreno Cc: netdev@vger.kernel.org, Pravin B Shelar , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , dev@openvswitch.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 2/2] selftests: openvswitch: set value to nla flags In-Reply-To: <20240603183121.2305013-2-amorenoz@redhat.com> (Adrian Moreno's message of "Mon, 3 Jun 2024 20:31:20 +0200") References: <20240603183121.2305013-1-amorenoz@redhat.com> <20240603183121.2305013-2-amorenoz@redhat.com> Date: Mon, 03 Jun 2024 15:02:46 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Adrian Moreno writes: > Netlink flags, although they don't have payload at the netlink level, > are represented as having a "True" 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 I don't know which pyroute2 version I had used when I tested this previously, but even on my current system I get this error now. Thanks for the fix. > 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 b76907ac0092..a2395c3f37a1 100644 > --- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py > +++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py > @@ -537,7 +537,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