]> git.proxmox.com Git - mirror_ovs.git/commit
datapath: don't call pad_packet if not necessary
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Mon, 12 Oct 2020 20:25:01 +0000 (13:25 -0700)
committerIlya Maximets <i.maximets@ovn.org>
Sat, 17 Oct 2020 15:32:06 +0000 (17:32 +0200)
commit11047d57d797e079d0bbb9e5827817ebf1c08551
tree9d3a494b83dcabf7b84c1eaab04c145f8a6b3ef8
parent825634866e95d4e9533d6dafb8d8eccc5f80a3ed
datapath: don't call pad_packet if not necessary

Upstream commit:
    commit 61ca533c0e94104c35fcb7858a23ec9a05d78143
    Author: Tonghao Zhang <xiangxia.m.yue@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@ovn.org>
Cc: William Tu <u9012063@gmail.com>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
datapath/datapath.c