<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/net/openvswitch/datapath.c, branch v4.9.145</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.145</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.145'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2017-08-30T08:21:40Z</updated>
<entry>
<title>openvswitch: fix skb_panic due to the incorrect actions attrlen</title>
<updated>2017-08-30T08:21:40Z</updated>
<author>
<name>Liping Zhang</name>
<email>zlpnobody@gmail.com</email>
</author>
<published>2017-08-16T05:30:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3c7af814def8daf25d827c8ed9e75ddc949e52d2'/>
<id>urn:sha1:3c7af814def8daf25d827c8ed9e75ddc949e52d2</id>
<content type='text'>
[ Upstream commit 494bea39f3201776cdfddc232705f54a0bd210c4 ]

For sw_flow_actions, the actions_len only represents the kernel part's
size, and when we dump the actions to the userspace, we will do the
convertions, so it's true size may become bigger than the actions_len.

But unfortunately, for OVS_PACKET_ATTR_ACTIONS, we use the actions_len
to alloc the skbuff, so the user_skb's size may become insufficient and
oops will happen like this:
  skbuff: skb_over_panic: text:ffffffff8148fabf len:1749 put:157 head:
  ffff881300f39000 data:ffff881300f39000 tail:0x6d5 end:0x6c0 dev:&lt;NULL&gt;
  ------------[ cut here ]------------
  kernel BUG at net/core/skbuff.c:129!
  [...]
  Call Trace:
   &lt;IRQ&gt;
   [&lt;ffffffff8148be82&gt;] skb_put+0x43/0x44
   [&lt;ffffffff8148fabf&gt;] skb_zerocopy+0x6c/0x1f4
   [&lt;ffffffffa0290d36&gt;] queue_userspace_packet+0x3a3/0x448 [openvswitch]
   [&lt;ffffffffa0292023&gt;] ovs_dp_upcall+0x30/0x5c [openvswitch]
   [&lt;ffffffffa028d435&gt;] output_userspace+0x132/0x158 [openvswitch]
   [&lt;ffffffffa01e6890&gt;] ? ip6_rcv_finish+0x74/0x77 [ipv6]
   [&lt;ffffffffa028e277&gt;] do_execute_actions+0xcc1/0xdc8 [openvswitch]
   [&lt;ffffffffa028e3f2&gt;] ovs_execute_actions+0x74/0x106 [openvswitch]
   [&lt;ffffffffa0292130&gt;] ovs_dp_process_packet+0xe1/0xfd [openvswitch]
   [&lt;ffffffffa0292b77&gt;] ? key_extract+0x63c/0x8d5 [openvswitch]
   [&lt;ffffffffa029848b&gt;] ovs_vport_receive+0xa1/0xc3 [openvswitch]
  [...]

Also we can find that the actions_len is much little than the orig_len:
  crash&gt; struct sw_flow_actions 0xffff8812f539d000
  struct sw_flow_actions {
    rcu = {
      next = 0xffff8812f5398800,
      func = 0xffffe3b00035db32
    },
    orig_len = 1384,
    actions_len = 592,
    actions = 0xffff8812f539d01c
  }

So as a quick fix, use the orig_len instead of the actions_len to alloc
the user_skb.

Last, this oops happened on our system running a relative old kernel, but
the same risk still exists on the mainline, since we use the wrong
actions_len from the beginning.

