[ovs-git] [openvswitch/ovs] 5821a5: datapath: return an error instead of doing BUG_ON()

leiw-mlnx noreply at github.com
Mon Oct 19 12:53:25 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 5821a592a4d73ea3466d5b2b051181c6e71d3c8a
      https://github.com/openvswitch/ovs/commit/5821a592a4d73ea3466d5b2b051181c6e71d3c8a
  Author: Eelco Chaudron <echaudro at redhat.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: return an error instead of doing BUG_ON()

Upstream commit:
    commit a734d1f4c2fc962ef4daa179e216df84a8ec5f84
    Author: Eelco Chaudron <echaudro at redhat.com>
    Date:   Thu May 2 16:12:38 2019 -0400

    net: openvswitch: return an error instead of doing BUG_ON()

    For all other error cases in queue_userspace_packet() the error is
    returned, so it makes sense to do the same for these two error cases.

    Reported-by: Davide Caratti <dcaratti at redhat.com>
    Signed-off-by: Eelco Chaudron <echaudro at redhat.com>
    Acked-by: Flavio Leitner <fbl at sysclose.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Acked-by: Eelco Chaudron <echaudro at redhat.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: fa764e8fb10cb02e602a79e0951456f8000e01f4
      https://github.com/openvswitch/ovs/commit/fa764e8fb10cb02e602a79e0951456f8000e01f4
  Author: Enrico Weigelt <info at metux.net>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: drop unneeded likely() call around IS_ERR()

Upstream commit:
    commit b90f5aa4d6268e81dd1fd51e5ef89d2892bf040d
    Author: Enrico Weigelt <info at metux.net>
    Date:   Wed Jun 5 23:06:40 2019 +0200

    net: openvswitch: drop unneeded likely() call around IS_ERR()

    IS_ERR() already calls unlikely(), so this extra likely() call
    around the !IS_ERR() is not needed.

    Signed-off-by: Enrico Weigelt <info at metux.net>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: ec335e0b74e4811ff504a83e00c8379bb2b0485b
      https://github.com/openvswitch/ovs/commit/ec335e0b74e4811ff504a83e00c8379bb2b0485b
  Author: Taehee Yoo <ap420073 at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: do not update max_headroom if new headroom is equal to old headroom

Upstream commit:
    commit 6b660c4177aaebdc73df7a3378f0e8b110aa4b51
    Author: Taehee Yoo <ap420073 at gmail.com>
    Date:   Sat Jul 6 01:08:09 2019 +0900

    net: openvswitch: do not update max_headroom if new headroom is equal to old headroom

    When a vport is deleted, the maximum headroom size would be changed.
    If the vport which has the largest headroom is deleted,
    the new max_headroom would be set.
    But, if the new headroom size is equal to the old headroom size,
    updating routine is unnecessary.

    Signed-off-by: Taehee Yoo <ap420073 at gmail.com>
    Tested-by: Greg Rose <gvrose8192 at gmail.com>
    Reviewed-by: Greg Rose <gvrose8192 at gmail.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 381a020b4883e41686d7a4a85582755cb6fce088
      https://github.com/openvswitch/ovs/commit/381a020b4883e41686d7a4a85582755cb6fce088
  Author: Yifeng Sun <pkusunyifeng at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: Print error when ovs_execute_actions() fails

Upstream commit:
    commit aa733660dbd8d9192b8c528ae0f4b84f3fef74e4
    Author: Yifeng Sun <pkusunyifeng at gmail.com>
    Date:   Sun Aug 4 19:56:11 2019 -0700

    openvswitch: Print error when ovs_execute_actions() fails

    Currently in function ovs_dp_process_packet(), return values of
    ovs_execute_actions() are silently discarded. This patch prints out
    an debug message when error happens so as to provide helpful hints
    for debugging.
    Acked-by: Pravin B Shelar <pshelar at ovn.org>

    Signed-off-by: David S. Miller <davem at davemloft.net>

Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: dca968421f89dfb3e8294c7621f918eb690390aa
      https://github.com/openvswitch/ovs/commit/dca968421f89dfb3e8294c7621f918eb690390aa
  Author: Paul Blakey <paulb at mellanox.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M acinclude.m4
    M datapath/datapath.c
    M datapath/datapath.h
    M datapath/flow.c
    M datapath/linux/compat/include/linux/static_key.h

  Log Message:
  -----------
  datapath: Set OvS recirc_id from tc chain index

