<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openvswitch.git/tests/learn.at, branch master</title>
<subtitle>github.com: openvswitch/ovs.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/'/>
<entry>
<title>learn: Fix parsing immediate value for a field match.</title>
<updated>2022-11-24T12:22:31+00:00</updated>
<author>
<name>Ilya Maximets</name>
<email>i.maximets@ovn.org</email>
</author>
<published>2022-11-23T21:23:37+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=8b3c86897d6a114a099255997bb74f12a735d9fb'/>
<id>8b3c86897d6a114a099255997bb74f12a735d9fb</id>
<content type='text'>
The value is right-justified after the string parsing with
parse_int_string(), i.e. it is in BE byte order and aligned
to the right side of the array.

For example, the 0x10011 value in a 4-byte field will look
like 0x00 0x01 0x00 0x11.

However, value copy to the resulted ofpact is performed
from the start of the memory.  So, in case the destination
size is smaller than the original field size, incorrect
part of the value will be copied.

In the 0x00 0x01 0x00 0x11 example above, if the copy is
performed to a 3-byte field, the first 3 bytes will be
copied, which are 0x00 0x01 0x00 instead of 0x01 0x00 0x11.

This leads to a problem where NXM_NX_REG3[0..16]=0x10011
turns into NXM_NX_REG3[0..16]=0x100 after the parsing.

Fix that by offsetting the starting position to the size
difference in bytes similarly to how it is done in
learn_parse_load_immediate().

While at it, changing &amp;imm to imm.b in function calls that
expect byte arrays as an argument.  The old way is technically
correct, but more error prone.

The mf_write_subfield_value() call was also incorrect.
However, the 'match' variable is actually not used for
anything since checking removal in commit:

  dd43a558597b ("Do not perform validation in learn_parse();")

So, just removing the call and the 'match' variable
entirely instead of fixing it.

Fixes: 21b2fa617126 ("ofp-parse: Allow match field names in actions and brackets in matches.")
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-November/052100.html
Reported-by: Thomas Lee &lt;newsforthomas@engineer.com&gt;
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The value is right-justified after the string parsing with
parse_int_string(), i.e. it is in BE byte order and aligned
to the right side of the array.

For example, the 0x10011 value in a 4-byte field will look
like 0x00 0x01 0x00 0x11.

However, value copy to the resulted ofpact is performed
from the start of the memory.  So, in case the destination
size is smaller than the original field size, incorrect
part of the value will be copied.

In the 0x00 0x01 0x00 0x11 example above, if the copy is
performed to a 3-byte field, the first 3 bytes will be
copied, which are 0x00 0x01 0x00 instead of 0x01 0x00 0x11.

This leads to a problem where NXM_NX_REG3[0..16]=0x10011
turns into NXM_NX_REG3[0..16]=0x100 after the parsing.

Fix that by offsetting the starting position to the size
difference in bytes similarly to how it is done in
learn_parse_load_immediate().

While at it, changing &amp;imm to imm.b in function calls that
expect byte arrays as an argument.  The old way is technically
correct, but more error prone.

The mf_write_subfield_value() call was also incorrect.
However, the 'match' variable is actually not used for
anything since checking removal in commit:

  dd43a558597b ("Do not perform validation in learn_parse();")

So, just removing the call and the 'match' variable
entirely instead of fixing it.

Fixes: 21b2fa617126 ("ofp-parse: Allow match field names in actions and brackets in matches.")
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-November/052100.html
Reported-by: Thomas Lee &lt;newsforthomas@engineer.com&gt;
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ofp-util, ofp-parse: Break up into many separate modules.</title>
<updated>2018-02-13T18:43:13+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@ovn.org</email>
</author>
<published>2018-02-09T18:04:26+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=0d71302e36c4ad290cb3b36363b48756fb438c59'/>
<id>0d71302e36c4ad290cb3b36363b48756fb438c59</id>
<content type='text'>
ofp-util had been far too large and monolithic for a long time.  This
commit breaks it up into units that make some logical sense.  It also
moves the pieces of ofp-parse that were specific to each unit into the
relevant unit.

