<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/openvswitch, branch master</title>
<subtitle>Linux Kernel (branches are rebased on master from time to time)</subtitle>
<id>https://sre.ring0.de/linux/atom?h=master</id>
<link rel='self' href='https://sre.ring0.de/linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/'/>
<updated>2022-12-22T01:48:12Z</updated>
<entry>
<title>net: openvswitch: release vport resources on failure</title>
<updated>2022-12-22T01:48:12Z</updated>
<author>
<name>Aaron Conole</name>
<email>aconole@redhat.com</email>
</author>
<published>2022-12-20T21:27:17Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=95637d91fefdb94d6e7389222ba9ddab0e9f5abe'/>
<id>urn:sha1:95637d91fefdb94d6e7389222ba9ddab0e9f5abe</id>
<content type='text'>
A recent commit introducing upcall packet accounting failed to properly
release the vport object when the per-cpu stats struct couldn't be
allocated.  This can cause dangling pointers to dp objects long after
they've been released.

Cc: wangchuanlei &lt;wangchuanlei@inspur.com&gt;
Fixes: 1933ea365aa7 ("net: openvswitch: Add support to count upcall packets")
Reported-by: syzbot+8f4e2dcfcb3209ac35f9@syzkaller.appspotmail.com
Signed-off-by: Aaron Conole &lt;aconole@redhat.com&gt;
Acked-by: Eelco Chaudron &lt;echaudro@redhat.com&gt;
Reviewed-by: Michal Swiatkowski &lt;michal.swiatkowski@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20221220212717.526780-1-aconole@redhat.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>openvswitch: Fix flow lookup to use unmasked key</title>
<updated>2022-12-16T10:33:07Z</updated>
<author>
<name>Eelco Chaudron</name>
<email>echaudro@redhat.com</email>
</author>
<published>2022-12-15T14:46:33Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=68bb10101e6b0a6bb44e9c908ef795fc4af99eae'/>
<id>urn:sha1:68bb10101e6b0a6bb44e9c908ef795fc4af99eae</id>
<content type='text'>
The commit mentioned below causes the ovs_flow_tbl_lookup() function
to be called with the masked key. However, it's supposed to be called
with the unmasked key. This due to the fact that the datapath supports
installing wider flows, and OVS relies on this behavior. For example
if ipv4(src=1.1.1.1/192.0.0.0, dst=1.1.1.2/192.0.0.0) exists, a wider
flow (smaller mask) of ipv4(src=192.1.1.1/128.0.0.0,dst=192.1.1.2/
128.0.0.0) is allowed to be added.

However, if we try to add a wildcard rule, the installation fails:

$ ovs-appctl dpctl/add-flow system@myDP "in_port(1),eth_type(0x0800), \
  ipv4(src=1.1.1.1/192.0.0.0,dst=1.1.1.2/192.0.0.0,frag=no)" 2
$ ovs-appctl dpctl/add-flow system@myDP "in_port(1),eth_type(0x0800), \
  ipv4(src=192.1.1.1/0.0.0.0,dst=49.1.1.2/0.0.0.0,frag=no)" 2
ovs-vswitchd: updating flow table (File exists)

The reason is that the key used to determine if the flow is already
present in the system uses the original key ANDed with the mask.
This results in the IP address not being part of the (miniflow) key,
i.e., being substituted with an all-zero value. When doing the actual
lookup, this results in the key wrongfully matching the first flow,
and therefore the flow does not get installed.

This change reverses the commit below, but rather than having the key
on the stack, it's allocated.

Fixes: 190aa3e77880 ("openvswitch: Fix Frame-size larger than 1024 bytes warning.")

Signed-off-by: Eelco Chaudron &lt;echaudro@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: move the nat function to nf_nat_ovs for ovs and tc</title>
<updated>2022-12-12T10:14:03Z</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2022-12-08T16:56:12Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=ebddb1404900657b7f03a56ee4c34a9d218c4030'/>
<id>urn:sha1:ebddb1404900657b7f03a56ee4c34a9d218c4030</id>
<content type='text'>
There are two nat functions are nearly the same in both OVS and
TC code, (ovs_)ct_nat_execute() and ovs_ct_nat/tcf_ct_act_nat().

This patch creates nf_nat_ovs.c under netfilter and moves them
there then exports nf_ct_nat() so that it can be shared by both
OVS and TC, and keeps the nat (type) check and nat flag update
in OVS and TC's own place, as these parts are different between
OVS and TC.

Note that in OVS nat function it was using skb-&gt;protocol to get
the proto as it already skips vlans in key_extract(), while it
doesn't in TC, and TC has to call skb_protocol() to get proto.
So in nf_ct_nat_execute(), we keep using skb_protocol() which
works for both OVS and TC contrack.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Acked-by: Aaron Conole &lt;aconole@redhat.com&gt;
Acked-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: return NF_DROP when fails to add nat ext in ovs_ct_nat</title>
<updated>2022-12-12T10:14:03Z</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2022-12-08T16:56:10Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=2b85144ab36e0e870f59b5ae55e299179eb8cdb8'/>
<id>urn:sha1:2b85144ab36e0e870f59b5ae55e299179eb8cdb8</id>
<content type='text'>
When it fails to allocate nat ext, the packet should be dropped, like
the memory allocation failures in other places in ovs_ct_nat().