Upstream commit:
    commit 95a7233c452a58a4c2310c456c73997853b2ec46
    Author: Paul Blakey <paulb at mellanox.com>
    Date:   Wed Sep 4 16:56:37 2019 +0300

    net: openvswitch: Set OvS recirc_id from tc chain index

    Offloaded OvS datapath rules are translated one to one to tc rules,
    for example the following simplified OvS rule:

    recirc_id(0),in_port(dev1),eth_type(0x0800),ct_state(-trk) actions:ct(),recirc(2)

    Will be translated to the following tc rule:

    $ tc filter add dev dev1 ingress \
                prio 1 chain 0 proto ip \
                    flower tcp ct_state -trk \
                    action ct pipe \
                    action goto chain 2

    Received packets will first travel though tc, and if they aren't stolen
    by it, like in the above rule, they will continue to OvS datapath.
    Since we already did some actions (action ct in this case) which might
    modify the packets, and updated action stats, we would like to continue
    the proccessing with the correct recirc_id in OvS (here recirc_id(2))
    where we left off.

    To support this, introduce a new skb extension for tc, which
    will be used for translating tc chain to ovs recirc_id to
    handle these miss cases. Last tc chain index will be set
    by tc goto chain action and read by OvS datapath.

    Signed-off-by: Paul Blakey <paulb at mellanox.com>
    Signed-off-by: Vlad Buslov <vladbu at mellanox.com>
    Acked-by: Jiri Pirko <jiri at mellanox.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Backport the local datapath changes from this patch and add compat
layer fixup for the DECLARE_STATIC_KEY_FALSE macro.

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: b7465cac76fdcef5e6437ec538dd234a26a6fd45
      https://github.com/openvswitch/ovs/commit/b7465cac76fdcef5e6437ec538dd234a26a6fd45
  Author: Guillaume Nault <gnault at redhat.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: fix GFP flags in rtnl_net_notifyid()

Upstream commit:
    commit d4e4fdf9e4a27c87edb79b1478955075be141f67
    Author: Guillaume Nault <gnault at redhat.com>
    Date:   Wed Oct 23 18:39:04 2019 +0200

    netns: fix GFP flags in rtnl_net_notifyid()

    In rtnl_net_notifyid(), we certainly can't pass a null GFP flag to
    rtnl_notify(). A GFP_KERNEL flag would be fine in most circumstances,
    but there are a few paths calling rtnl_net_notifyid() from atomic
    context or from RCU critical sections. The later also precludes the use
    of gfp_any() as it wouldn't detect the RCU case. Also, the nlmsg_new()
    call is wrong too, as it uses GFP_KERNEL unconditionally.

    Therefore, we need to pass the GFP flags as parameter and propagate it
    through function calls until the proper flags can be determined.

    In most cases, GFP_KERNEL is fine. The exceptions are:
      * openvswitch: ovs_vport_cmd_get() and ovs_vport_cmd_dump()
        indirectly call rtnl_net_notifyid() from RCU critical section,

      * rtnetlink: rtmsg_ifinfo_build_skb() already receives GFP flags as
        parameter.

    Also, in ovs_vport_cmd_build_info(), let's change the GFP flags used
    by nlmsg_new(). The function is allowed to sleep, so better make the
    flags consistent with the ones used in the following
    ovs_vport_cmd_fill_info() call.

    Found by code inspection.

    Fixes: 9a9634545c70 ("netns: notify netns id events")
    Signed-off-by: Guillaume Nault <gnault at redhat.com>
    Acked-by: Nicolas Dichtel <nicolas.dichtel at 6wind.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Backport the datapath.c portion of this fix.

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: c07157ca26b5523a9301e375c34d331ecf99d53b
      https://github.com/openvswitch/ovs/commit/c07157ca26b5523a9301e375c34d331ecf99d53b
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: don't unlock mutex when changing the user_features fails