Most of this commit is just moving code around.

Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
Reviewed-by: Yifeng Sun &lt;pkusunyifeng@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ofp-util had been far too large and monolithic for a long time.  This
commit breaks it up into units that make some logical sense.  It also
moves the pieces of ofp-parse that were specific to each unit into the
relevant unit.

Most of this commit is just moving code around.

Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
Reviewed-by: Yifeng Sun &lt;pkusunyifeng@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>learn: improve test case</title>
<updated>2018-02-01T21:00:44+00:00</updated>
<author>
<name>William Tu</name>
<email>u9012063@gmail.com</email>
</author>
<published>2018-02-01T02:32:29+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=fdfd3f7b01ef23c8b527d9e0a63d962945e7c7fd'/>
<id>fdfd3f7b01ef23c8b527d9e0a63d962945e7c7fd</id>
<content type='text'>
Current learn test cases use only ovs-ofctl add/del flows.
The patch add a new test case for learn with delete_learned and
limit option enabled.

Signed-off-by: William Tu &lt;u9012063@gmail.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current learn test cases use only ovs-ofctl add/del flows.
The patch add a new test case for learn with delete_learned and
limit option enabled.

Signed-off-by: William Tu &lt;u9012063@gmail.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>flow: Add some L7 payload data to most L4 protocols that accept it.</title>
<updated>2018-01-27T16:58:31+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@ovn.org</email>
</author>
<published>2018-01-26T22:36:05+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=6f06837989bbc0d98ab895abce7fc812a42827f4'/>
<id>6f06837989bbc0d98ab895abce7fc812a42827f4</id>
<content type='text'>
This makes traffic generated by flow_compose() look slightly more
realistic.  It requires lots of updates to tests, but at least the tests
themselves should be slightly more realistic too.

At the same time, add --l7 and --l7-len options to ofproto/trace to allow
users to specify the amount or contents of payloads that they want.

Suggested-by: Brad Cowie &lt;brad@cowie.nz&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
Tested-by: Yifeng Sun &lt;pkusunyifeng@gmail.com&gt;
Reviewed-by: Yifeng Sun &lt;pkusunyifeng@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes traffic generated by flow_compose() look slightly more
realistic.  It requires lots of updates to tests, but at least the tests
themselves should be slightly more realistic too.

At the same time, add --l7 and --l7-len options to ofproto/trace to allow
users to specify the amount or contents of payloads that they want.

Suggested-by: Brad Cowie &lt;brad@cowie.nz&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
Tested-by: Yifeng Sun &lt;pkusunyifeng@gmail.com&gt;
Reviewed-by: Yifeng Sun &lt;pkusunyifeng@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ovs-ofctl: New option "--no-stats" for "ovs-ofctl dump-flows".</title>
<updated>2017-06-14T19:50:23+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@ovn.org</email>
</author>
<published>2017-06-14T00:09:05+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=1b3758c36e88fd261377726f9ab958a0be53f2ca'/>
<id>1b3758c36e88fd261377726f9ab958a0be53f2ca</id>
<content type='text'>
It's pretty common to want to omit statistics from output, to make it
easier to read.  This commit adds an ovs-ofctl option to make that easy.

A lot of the OVS internal tests could use this, too, in place of
ofctl_strip.  This commit adopts it for a subset.

Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
Acked-by: Aaron Conole &lt;aconole@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's pretty common to want to omit statistics from output, to make it
easier to read.  This commit adds an ovs-ofctl option to make that easy.

A lot of the OVS internal tests could use this, too, in place of
ofctl_strip.  This commit adopts it for a subset.

Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
Acked-by: Aaron Conole &lt;aconole@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ofp-actions: Add limit to learn action.</title>
<updated>2017-03-16T20:42:26+00:00</updated>
<author>
<name>Daniele Di Proietto</name>
<email>diproiettod@vmware.com</email>
</author>
<published>2017-03-10T23:44:40+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=4c71600d2256641b927e04b75e95751355e799f8'/>
<id>4c71600d2256641b927e04b75e95751355e799f8</id>
<content type='text'>
This commit adds a new feature to the learn actions: the possibility to
limit the number of learned flows.

To be compatible with users of the old learn action, a new structure is
introduced as well as a new OpenFlow raw action number.

