[ovs-git] [openvswitch/ovs] db7f22: datapath: Refactor ovs_nla_fill_match().

GitHub noreply at github.com
Fri Feb 27 19:05:08 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: db7f2238278e9834e1ba526e44512ba30335075a
      https://github.com/openvswitch/ovs/commit/db7f2238278e9834e1ba526e44512ba30335075a
  Author: Joe Stringer <joestringer at nicira.com>
  Date:   2015-02-27 (Fri, 27 Feb 2015)

  Changed paths:
    M datapath/datapath.c
    M datapath/flow_netlink.c
    M datapath/flow_netlink.h

  Log Message:
  -----------
  datapath: Refactor ovs_nla_fill_match().

Refactor the ovs_nla_fill_match() function into separate netlink
serialization functions ovs_nla_put_{unmasked_key,mask}(). Modify
ovs_nla_put_flow() to handle attribute nesting and expose the 'is_mask'
parameter - all callers need to nest the flow, and callers have better
knowledge about whether it is serializing a mask or not.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>
Signed-off-by: David S. Miller <davem at davemloft.net>


  Commit: 7bdf9b15e34aec9643f6fa98685bc80ec702f5a6
      https://github.com/openvswitch/ovs/commit/7bdf9b15e34aec9643f6fa98685bc80ec702f5a6
  Author: Joe Stringer <joestringer at nicira.com>
  Date:   2015-02-27 (Fri, 27 Feb 2015)

  Changed paths:
    M datapath/flow_table.c

  Log Message:
  -----------
  datapath: Refactor ovs_flow_tbl_insert().

Rework so that ovs_flow_tbl_insert() calls flow_{key,mask}_insert().
This tidies up a future patch.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>
Signed-off-by: David S. Miller <davem at davemloft.net>


  Commit: 0d8e6be8d7d14090f1bbdf78920bb72fe3fba2d9
      https://github.com/openvswitch/ovs/commit/0d8e6be8d7d14090f1bbdf78920bb72fe3fba2d9
  Author: Joe Stringer <joestringer at nicira.com>
  Date:   2015-02-27 (Fri, 27 Feb 2015)

  Changed paths:
    M datapath/flow_table.c

  Log Message:
  -----------
  datapath: Use sw_flow_key_range for key ranges.

These minor tidyups make a future patch a little tidier.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>
Signed-off-by: David S. Miller <davem at davemloft.net>


  Commit: c623ba497a10fc8526d529261453facf227d468e
      https://github.com/openvswitch/ovs/commit/c623ba497a10fc8526d529261453facf227d468e
  Author: Joe Stringer <joestringer at nicira.com>
  Date:   2015-02-27 (Fri, 27 Feb 2015)

  Changed paths:
    M acinclude.m4
    M datapath/linux/compat/include/net/genetlink.h

  Log Message:
  -----------
  compat: Add genlmsg_parse() helper function.

The first user will be the next patch.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>
Signed-off-by: David S. Miller <davem at davemloft.net>


  Commit: bc619e29dfcb0d41607f5bc9002fe9fd046cb919
      https://github.com/openvswitch/ovs/commit/bc619e29dfcb0d41607f5bc9002fe9fd046cb919
  Author: Joe Stringer <joestringer at nicira.com>
  Date:   2015-02-27 (Fri, 27 Feb 2015)

  Changed paths:
    M datapath/datapath.c
    M datapath/flow.h
    M datapath/flow_netlink.c
    M datapath/flow_netlink.h
    M datapath/flow_table.c
    M datapath/flow_table.h
    M datapath/linux/compat/include/linux/openvswitch.h

  Log Message:
  -----------
  datapath: Add support for unique flow IDs.

Previously, flows were manipulated by userspace specifying a full,
unmasked flow key. This adds significant burden onto flow
serialization/deserialization, particularly when dumping flows.

This patch adds an alternative way to refer to flows using a
variable-length "unique flow identifier" (UFID). At flow setup time,
userspace may specify a UFID for a flow, which is stored with the flow
and inserted into a separate table for lookup, in addition to the
standard flow table. Flows created using a UFID must be fetched or
deleted using the UFID.