Upstream commit:
    commit 4c76bf696a608ea5cc555fe97ec59a9033236604
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Fri Nov 1 22:23:53 2019 +0800

    net: openvswitch: don't unlock mutex when changing the user_features fails

    Unlocking of a not locked mutex is not allowed.
    Other kernel thread may be in critical section while
    we unlock it because of setting user_feature fail.

    Fixes: 95a7233c4 ("net: openvswitch: Set OvS recirc_id from tc chain index")
    Cc: Paul Blakey <paulb at mellanox.com>
    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Tested-by: Greg Rose <gvrose8192 at gmail.com>
    Acked-by: William Tu <u9012063 at gmail.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: fef7abfc05ae642b7759603c28021f510a3b9b38
      https://github.com/openvswitch/ovs/commit/fef7abfc05ae642b7759603c28021f510a3b9b38
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/flow_table.c

  Log Message:
  -----------
  datapath: optimize flow-mask looking up

Upstream commit:
    commit 57f7d7b9164426c496300d254fd5167fbbf205ea
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Fri Nov 1 22:23:49 2019 +0800

    net: openvswitch: optimize flow-mask looking up

    The full looking up on flow table traverses all mask array.
    If mask-array is too large, the number of invalid flow-mask
    increase, performance will be drop.

    One bad case, for example: M means flow-mask is valid and NULL
    of flow-mask means deleted.

    +-------------------------------------------+
    | M | NULL | ...                  | NULL | M|
    +-------------------------------------------+

    In that case, without this patch, openvswitch will traverses all
    mask array, because there will be one flow-mask in the tail. This
    patch changes the way of flow-mask inserting and deleting, and the
    mask array will be keep as below: there is not a NULL hole. In the
    fast path, we can "break" "for" (not "continue") in flow_lookup
    when we get a NULL flow-mask.

             "break"
                v
    +-------------------------------------------+
    | M | M |  NULL |...           | NULL | NULL|
    +-------------------------------------------+

    This patch don't optimize slow or control path, still using ma->max
    to traverse. Slow path:
    * tbl_mask_array_realloc
    * ovs_flow_tbl_lookup_exact
    * flow_mask_find

    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Tested-by: Greg Rose <gvrose8192 at gmail.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: cdc58fe7d290cd0990e15ca10df1ad5b312b01d7
      https://github.com/openvswitch/ovs/commit/cdc58fe7d290cd0990e15ca10df1ad5b312b01d7
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/flow_table.c

  Log Message:
  -----------
  datapath: simplify the flow_hash

Upstream commit:
    commit 515b65a4b99197ae062a795ab4de919e6d04be04
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Fri Nov 1 22:23:50 2019 +0800

    net: openvswitch: simplify the flow_hash

    Simplify the code and remove the unnecessary BUILD_BUG_ON.

    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Tested-by: Greg Rose <gvrose8192 at gmail.com>
    Acked-by: William Tu <u9012063 at gmail.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: e5466316984d84dfeabbcf6254f207caaff06f7d
      https://github.com/openvswitch/ovs/commit/e5466316984d84dfeabbcf6254f207caaff06f7d
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/flow_table.c

  Log Message:
  -----------
  datapath: add likely in flow_lookup

Upstream commit:
    commit 0a3e01371db17d753dd92ec4d0fc6247412d3b01
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Fri Nov 1 22:23:51 2019 +0800

    net: openvswitch: add likely in flow_lookup

    The most case *index < ma->max, and flow-mask is not NULL.
    We add un/likely for performance.

    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Tested-by: Greg Rose <gvrose8192 at gmail.com>
    Acked-by: William Tu <u9012063 at gmail.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 6d1cf7f3e51f845cd306efcee7efb81de1616265
      https://github.com/openvswitch/ovs/commit/6d1cf7f3e51f845cd306efcee7efb81de1616265
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/flow_table.c
    M datapath/linux/compat/include/linux/compiler.h

  Log Message:
  -----------
  datapath: fix possible memleak on destroy flow-table

