[ovs-dev] [PATCH V3 14/24] datapath: don't call pad_packet if not necessary

Yi-Hung Wei yihung.wei at gmail.com
Tue Sep 29 21:44:08 UTC 2020


On Wed, Sep 16, 2020 at 10:34 AM Greg Rose <gvrose8192 at gmail.com> wrote:
>
> From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
>
> 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>
>
> Cc: Tonghao Zhang <xiangxia.m.yue at gmail.com>
> Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
> Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
> ---
Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>


More information about the dev mailing list