]> git.proxmox.com Git - mirror_ovs.git/commit
compat: Fix broken partial backport of extack op parameter
authorGreg Rose <gvrose8192@gmail.com>
Tue, 14 Apr 2020 18:42:10 +0000 (11:42 -0700)
committerWilliam Tu <u9012063@gmail.com>
Wed, 15 Apr 2020 15:17:07 +0000 (08:17 -0700)
commit82b7e6d19e89de67dae41308e25935c351f59316
tree187f1460868fa0487e83afeaf3ef923a03659534
parent9d7893b30de1e0eb8d5d3af4f92908583167caa9
compat: Fix broken partial backport of extack op parameter

A series of commits added support for the extended ack
parameter to the newlink, changelink and validate ops in
the rtnl_link_ops structure:
a8b8a889e369d ("net: add netlink_ext_ack argument to rtnl_link_ops.validate")
7a3f4a185169b ("net: add netlink_ext_ack argument to rtnl_link_ops.newlink")
ad744b223c521 ("net: add netlink_ext_ack argument to rtnl_link_ops.changelink")

These commits were all added at the same time and present since the
Linux kernel 4.13 release. In our compatiblity layer we have a
define HAVE_EXT_ACK_IN_RTNL_LINKOPS that indicates the presence of
the extended ack parameter for these three link operations.

At least one distro has only backported two of the three patches,
for newlink and changelink, while not backporting patch a8b8a889e369d
for the validate op.  Our compatibility layer code in acinclude.m4
is able to find the presence of the extack within the rtnl_link_ops
structure so it defines HAVE_EXT_ACK_IN_RTNL_LINKOPS but since the
validate link op does not have the extack parameter the compilation
fails on recent kernels for that particular distro. Other kernel
distributions based upon this distro will presumably also encounter
the compile errors.

Introduce a new function in acinclude.m4 that will find function
op definitions and then search for the required parameter.  Then
use this function to define HAVE_RTNLOP_VALIDATE_WITH_EXTACK so
that we can detect and enable correct compilation on kernels
which have not backported the entire set of patches.  This function
is generic to any function op - it need not be in a structure.

In places where HAVE_EXT_ACK_IN_RTNL_LINKOPS wraps validate functions
replace it with the new HAVE_RTNLOP_VALIDATE_WITH_EXTACK define.

Passes Travis here:
https://travis-ci.org/github/gvrose8192/ovs-experimental/builds/674599698

Passes a kernel check-kmod test on several systems, including
sles12 sp4 4.12.14-95.48-default kernel, without any regressions.

VMWare-BZ: #2544032
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: William Tu <u9012063@gmail.com>
acinclude.m4
datapath/linux/compat/geneve.c
datapath/linux/compat/ip6_gre.c
datapath/linux/compat/ip6_tunnel.c
datapath/linux/compat/ip_gre.c
datapath/linux/compat/lisp.c
datapath/linux/compat/stt.c
datapath/linux/compat/vxlan.c