All flow dump operations may now be made more terse with OVS_UFID_F_*
flags. For example, the OVS_UFID_F_OMIT_KEY flag allows responses to
omit the flow key from a datapath operation if the flow has a
corresponding UFID. This significantly reduces the time spent assembling
and transacting netlink messages. With all OVS_UFID_F_OMIT_* flags
enabled, the datapath only returns the UFID and statistics for each flow
during flow dump, increasing ovs-vswitchd revalidator performance by 40%
or more.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>
Signed-off-by: David S. Miller <davem at davemloft.net>


  Commit: 5f19d8ac86246c886e88eff54bbfca9daf4694b7
      https://github.com/openvswitch/ovs/commit/5f19d8ac86246c886e88eff54bbfca9daf4694b7
  Author: Pravin B Shelar <pshelar at nicira.com>
  Date:   2015-02-27 (Fri, 27 Feb 2015)

  Changed paths:
    M datapath/flow_table.c

  Log Message:
  -----------
  datapath: Initialize unmasked key and uid len.

Flow alloc needs to initialize unmasked key pointer. Otherwise
it can crash kernel trying to free random unmasked-key pointer.

general protection fault: 0000 [#1] SMP
3.19.0-rc6-net-next+ #457
Hardware name: Supermicro X7DWU/X7DWU, BIOS  1.1 04/30/2008
RIP: 0010:[<ffffffff8111df0e>] [<ffffffff8111df0e>] kfree+0xac/0x196
Call Trace:
 [<ffffffffa060bd87>] flow_free+0x21/0x59 [openvswitch]
 [<ffffffffa060bde0>] ovs_flow_free+0x21/0x23 [openvswitch]
 [<ffffffffa0605b4a>] ovs_packet_cmd_execute+0x2f3/0x35f [openvswitch]
 [<ffffffffa0605995>] ? ovs_packet_cmd_execute+0x13e/0x35f [openvswitch]
 [<ffffffff811fe6fb>] ? nla_parse+0x4f/0xec
 [<ffffffff8139a2fc>] genl_family_rcv_msg+0x26d/0x2c9
 [<ffffffff8107620f>] ? __lock_acquire+0x90e/0x9aa
 [<ffffffff8139a3be>] genl_rcv_msg+0x66/0x89
 [<ffffffff8139a358>] ? genl_family_rcv_msg+0x2c9/0x2c9
 [<ffffffff81399591>] netlink_rcv_skb+0x3e/0x95
 [<ffffffff81399898>] ? genl_rcv+0x18/0x37
 [<ffffffff813998a7>] genl_rcv+0x27/0x37
 [<ffffffff81399033>] netlink_unicast+0x103/0x191
 [<ffffffff81399382>] netlink_sendmsg+0x2c1/0x310
 [<ffffffff811007ad>] ? might_fault+0x50/0xa0
 [<ffffffff8135c773>] do_sock_sendmsg+0x5f/0x7a
 [<ffffffff8135c799>] sock_sendmsg+0xb/0xd
 [<ffffffff8135cacf>] ___sys_sendmsg+0x1a3/0x218
 [<ffffffff8113e54b>] ? get_close_on_exec+0x86/0x86
 [<ffffffff8115a9d0>] ? fsnotify+0x32c/0x348
 [<ffffffff8115a720>] ? fsnotify+0x7c/0x348
 [<ffffffff8113e5f5>] ? __fget+0xaa/0xbf
 [<ffffffff8113e54b>] ? get_close_on_exec+0x86/0x86
 [<ffffffff8135cccd>] __sys_sendmsg+0x3d/0x5e
 [<ffffffff8135cd02>] SyS_sendmsg+0x14/0x16
 [<ffffffff81411852>] system_call_fastpath+0x12/0x17

Reported-by: Or Gerlitz <ogerlitz at mellanox.com>
Signed-off-by: Pravin B Shelar <pshelar at nicira.com>


  Commit: b037bc5a463dfb4ff6fa0680068a088c495a7246
      https://github.com/openvswitch/ovs/commit/b037bc5a463dfb4ff6fa0680068a088c495a7246
  Author: Pravin B Shelar <pshelar at nicira.com>
  Date:   2015-02-27 (Fri, 27 Feb 2015)

  Changed paths:
    M datapath/flow_netlink.c

  Log Message:
  -----------
  datapath: Fix masked key serialization.

Fix typo where mask is used rather than key.

Fixes: 74ed7ab9264("openvswitch: Add support for unique flow IDs.")
Reported-by: Joe Stringer <joestringer at nicira.com>
Signed-off-by: Pravin B Shelar <pshelar at nicira.com>


Compare: https://github.com/openvswitch/ovs/compare/2a638b8d22be...b037bc5a463d


More information about the git mailing list