This patch changes to return NF_DROP when fails to add nat ext before
doing NAT in ovs_ct_nat(), also it would keep consistent with tc
action ct' processing in tcf_ct_act_nat().

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Acked-by: Aaron Conole &lt;aconole@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: return NF_ACCEPT when OVS_CT_NAT is not set in info nat</title>
<updated>2022-12-12T10:14:03Z</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2022-12-08T16:56:09Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=7795928921332fdd52c33eab73f1280d5e58678a'/>
<id>urn:sha1:7795928921332fdd52c33eab73f1280d5e58678a</id>
<content type='text'>
Either OVS_CT_SRC_NAT or OVS_CT_DST_NAT is set, OVS_CT_NAT must be
set in info-&gt;nat. Thus, if OVS_CT_NAT is not set in info-&gt;nat, it
will definitely not do NAT but returns NF_ACCEPT in ovs_ct_nat().

This patch changes nothing funcational but only makes this return
earlier in ovs_ct_nat() to keep consistent with TC's processing
in tcf_ct_act_nat().

Reviewed-by: Saeed Mahameed &lt;saeed@kernel.org&gt;
Acked-by: Aaron Conole &lt;aconole@redhat.com&gt;
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: delete the unncessary skb_pull_rcsum call in ovs_ct_nat_execute</title>
<updated>2022-12-12T10:14:03Z</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2022-12-08T16:56:08Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=bf14f4923d516d77320500461c0692c9d4480c30'/>
<id>urn:sha1:bf14f4923d516d77320500461c0692c9d4480c30</id>
<content type='text'>
The calls to ovs_ct_nat_execute() are as below:

  ovs_ct_execute()
    ovs_ct_lookup()
      __ovs_ct_lookup()
        ovs_ct_nat()
          ovs_ct_nat_execute()
    ovs_ct_commit()
      __ovs_ct_lookup()
        ovs_ct_nat()
          ovs_ct_nat_execute()

and since skb_pull_rcsum() and skb_push_rcsum() are already
called in ovs_ct_execute(), there's no need to do it again
in ovs_ct_nat_execute().

Reviewed-by: Saeed Mahameed &lt;saeed@kernel.org&gt;
Acked-by: Aaron Conole &lt;aconole@redhat.com&gt;
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: openvswitch: Add support to count upcall packets</title>
<updated>2022-12-09T10:43:46Z</updated>
<author>
<name>wangchuanlei</name>
<email>wangchuanlei@inspur.com</email>
</author>
<published>2022-12-07T01:38:57Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=1933ea365aa7a48ce26bea2ea09c9f7cc48cc668'/>
<id>urn:sha1:1933ea365aa7a48ce26bea2ea09c9f7cc48cc668</id>
<content type='text'>
Add support to count upall packets, when kmod of openvswitch
upcall to count the number of packets for upcall succeed and
failed, which is a better way to see how many packets upcalled
on every interfaces.

Signed-off-by: wangchuanlei &lt;wangchuanlei@inspur.com&gt;
Acked-by: Eelco Chaudron &lt;echaudro@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2022-11-29T21:04:52Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2022-11-29T21:04:52Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=f2bb566f5c977ff010baaa9e5e14d9a75b06e5f2'/>
<id>urn:sha1:f2bb566f5c977ff010baaa9e5e14d9a75b06e5f2</id>
<content type='text'>
tools/lib/bpf/ringbuf.c
  927cbb478adf ("libbpf: Handle size overflow for ringbuf mmap")
  b486d19a0ab0 ("libbpf: checkpatch: Fixed code alignments in ringbuf.c")
https://lore.kernel.org/all/20221121122707.44d1446a@canb.auug.org.au/

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: Fix data-races around ct mark</title>
<updated>2022-11-18T14:21:00Z</updated>
<author>
<name>Daniel Xu</name>
<email>dxu@dxuuu.xyz</email>
</author>
<published>2022-11-09T19:39:07Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=52d1aa8b8249ff477aaa38b6f74a8ced780d079c'/>
<id>urn:sha1:52d1aa8b8249ff477aaa38b6f74a8ced780d079c</id>
<content type='text'>
nf_conn:mark can be read from and written to in parallel. Use
READ_ONCE()/WRITE_ONCE() for reads and writes to prevent unwanted
compiler optimizations.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Daniel Xu &lt;dxu@dxuuu.xyz&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>net: move add ct helper function to nf_conntrack_helper for ovs and tc</title>
<updated>2022-11-08T11:15:19Z</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2022-11-06T20:34:15Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=f96cba2eb923c025014fe74a50e104b7c5234feb'/>
<id>urn:sha1:f96cba2eb923c025014fe74a50e104b7c5234feb</id>
<content type='text'>
Move ovs_ct_add_helper from openvswitch to nf_conntrack_helper and
rename as nf_ct_add_helper, so that it can be used in TC act_ct in
the next patch.

Acked-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
</feed>
