netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Conole <aconole@redhat.com>
To: "Adrián Moreno" <amorenoz@redhat.com>
Cc: netdev@vger.kernel.org,  Pravin B Shelar <pshelar@ovn.org>,
	 "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,  Shuah Khan <shuah@kernel.org>,
	 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
Date: Fri, 14 Jun 2024 11:54:11 -0400	[thread overview]
Message-ID: <f7t7cerpljw.fsf@redhat.com> (raw)
In-Reply-To: <CAG=2xmN+fp5B_b1KQq2T9DKrTQ_+Kqr6WbmrY0Gk1j3zZnY1YA@mail.gmail.com> ("Adrián Moreno"'s message of "Tue, 11 Jun 2024 15:03:45 +0000")

Adrián Moreno <amorenoz@redhat.com> writes:

> On Mon, Jun 03, 2024 at 03:02:46PM GMT, Aaron Conole wrote:
>> Adrian Moreno <amorenoz@redhat.com> 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 <module>
>> >     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 <amorenoz@redhat.com>
>> > ---
>>
>> Acked-by: Aaron Conole <aconole@redhat.com>
>>
>> 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.
>>
>
> Thanks Aaron. I'll resend as v2 with your ack as a stand-alone patch
> since the other patch of this series will be fixed by your soon-to-come
> series.

Thanks!

>> >  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
>>


  reply	other threads:[~2024-06-14 15:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 18:31 [PATCH net-next 1/2] selftests: openvswitch: fix action formatting Adrian Moreno
2024-06-03 18:31 ` [PATCH net-next 2/2] selftests: openvswitch: set value to nla flags Adrian Moreno
2024-06-03 19:02   ` Aaron Conole
2024-06-11 15:03     ` Adrián Moreno
2024-06-14 15:54       ` Aaron Conole [this message]
2024-06-03 19:00 ` [PATCH net-next 1/2] selftests: openvswitch: fix action formatting Aaron Conole
2024-06-04  0:15   ` Jakub Kicinski
2024-06-06  9:05   ` Adrián Moreno
2024-06-11 14:04     ` Aaron Conole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7t7cerpljw.fsf@redhat.com \
    --to=aconole@redhat.com \
    --cc=amorenoz@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pshelar@ovn.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).