2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 13:27:59 +00:00

22 Commits

Author SHA1 Message Date
Yifeng Sun
def5b366a3 dpif-netlink-rtnl: Retry smaller MTU when default MAX_MTU is too large.
When MAX_MTU is larger than hw supported max MTU,
dpif_netlink_rtnl_create will fail. This leads to
testing failure '11: datapath - ping over gre tunnel'
in 'make check-kmod'.

This patch fixes this issue by retrying a smaller MTU
when MAX_MTU is too large.

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-06 13:38:01 -07:00
Greg Rose
27d09fbc64 Revert "dpif: Ensure ERSPAN GRE support"
This reverts commit 8929c55287abae37efeac1e8876e6b3c2ccad0b9.

This is the wrong direction for the solution to the ip_gre/gre kernel
module conflicts, as reported by Jiri Benc <jbenc@redhat.com> and others in
https://mail.openvswitch.org/pipermail/ovs-dev/2018-June/347803.html and
elsewhere in the same thread

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>
2018-06-05 10:36:50 -07:00
Greg Rose
8929c55287 dpif: Ensure ERSPAN GRE support
When verifying the built-in gre kernel module check for ERSPAN support.

Reported-by: Guru Shetty <guru@ovn.org>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-31 19:02:43 -07:00
Greg Rose
3b10ceeed1 ip6gre: Add ip6gre vport type
Add handlers for OVS_VPORT_TYPE_IP6GRE

Cc: Ben Pfaff <blp@ovn.org>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>
2018-05-21 20:33:30 -07:00
William Tu
98514eea21 erspan: add kernel datapath support
pass check, check-kernel (4.16-rc4), check-system-userspace

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-21 20:33:30 -07:00
Greg Rose
c387d8177f compat: Add ipv6 GRE and IPV6 Tunneling
This patch backports upstream ipv6 GRE and tunneling into the OVS
OOT (Out of Tree) datapath drivers.  The primary reason for this
is to support the ERSPAN feature.

Because there is no previous history of ipv6 GRE and tunneling it is
not possible to exactly reproduce the history of all the files in
the patch.  The two newly added files - ip6_gre.c and ip6_tunnel.c -
are cut from whole cloth out of the upstream Linux 4.15 kernel and
then modified as necessary with compatibility layer fixups.
These two files already included parts of several other upstream
commits that also touched other upstream files.  As such, this
patch may incorporate parts or all of the following commits:

d350a82 net: erspan: create erspan metadata uapi header
c69de58 net: erspan: use bitfield instead of mask and offset
b423d13 net: erspan: fix use-after-free
214bb1c net: erspan: remove md NULL check
afb4c97 ip6_gre: fix potential memory leak in ip6erspan_rcv
50670b6 ip_gre: fix potential memory leak in erspan_rcv
a734321 ip6_gre: fix error path when ip6erspan_rcv failed
dd8d5b8 ip_gre: fix error path when erspan_rcv failed
293a199 ip6_gre: fix a pontential issue in ip6erspan_rcv
d91e8db5 net: erspan: reload pointer after pskb_may_pull
ae3e133 net: erspan: fix wrong return value
c05fad5 ip_gre: fix wrong return value of erspan_rcv
94d7d8f ip6_gre: add erspan v2 support
f551c91 net: erspan: introduce erspan v2 for ip_gre
1d7e2ed net: erspan: refactor existing erspan code
ef7baf5 ip6_gre: add ip6 erspan collect_md mode
5a963eb ip6_gre: Add ERSPAN native tunnel support
ceaa001 openvswitch: Add erspan tunnel support.
f192970 ip_gre: check packet length and mtu correctly in erspan tx
c84bed4 ip_gre: erspan device should keep dst
c122fda ip_gre: set tunnel hlen properly in erspan_tunnel_init
5513d08 ip_gre: check packet length and mtu correctly in erspan_xmit
935a974 ip_gre: get key from session_id correctly in erspan_rcv
1a66a83 gre: add collect_md mode to ERSPAN tunnel
84e54fe gre: introduce native tunnel support for ERSPAN

In cases where the listed commits also touched other source code
files then the patches are also listed separately within this
patch series.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>
2018-05-21 20:33:29 -07:00
Ben Pfaff
2927a4730b dpif-netlink-rtnl: Work around MTU bug in kernel GRE driver.
The kernel GRE driver ignores IFLA_MTU in RTM_NEWLINK requests and
overrides the MTU to 1472 bytes.  This commit works around the problem by
following up a request to create a GRE device with a second request to set
the MTU.

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1488484
Reported-by: Eric Garver <e@erig.me>
Reported-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Eric Garver <e@erig.me>
Tested-by: James Page <james.page@ubuntu.com>
2018-01-18 14:54:05 -08:00
Ben Pfaff
0ca24ab287 dpif-netlink-rtnl: Use 65000 instead of 65535 as tunnel MTU.
Most of the existing tunnels accept 65535 for MTU and internally reduce it
to the maximum value actually supported.  However, in RTM_SETLINK calls,
at least GRE tunnels reject MTU larger than actually supported.  This
commit changes the MTU used in RTM_NEWLINK calls to use a value that should
be acceptable to all tunnels and yet does not noticeably reduce
performance.

(This code doesn't actually use RTM_SETLINK to change MTU yet, but that's
coming up.)