There's a small corner case when we have to delete the ukey.  This
happens when:
* The learned rule has expired (or has been deleted).
* The ukey that learned the rule is still in the datapath.
* No packets hit the datapath flow recently.
In this case we cannot relearn the rule (because there are no new
packets), and the actions might depend on the learn execution, so the
only option is to delete the ukey.  I don't think this has big
performance implications since it's done only for ukey with no traffic.

We could also slowpath it, but that will cause an action upcall and the
correct datapath actions will be installed later by a revalidator.  If
we delete the ukey, the next upcall will be a miss upcall and that will
immediatedly install the correct datapath flow.

Signed-off-by: Daniele Di Proietto &lt;diproiettod@vmware.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds a new feature to the learn actions: the possibility to
limit the number of learned flows.

To be compatible with users of the old learn action, a new structure is
introduced as well as a new OpenFlow raw action number.

There's a small corner case when we have to delete the ukey.  This
happens when:
* The learned rule has expired (or has been deleted).
* The ukey that learned the rule is still in the datapath.
* No packets hit the datapath flow recently.
In this case we cannot relearn the rule (because there are no new
packets), and the actions might depend on the learn execution, so the
only option is to delete the ukey.  I don't think this has big
performance implications since it's done only for ukey with no traffic.

We could also slowpath it, but that will cause an action upcall and the
correct datapath actions will be installed later by a revalidator.  If
we delete the ukey, the next upcall will be a miss upcall and that will
immediatedly install the correct datapath flow.

Signed-off-by: Daniele Di Proietto &lt;diproiettod@vmware.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ofp-parse: Allow match field names in actions and brackets in matches.</title>
<updated>2017-01-05T00:10:56+00:00</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jarno@ovn.org</email>
</author>
<published>2017-01-05T00:10:56+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=21b2fa61712684b03c5a5a0dc2090fb5bbf9d1ad'/>
<id>21b2fa61712684b03c5a5a0dc2090fb5bbf9d1ad</id>
<content type='text'>
Allow using match field names in addition to the canonical register
names in actions (including 'load', 'move', 'push', 'pop', 'output',
'multipath', 'bundle_load', and 'learn').  Allow also leaving out the
trailing '[]' to indicate full field.  These changes allow simpler
syntax similar to 'set_field' to be used also elsewhere.

Correspondingly, allow the '[start..end]' syntax to be used in matches
in addition to the more explicit 'value/mask' notation.  For example,
to match on the value 2 of the bits 14..15 of NXM_NX_REG0, the match
could include:

... reg0[14..15]=2 ...

instead of

... reg0=0x8000/0xc000 ...

Note that only contiguous masks can be specified with the bracket
notation.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
Acked-by: Ben Pfaff &lt;blp@ovn.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow using match field names in addition to the canonical register
names in actions (including 'load', 'move', 'push', 'pop', 'output',
'multipath', 'bundle_load', and 'learn').  Allow also leaving out the
trailing '[]' to indicate full field.  These changes allow simpler
syntax similar to 'set_field' to be used also elsewhere.

Correspondingly, allow the '[start..end]' syntax to be used in matches
in addition to the more explicit 'value/mask' notation.  For example,
to match on the value 2 of the bits 14..15 of NXM_NX_REG0, the match
could include:

... reg0[14..15]=2 ...

instead of

... reg0=0x8000/0xc000 ...

Note that only contiguous masks can be specified with the bracket
notation.

Signed-off-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
Acked-by: Ben Pfaff &lt;blp@ovn.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Change some old references to nicira-ext.h.</title>
<updated>2016-09-30T19:59:14+00:00</updated>
<author>
<name>Thadeu Lima de Souza Cascardo</name>
<email>cascardo@redhat.com</email>
</author>
<published>2016-09-30T18:31:03+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=0da610338225eef4ff3d149a1adadfe82c2b15f2'/>
<id>0da610338225eef4ff3d149a1adadfe82c2b15f2</id>
<content type='text'>
Some of these references are not valid anymore, as things were moved to
either meta-flow.h or ofp-actions.c.

Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@redhat.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some of these references are not valid anymore, as things were moved to
either meta-flow.h or ofp-actions.c.

Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@redhat.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdev-*: Do not use dp_packet_pad() in recv() functions.</title>
<updated>2016-07-29T21:08:10+00:00</updated>
<author>
<name>Daniele Di Proietto</name>
<email>diproiettod@vmware.com</email>
</author>
<published>2016-07-29T01:02:01+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=efe179e041f97205d0442fd740e8ca7568534e2d'/>
<id>efe179e041f97205d0442fd740e8ca7568534e2d</id>
<content type='text'>
All the netdevs used by dpif-netdev (except for netdev-dpdk) have a
dp_packet_pad() call in the receive function, probably because the
userspace datapath couldn't handle properly short packets.