Upstream commit:
    commit 50b0e61b32ee890a75b4377d5fbe770a86d6a4c1
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Fri Nov 1 22:23:52 2019 +0800

    net: openvswitch: fix possible memleak on destroy flow-table

    When we destroy the flow tables which may contain the flow_mask,
    so release the flow mask struct.

    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Tested-by: Greg Rose <gvrose8192 at gmail.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Added additional compat layer fixup for WRITE_ONCE()

Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: a3839b264636f30e34e2028ef7c802235b759565
      https://github.com/openvswitch/ovs/commit/a3839b264636f30e34e2028ef7c802235b759565
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: simplify the ovs_dp_cmd_new

Upstream commit:
    commit eec62eadd1d757b0743ccbde55973814f3ad396e
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Fri Nov 1 22:23:54 2019 +0800

    net: openvswitch: simplify the ovs_dp_cmd_new

    use the specified functions to init resource.

    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Tested-by: Greg Rose <gvrose8192 at gmail.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 825634866e95d4e9533d6dafb8d8eccc5f80a3ed
      https://github.com/openvswitch/ovs/commit/825634866e95d4e9533d6dafb8d8eccc5f80a3ed
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/vport.c

  Log Message:
  -----------
  datapath: select vport upcall portid directly

Upstream commit:
    commit 90ce9f23a886bdef7a4b7a9bd52c7a50a6a81635
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Thu Nov 7 00:34:28 2019 +0800

    net: openvswitch: select vport upcall portid directly

    The commit 69c51582ff786 ("dpif-netlink: don't allocate per
    thread netlink sockets"), in Open vSwitch ovs-vswitchd, has
    changed the number of allocated sockets to just one per port
    by moving the socket array from a per handler structure to
    a per datapath one. In the kernel datapath, a vport will have
    only one socket in most case, if so select it directly in
    fast-path.

    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 11047d57d797e079d0bbb9e5827817ebf1c08551
      https://github.com/openvswitch/ovs/commit/11047d57d797e079d0bbb9e5827817ebf1c08551
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: don't call pad_packet if not necessary

Upstream commit:
    commit 61ca533c0e94104c35fcb7858a23ec9a05d78143
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Thu Nov 14 23:51:08 2019 +0800

    net: openvswitch: don't call pad_packet if not necessary

    The nla_put_u16/nla_put_u32 makes sure that
    *attrlen is align. The call tree is that:

    nla_put_u16/nla_put_u32
      -> nla_put		attrlen = sizeof(u16) or sizeof(u32)
      -> __nla_put		attrlen
      -> __nla_reserve	attrlen
      -> skb_put(skb, nla_total_size(attrlen))

    nla_total_size returns the total length of attribute
    including padding.

    Cc: Joe Stringer <joe at ovn.org>
    Cc: William Tu <u9012063 at gmail.com>
    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 244674ed7cdd9a0c5e1d212e01b1e4fefbb6a32d
      https://github.com/openvswitch/ovs/commit/244674ed7cdd9a0c5e1d212e01b1e4fefbb6a32d
  Author: Paolo Abeni <pabeni at redhat.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: fix flow command message size

Upstream commit:
    commit 4e81c0b3fa93d07653e2415fa71656b080a112fd
    Author: Paolo Abeni <pabeni at redhat.com>
    Date:   Tue Nov 26 12:55:50 2019 +0100

    openvswitch: fix flow command message size

    When user-space sets the OVS_UFID_F_OMIT_* flags, and the relevant
    flow has no UFID, we can exceed the computed size, as
    ovs_nla_put_identifier() will always dump an OVS_FLOW_ATTR_KEY
    attribute.
    Take the above in account when computing the flow command message
    size.

    Fixes: 74ed7ab9264c ("openvswitch: Add support for unique flow IDs.")
    Reported-by: Qi Jun Ding <qding at redhat.com>
    Signed-off-by: Paolo Abeni <pabeni at redhat.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 90b36b02115f1e82684b571936aa4802b170964f
      https://github.com/openvswitch/ovs/commit/90b36b02115f1e82684b571936aa4802b170964f
  Author: Paolo Abeni <pabeni at redhat.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: drop unneeded BUG_ON() in ovs_flow_cmd_build_info()

Upstream commit:
    commit 8ffeb03fbba3b599690b361467bfd2373e8c450f
    Author: Paolo Abeni <pabeni at redhat.com>
    Date:   Sun Dec 1 18:41:24 2019 +0100

    openvswitch: drop unneeded BUG_ON() in ovs_flow_cmd_build_info()

    All the callers of ovs_flow_cmd_build_info() already deal with
    error return code correctly, so we can handle the error condition
    in a more gracefull way. Still dump a warning to preserve
    debuggability.

    v1 -> v2:
     - clarify the commit message
     - clean the skb and report the error (DaveM)

    Fixes: ccb1352e76cf ("net: Add Open vSwitch kernel components.")
    Signed-off-by: Paolo Abeni <pabeni at redhat.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 096043f436f831581aa8264cafbac3d7fc899d96
      https://github.com/openvswitch/ovs/commit/096043f436f831581aa8264cafbac3d7fc899d96
  Author: Paolo Abeni <pabeni at redhat.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: remove another BUG_ON()

Upstream commit:
    commit 8a574f86652a4540a2433946ba826ccb87f398cc
    Author: Paolo Abeni <pabeni at redhat.com>
    Date:   Sun Dec 1 18:41:25 2019 +0100

    openvswitch: remove another BUG_ON()

    If we can't build the flow del notification, we can simply delete
    the flow, no need to crash the kernel. Still keep a WARN_ON to
    preserve debuggability.

    Note: the BUG_ON() predates the Fixes tag, but this change
    can be applied only after the mentioned commit.

    v1 -> v2:
     - do not leak an skb on error

    Fixes: aed067783e50 ("openvswitch: Minimize ovs_flow_cmd_del critical section.")
    Signed-off-by: Paolo Abeni <pabeni at redhat.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 6a101a6c8372570a30e0f8edb558c8a69cc80e7d
      https://github.com/openvswitch/ovs/commit/6a101a6c8372570a30e0f8edb558c8a69cc80e7d
  Author: aaron conole <aconole at redhat.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/conntrack.c

  Log Message:
  -----------
  datapath: support asymmetric conntrack

Upstream commit:
    commit 5d50aa83e2c8e91ced2cca77c198b468ca9210f4
    author: aaron conole <aconole at redhat.com>
    date:   tue dec 3 16:34:13 2019 -0500

    openvswitch: support asymmetric conntrack

    the openvswitch module shares a common conntrack and nat infrastructure
    exposed via netfilter.  it's possible that a packet needs both snat and
    dnat manipulation, due to e.g. tuple collision.  netfilter can support
    this because it runs through the nat table twice - once on ingress and
    again after egress.  the openvswitch module doesn't have such capability.

    like netfilter hook infrastructure, we should run through nat twice to
    keep the symmetry.

    fixes: 05752523e565 ("openvswitch: interface with nat.")
    signed-off-by: aaron conole <aconole at redhat.com>
    signed-off-by: david s. miller <davem at davemloft.net>

Fixes: c5f6c06b58d6 ("datapath: Interface with NAT.")
Acked-by: Aaron Conole <aconole at redhat.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: c225ff05e02c61d18cebdebd644bb8166a464090
      https://github.com/openvswitch/ovs/commit/c225ff05e02c61d18cebdebd644bb8166a464090
  Author: Jason A. Donenfeld <Jason at zx2c4.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/datapath.c
    M datapath/linux/compat/include/linux/skbuff.h

  Log Message:
  -----------
  datapath: use skb_list_walk_safe helper for gso segments

Upstream commit:
    commit 2cec4448db38758832c2edad439f99584bb8fa0d
    Author: Jason A. Donenfeld <Jason at zx2c4.com>
    Date:   Mon Jan 13 18:42:29 2020 -0500

    net: openvswitch: use skb_list_walk_safe helper for gso segments

    This is a straight-forward conversion case for the new function, keeping
    the flow of the existing code as intact as possible.

    Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 577550b14c65b8b74ee35e15307acee8d4510c34
      https://github.com/openvswitch/ovs/commit/577550b14c65b8b74ee35e15307acee8d4510c34
  Author: Kees Cook <keescook at chromium.org>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/flow_netlink.c

  Log Message:
  -----------
  datapath: Distribute switch variables for initialization

Upstream commit:
    commit 16a556eeb7ed2dc3709fe2c5be76accdfa4901ab
    Author: Kees Cook <keescook at chromium.org>
    Date:   Wed Feb 19 22:23:09 2020 -0800

    openvswitch: Distribute switch variables for initialization

    Variables declared in a switch statement before any case statements
    cannot be automatically initialized with compiler instrumentation (as
    they are not part of any execution flow). With GCC's proposed automatic
    stack variable initialization feature, this triggers a warning (and they
    don't get initialized). Clang's automatic stack variable initialization
    (via CONFIG_INIT_STACK_ALL=y) doesn't throw a warning, but it also
    doesn't initialize such variables[1]. Note that these warnings (or silent
    skipping) happen before the dead-store elimination optimization phase,
    so even when the automatic initializations are later elided in favor of
    direct initializations, the warnings remain.

    To avoid these problems, move such variables into the "case" where
    they're used or lift them up into the main function body.

    net/openvswitch/flow_netlink.c: In function ‘validate_set’:
    net/openvswitch/flow_netlink.c:2711:29: warning: statement will never be executed [-Wswitch-unreachable]
     2711 |  const struct ovs_key_ipv4 *ipv4_key;
          |                             ^~~~~~~~

    [1] https://bugs.llvm.org/show_bug.cgi?id=44916

    Signed-off-by: Kees Cook <keescook at chromium.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: afe7210161854078e9f1af2a575d9acacc5a0101
      https://github.com/openvswitch/ovs/commit/afe7210161854078e9f1af2a575d9acacc5a0101
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M datapath/flow_table.c

  Log Message:
  -----------
  datapath: use hlist_for_each_entry_rcu instead of hlist_for_each_entry

Upstream commit:
    commit 64948427a63f49dd0ce403388d232f22cc1971a8
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Thu Mar 26 04:27:24 2020 +0800

    net: openvswitch: use hlist_for_each_entry_rcu instead of hlist_for_each_entry

    The struct sw_flow is protected by RCU, when traversing them,
    use hlist_for_each_entry_rcu.

    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Tested-by: Greg Rose <gvrose8192 at gmail.com>
    Reviewed-by: Greg Rose <gvrose8192 at gmail.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Compat fixup - OVS doesn't support lockdep_ovsl_is_held() yet

Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 44722d58c40b030a4e962ded447aa9670b6573b5
      https://github.com/openvswitch/ovs/commit/44722d58c40b030a4e962ded447aa9670b6573b5
  Author: Greg Rose <gvrose8192 at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M acinclude.m4

  Log Message:
  -----------
  acinclude: Enable builds up to Linux 5.8

Allow building openvswitch against Linux kernels up to and including
version 5.8.

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: dbb0b86da76186458c31bdbc9b59ab801229c906
      https://github.com/openvswitch/ovs/commit/dbb0b86da76186458c31bdbc9b59ab801229c906
  Author: Greg Rose <gvrose8192 at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M .travis.yml

  Log Message:
  -----------
  travis: Update kernel list as of 5.8

Update the list to more closely track the LTS releases on kernel.org.

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: f3b345bdd2ccf12b5fca496e76aee242f0d2ef7c
      https://github.com/openvswitch/ovs/commit/f3b345bdd2ccf12b5fca496e76aee242f0d2ef7c
  Author: Greg Rose <gvrose8192 at gmail.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M Documentation/faq/releases.rst
    M NEWS

  Log Message:
  -----------
  Documentation: Update faq and NEWS for kernel 5.8

Update the NEWS and faq now that we will support up to Linux kernel
5.8.

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 07d5758b032bc774d1e38fc79eaf356ea9302bdf
      https://github.com/openvswitch/ovs/commit/07d5758b032bc774d1e38fc79eaf356ea9302bdf
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M vswitchd/bridge.c
    M vswitchd/vswitch.xml

  Log Message:
  -----------
  bond: Fix using uninitialized 'lacp_fallback_ab_cfg' for 'bond-primary'.

's->lacp_fallback_ab_cfg' initialized down below in the code, so
we're using it uninitialized to detect if we need to get 'bond-primary'
configuration.

Found by valgrind:

 Conditional jump or move depends on uninitialised value(s)
    at 0x409114: port_configure_bond (bridge.c:4569)
    by 0x409114: port_configure (bridge.c:1284)
    by 0x40F6E6: bridge_reconfigure (bridge.c:917)
    by 0x411425: bridge_run (bridge.c:3330)
    by 0x406D84: main (ovs-vswitchd.c:127)
  Uninitialised value was created by a stack allocation
    at 0x408C53: port_configure (bridge.c:1190)

Fix that by moving this code to the point where 'lacp_fallback_ab_cfg'
already initialized.  Additionally clarified behavior of 'bond-primary'
in manpages for the fallback to AB case.

Fixes: b4e50218a0f8 ("bond: Add 'primary' interface concept for active-backup mode.")
Acked-by: Jeff Squyres <jsquyres at cisco.com>
Acked-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 51dec40f8e9d54c06d063e021fa549f401402f78
      https://github.com/openvswitch/ovs/commit/51dec40f8e9d54c06d063e021fa549f401402f78
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M lib/ofp-ed-props.c
    M tests/ofp-actions.at

  Log Message:
  -----------
  ofp-ed-props: Fix using uninitialized padding for NSH encap actions.

OVS uses memcmp to compare actions of existing and new flows, but
'struct ofp_ed_prop_nsh_md_type' and corresponding ofpact structure has
3 bytes of padding that never initialized and passed around within OF
data structures and messages.

  Uninitialized bytes in MemcmpInterceptorCommon
    at offset 21 inside [0x7090000003f8, 136)
  WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x4a184e in bcmp (vswitchd/ovs-vswitchd+0x4a184e)
    #1 0x896c8a in ofpacts_equal lib/ofp-actions.c:9121:31
    #2 0x564403 in replace_rule_finish ofproto/ofproto.c:5650:37
    #3 0x563462 in add_flow_finish ofproto/ofproto.c:5218:13
    #4 0x54a1ff in ofproto_flow_mod_finish ofproto/ofproto.c:8091:17
    #5 0x5433b2 in handle_flow_mod__ ofproto/ofproto.c:6216:17
    #6 0x56a2fc in handle_flow_mod ofproto/ofproto.c:6190:17
    #7 0x565bda in handle_single_part_openflow ofproto/ofproto.c:8504:16
    #8 0x540b25 in handle_openflow ofproto/ofproto.c:8685:21
    #9 0x6697fd in ofconn_run ofproto/connmgr.c:1329:13
    #10 0x668e6e in connmgr_run ofproto/connmgr.c:356:9
    #11 0x53f1bc in ofproto_run ofproto/ofproto.c:1890:5
    #12 0x4ead0c in bridge_run__ vswitchd/bridge.c:3250:9
    #13 0x4e9bc8 in bridge_run vswitchd/bridge.c:3309:5
    #14 0x51c072 in main vswitchd/ovs-vswitchd.c:127:9
    #15 0x7f23a99011a2 in __libc_start_main (/lib64/libc.so.6)
    #16 0x46b92d in _start (vswitchd/ovs-vswitchd+0x46b92d)

  Uninitialized value was stored to memory at
    #0 0x4745aa in __msan_memcpy.part.0 (vswitchd/ovs-vswitchd)
    #1 0x54529f in rule_actions_create ofproto/ofproto.c:3134:5
    #2 0x54915e in ofproto_rule_create ofproto/ofproto.c:5284:11
    #3 0x55d419 in add_flow_init ofproto/ofproto.c:5123:17
    #4 0x54841f in ofproto_flow_mod_init ofproto/ofproto.c:7987:17
    #5 0x543250 in handle_flow_mod__ ofproto/ofproto.c:6206:13
    #6 0x56a2fc in handle_flow_mod ofproto/ofproto.c:6190:17
    #7 0x565bda in handle_single_part_openflow ofproto/ofproto.c:8504:16
    #8 0x540b25 in handle_openflow ofproto/ofproto.c:8685:21
    #9 0x6697fd in ofconn_run ofproto/connmgr.c:1329:13
    #10 0x668e6e in connmgr_run ofproto/connmgr.c:356:9
    #11 0x53f1bc in ofproto_run ofproto/ofproto.c:1890:5
    #12 0x4ead0c in bridge_run__ vswitchd/bridge.c:3250:9
    #13 0x4e9bc8 in bridge_run vswitchd/bridge.c:3309:5
    #14 0x51c072 in main vswitchd/ovs-vswitchd.c:127:9
    #15 0x7f23a99011a2 in __libc_start_main (/lib64/libc.so.6)

  Uninitialized value was created by an allocation of 'ofpacts_stub'
  in the stack frame of function 'handle_flow_mod'
    #0 0x569e80 in handle_flow_mod ofproto/ofproto.c:6170

This could cause issues with flow modifications or other operations.

To reproduce, some NSH tests could be run under valgrind or clang
MemorySantizer. Ex. "nsh - md1 encap over a veth link" test.

Fix that by clearing padding bytes while encoding and decoding.
OVS will still accept OF messages with non-zero padding from
controllers.

New tests added to tests/ofp-actions.at.

Fixes: 1fc11c5948cf ("Generic encap and decap support for NSH")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Jan Scheurich <jan.scheurich at ericsson.com>


  Commit: 8b25079585271a793b8bf682d58930be93b8b556
      https://github.com/openvswitch/ovs/commit/8b25079585271a793b8bf682d58930be93b8b556
  Author: Eli Britstein <elibr at nvidia.com>
  Date:   2020-10-17 (Sat, 17 Oct 2020)

  Changed paths:
    M .mailmap
    M AUTHORS.rst

  Log Message:
  -----------
  AUTHORS: Update Eli Britstein <elibr at nvidia.com>

Signed-off-by: Eli Britstein <elibr at nvidia.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: c857b76199307c411504ae30d0b4f25ea72f5399
      https://github.com/openvswitch/ovs/commit/c857b76199307c411504ae30d0b4f25ea72f5399
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-10-19 (Mon, 19 Oct 2020)

  Changed paths:
    M .travis/linux-build.sh

  Log Message:
  -----------
  Revert "travis: Disable check for array of flexible structures in sparse."

This reverts commit 3c6b3a519ae6eae3da4cf7c59894b02b95cdade7.

The fix landed to Sparse main repository [1]:
  b5d46df743be ("flex-array: allow arrays of unions with flexible members.")

[1] https://git.kernel.org/pub/scm/devel/sparse/sparse.git

Acked-by: Greg Rose <gvrose8192 at gmail.com>
Acked-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 0ef70536eb418a13e10113a884f665d47fb732e3
      https://github.com/openvswitch/ovs/commit/0ef70536eb418a13e10113a884f665d47fb732e3
  Author: Lei Wang <leiw at mellanox.com>
  Date:   2020-10-19 (Mon, 19 Oct 2020)

  Changed paths:
    M lib/netdev-offload-dpdk.c

  Log Message:
  -----------
  netdev-offload-dpdk: Support vxlan encap offload with load actions.

Struct match has the tunnel values/masks in
match->flow.tunnel/match->wc.masks.tunnel.
Load actions such as load:0xa566c10->NXM_NX_TUN_IPV4_DST[],
load:0xbba->NXM_NX_TUN_ID[] are utilizing the tunnel masks fields,
but those should not be used for matching.
Offloading fails if masks is not clear. Clear it if no tunnel used.

Fixes: e8a2b5bf92bb ("netdev-dpdk: implement flow offload with rte flow")
Reviewed-by: Eli Britstein <elibr at mellanox.com>
Reviewed-by: Gaetan Rivet <gaetanr at mellanox.com>
Acked-by: Sriharsha Basavapatna <sriharsha.basavapatna at broadcom.com>
Tested-by: Emma Finn <emma.finn at intel.com>
Signed-off-by: Lei Wang <leiw at mellanox.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/8205fbc8f5e0...0ef70536eb41


More information about the git mailing list