Suggested-by: Eric Garver <e@erig.me>
Suggested-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-January/343304.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Eric Garver <e@erig.me>
Tested-by: James Page <james.page@ubuntu.com>
2018-01-18 14:53:06 -08:00
William Tu
c848e1cdb8 dpif-netlink-rtnl: Fix ovs_geneve probing after restart.
When using the out-of-tree (openvswitch compat) geneve module,
the first time oot tunnel probing returns true (correct).
Without unloading the geneve module, if the userspace ovs-vswitchd
restarts, because the 'geneve_sys_6081' still exists, the probing
incorrectly returns false and loads the in-tree (upstream kernel)
geneve module.

The patch fixes it by querying the geneve device's kind when exists.
The out-of-tree modules uses kind string as 'ovs_geneve', while the
in-tree module uses 'geneve'.  To reproduce the issue, start the ovs
> /etc/init.d/openvswitch-switch start
> creat a bridge and attach a geneve port using out-of-tree geneve
> /etc/init.d/openvswitch-switch restart

Fixes: 921c370a9df5 ("dpif-netlink: Probe for out-of-tree tunnels, decides used interface")
Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Eric Garver <e@erig.me>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2017-11-02 04:10:12 -07:00
Roi Dayan
acf2e6c00f dpif-netlink-rtnl: Fix false errors on interfaces without tunnel config
When we skip adding a port using rtnetlink and not because of an error we
need to return EOPNOTSUPP to avoid logging an error message.

Fixes: 2fd3d5eda508 ("dpif-netlink-rtnl: Support layer3 GRE")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Acked-by: Eric Garver <e@erig.me>
Acked-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
2017-08-01 16:46:17 -07:00
Eric Garver
76e2d4e70a dpif-netlink-rtnl: Fix VXLAN port create for regular VXLAN
When VXLAN-GPE was introduced we added IFLA_VXLAN_GPE to the policy
parsing, but did not mark it as optional. The kernel only returns this
netlink attribute if it's actually configured.

This also adds a missing entry for IFLA_VXLAN_GBP. Apparently we have no
system-traffic test coverage there.

Fixes: c33c412fb139 ("dpif-netlink-rtnl: Support VXLAN-GPE")
Fixes: 825e45e0109f ("dpif-netlink-rtnl: Support VXLAN creation")
Reported-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
2017-08-01 16:45:40 -07:00
Eric Garver
2fd3d5eda5 dpif-netlink-rtnl: Support layer3 GRE
Add support for creating layer3 GRE.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
2017-07-19 14:34:18 -07:00
Eric Garver
c33c412fb1 dpif-netlink-rtnl: Support VXLAN-GPE
Add support for creating VXLAN tunnels with GPE. This enables layer3
VXLAN tunnels with kernel datapath.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
2017-07-19 14:34:18 -07:00
Bhanuprakash Bodireddy
fae145ca7c dpif-netlink-rtnl: Fix dead store reported by clang.
Clang reports variable 'ifmsg' never been used in the function.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-07-11 21:03:44 -07:00
Joe Stringer
b50fcaa0d9 dpif-netlink-rtnl: Use OVS_NOT_REACHED in verify.
The vport_type_to_kind() call at the top of dpif_netlink_rtnl_verify()
ensures that these cases can never be hit, so use OVS_NOT_REACHED()
instead of setting the err to EOPNOTSUPP.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Eric Garver <e@erig.me>
2017-05-23 15:44:27 -07:00
Joe Stringer
caeda3489e dpif-netlink-rtnl: Use getlink() in common verify path.
The calls here were duplicated across each tunnel protocol.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Eric Garver <e@erig.me>
2017-05-23 15:44:27 -07:00
Joe Stringer
9db6b04e66 dpif-netlink-rtnl: Tidy up some code.
Simplify and refactor a couple of bits of code for improved readability.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Eric Garver <e@erig.me>
2017-05-23 15:44:27 -07:00
Eric Garver
921c370a9d dpif-netlink: Probe for out-of-tree tunnels, decides used interface
On dpif init, probe for whether tunnels are created using in-tree
(upstream linux) or out-of-tree (OVS). This is done by probing for the
existence of "ovs_geneve" via rtnetlink. This is used to determine how
to create the tunnel devices.

For out-of-tree tunnels, only try genetlink/compat.
For in-tree kernel tunnels, try rtnetlink then fallback to genetlink.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
2017-05-19 12:51:58 -07:00
Eric Garver
b6d6830d29 dpif-netlink-rtnl: Support GENEVE creation
Creates GENEVE devices using rtnetlink and tunnel metadata.

Co-Authored-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
2017-05-19 12:51:58 -07:00
Eric Garver
f658f95e73 dpif-netlink-rtnl: Support GRE creation
Creates GRE devices using rtnetlink and tunnel metadata.

Co-Authored-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
2017-05-19 12:51:58 -07:00
Eric Garver
825e45e010 dpif-netlink-rtnl: Support VXLAN creation
Creates VXLAN devices using rtnetlink and tunnel metadata.

Co-Authored-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
2017-05-19 12:51:58 -07:00
Eric Garver
c4e087530e dpif-netlink: Support rtnetlink port creation.
In order to be able to add those tunnels, we need to add code to create
the tunnels and add them as NETDEV vports. And when there is no support
to create them, we need to fallback to compatibility code and add them
as tunnel vports.

When removing those tunnels, we need to remove the interfaces as well,
and detecting the right type might be important, at least to distinguish
the tunnel vports that we should remove and the interfaces that we
shouldn't.

Co-authored-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
2017-05-19 12:51:57 -07:00