This doesn't appear to be the case anymore.

This commit removes the call to have a more consistent behavior with the
kernel datapath.

All the testsuite changes in this commit adjust the expectations for
packet lengths in flow dumps and other stats.  There's only one fix in
ovn.at: one of the test_ip() functions generated an incomplete udp
packet, which was not a problem until now, because of the padding.

Signed-off-by: Daniele Di Proietto &lt;diproiettod@vmware.com&gt;
Acked-by: Ben Pfaff &lt;blp@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All the netdevs used by dpif-netdev (except for netdev-dpdk) have a
dp_packet_pad() call in the receive function, probably because the
userspace datapath couldn't handle properly short packets.

This doesn't appear to be the case anymore.

This commit removes the call to have a more consistent behavior with the
kernel datapath.

All the testsuite changes in this commit adjust the expectations for
packet lengths in flow dumps and other stats.  There's only one fix in
ovn.at: one of the test_ip() functions generated an incomplete udp
packet, which was not a problem until now, because of the padding.

Signed-off-by: Daniele Di Proietto &lt;diproiettod@vmware.com&gt;
Acked-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for extended netdev statistics based on RFC 2819.</title>
<updated>2016-05-06T22:28:56+00:00</updated>
<author>
<name>mweglicx</name>
<email>michalx.weglicki@intel.com</email>
</author>
<published>2016-05-05T08:46:01+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=d6e3feb57c44e18580015d8e99dd751cff4f2c9e'/>
<id>d6e3feb57c44e18580015d8e99dd751cff4f2c9e</id>
<content type='text'>
Implementation of new statistics extension for DPDK ports:
- Add new counters definition to netdev struct and open flow,
  based on RFC2819.
- Initialize netdev statistics as "filtered out"
  before passing it to particular netdev implementation
  (because of that change, statistics which are not
  collected are reported as filtered out, and some
  unit tests were modified in this respect).
- New statistics are retrieved using experimenter code and
  are printed as a result to ofctl dump-ports.
- New counters are available for OpenFlow 1.4+.
- Add new vendor id: INTEL_VENDOR_ID.
- New statistics are printed to output via ofctl only if those
  are present in reply message.
- Add new file header: include/openflow/intel-ext.h which
  contains new statistics definition.
- Extended statistics are implemented only for dpdk-physical
  and dpdk-vhost port types.
- Dpdk-physical implementation uses xstats to collect statistics.
- Dpdk-vhost implements only part of statistics (RX packet sized
  based counters).

Signed-off-by: Michal Weglicki &lt;michalx.weglicki@intel.com&gt;
[blp@ovn.org made software devices more consistent]
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implementation of new statistics extension for DPDK ports:
- Add new counters definition to netdev struct and open flow,
  based on RFC2819.
- Initialize netdev statistics as "filtered out"
  before passing it to particular netdev implementation
  (because of that change, statistics which are not
  collected are reported as filtered out, and some
  unit tests were modified in this respect).
- New statistics are retrieved using experimenter code and
  are printed as a result to ofctl dump-ports.
- New counters are available for OpenFlow 1.4+.
- Add new vendor id: INTEL_VENDOR_ID.
- New statistics are printed to output via ofctl only if those
  are present in reply message.
- Add new file header: include/openflow/intel-ext.h which
  contains new statistics definition.
- Extended statistics are implemented only for dpdk-physical
  and dpdk-vhost port types.
- Dpdk-physical implementation uses xstats to collect statistics.
- Dpdk-vhost implements only part of statistics (RX packet sized
  based counters).

Signed-off-by: Michal Weglicki &lt;michalx.weglicki@intel.com&gt;
[blp@ovn.org made software devices more consistent]
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