Fixes: ccea74457bbd ("openvswitch: include datapath actions with sampled-packet upcall to userspace")
Cc: Neil McKee &lt;neil.mckee@inmon.com&gt;
Signed-off-by: Liping Zhang &lt;zlpnobody@gmail.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>openvswitch: avoid resetting flow key while installing new flow.</title>
<updated>2016-09-21T02:54:35Z</updated>
<author>
<name>pravin shelar</name>
<email>pshelar@ovn.org</email>
</author>
<published>2016-09-19T20:51:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2279994d07ab67ff7a1d09bfbd65588332dfb6d8'/>
<id>urn:sha1:2279994d07ab67ff7a1d09bfbd65588332dfb6d8</id>
<content type='text'>
since commit commit db74a3335e0f6 ("openvswitch: use percpu
flow stats") flow alloc resets flow-key. So there is no need
to reset the flow-key again if OVS is using newly allocated
flow-key.

Signed-off-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: Fix Frame-size larger than 1024 bytes warning.</title>
<updated>2016-09-21T02:54:35Z</updated>
<author>
<name>pravin shelar</name>
<email>pshelar@ovn.org</email>
</author>
<published>2016-09-19T20:50:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=190aa3e77880a05332ea1ccb382a51285d57adb5'/>
<id>urn:sha1:190aa3e77880a05332ea1ccb382a51285d57adb5</id>
<content type='text'>
There is no need to declare separate key on stack,
we can just use sw_flow-&gt;key to store the key directly.

This commit fixes following warning:

net/openvswitch/datapath.c: In function ‘ovs_flow_cmd_new’:
net/openvswitch/datapath.c:1080:1: warning: the frame size of 1040 bytes
is larger than 1024 bytes [-Wframe-larger-than=]

Signed-off-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: use alias for genetlink family names</title>
<updated>2016-09-11T04:42:46Z</updated>
<author>
<name>Thadeu Lima de Souza Cascardo</name>
<email>cascardo@redhat.com</email>
</author>
<published>2016-09-09T20:42:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ed227099dac95128e2aecd62af51bb9d922e5977'/>
<id>urn:sha1:ed227099dac95128e2aecd62af51bb9d922e5977</id>
<content type='text'>
When userspace tries to create datapaths and the module is not loaded,
it will simply fail. With this patch, the module will be automatically
loaded.

Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@redhat.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: Add packet len info to upcall.</title>
<updated>2016-06-22T20:34:39Z</updated>
<author>
<name>William Tu</name>
<email>u9012063@gmail.com</email>
</author>
<published>2016-06-20T14:26:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b95e5928fcc76d156352570858abdea7b2628efd'/>
<id>urn:sha1:b95e5928fcc76d156352570858abdea7b2628efd</id>
<content type='text'>
The commit f2a4d086ed4c ("openvswitch: Add packet truncation support.")
introduces packet truncation before sending to userspace upcall receiver.
This patch passes up the skb-&gt;len before truncation so that the upcall
receiver knows the original packet size. Potentially this will be used
by sFlow, where OVS translates sFlow config header=N to a sample action,
truncating packet to N byte in kernel datapath. Thus, only N bytes instead
of full-packet size is copied from kernel to userspace, saving the
kernel-to-userspace bandwidth.

Signed-off-by: William Tu &lt;u9012063@gmail.com&gt;
Cc: Pravin Shelar &lt;pshelar@nicira.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: Add packet truncation support.</title>
<updated>2016-06-11T00:58:03Z</updated>
<author>
<name>William Tu</name>
<email>u9012063@gmail.com</email>
</author>
<published>2016-06-10T18:49:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f2a4d086ed4c588d32fe9b7aa67fead7280e7bf1'/>
<id>urn:sha1:f2a4d086ed4c588d32fe9b7aa67fead7280e7bf1</id>
<content type='text'>
The patch adds a new OVS action, OVS_ACTION_ATTR_TRUNC, in order to
truncate packets. A 'max_len' is added for setting up the maximum
packet size, and a 'cutlen' field is to record the number of bytes
to trim the packet when the packet is outputting to a port, or when
the packet is sent to userspace.

Signed-off-by: William Tu &lt;u9012063@gmail.com&gt;
Cc: Pravin Shelar &lt;pshelar@nicira.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ovs: align nlattr properly when needed</title>
<updated>2016-04-26T16:00:48Z</updated>
<author>
<name>Nicolas Dichtel</name>
<email>nicolas.dichtel@6wind.com</email>
</author>
<published>2016-04-26T08:06:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=66c7a5ee1a6b7c69d41dfd68d207fdd54efba56a'/>
<id>urn:sha1:66c7a5ee1a6b7c69d41dfd68d207fdd54efba56a</id>
<content type='text'>
I also fix commit 8b32ab9e6ef1: use nla_total_size_64bit() for
OVS_FLOW_ATTR_USED in ovs_flow_cmd_msg_size().

Fixes: 8b32ab9e6ef1 ("ovs: use nla_put_u64_64bit()")
Signed-off-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ovs: use nla_put_u64_64bit()</title>
<updated>2016-04-25T19:09:10Z</updated>
<author>
<name>Nicolas Dichtel</name>
<email>nicolas.dichtel@6wind.com</email>
</author>
<published>2016-04-25T08:25:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0238b7204b7ff1bad1d2d4489f010d670cbd89f2'/>
<id>urn:sha1:0238b7204b7ff1bad1d2d4489f010d670cbd89f2</id>
<content type='text'>
Signed-off-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ovs: allow nl 'flow set' to use ufid without flow key</title>
<updated>2016-03-14T02:18:26Z</updated>
<author>
<name>Samuel Gauthier</name>
<email>samuel.gauthier@6wind.com</email>
</author>
<published>2016-03-10T16:14:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6f15cdbf8a8ac2e22767cc8b1eae225702733c95'/>
<id>urn:sha1:6f15cdbf8a8ac2e22767cc8b1eae225702733c95</id>
<content type='text'>
When we want to change a flow using netlink, we have to identify it to
be able to perform a lookup. Both the flow key and unique flow ID
(ufid) are valid identifiers, but we always have to specify the flow
key in the netlink message. When both attributes are there, the ufid
is used. The flow key is used to validate the actions provided by
the userland.

This commit allows to use the ufid without having to provide the flow
key, as it is already done in the netlink 'flow get' and 'flow del'
path. The flow key remains mandatory when an action is provided.

Signed-off-by: Samuel Gauthier &lt;samuel.gauthier@6wind.com&gt;
Reviewed-by: Simon Horman &lt;simon.horman@netronome.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ovs: propagate per dp max headroom to all vports</title>
<updated>2016-03-01T20:54:30Z</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2016-02-26T09:45:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3a927bc7cf9d0fbe8f4a8189dd5f8440228f64e7'/>
<id>urn:sha1:3a927bc7cf9d0fbe8f4a8189dd5f8440228f64e7</id>
<content type='text'>
This patch implements bookkeeping support to compute the maximum
headroom for all the devices in each datapath. When said value
changes, the underlying devs are notified via the
ndo_set_rx_headroom method.

This also increases the internal vports xmit performance.

Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
