From: David S. Miller Date: Fri, 26 Apr 2019 03:52:29 +0000 (-0400) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8b4483658364f05b2e32845c8f445cdfd9452286;p=linux.git Merge git://git./linux/kernel/git/davem/net Two easy cases of overlapping changes. Signed-off-by: David S. Miller --- 8b4483658364f05b2e32845c8f445cdfd9452286 diff --cc drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 69a9d67396ec2,46157e2a1e5ac..2a5820f8c6eb0 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@@ -3718,9 -3775,9 +3718,9 @@@ int mlx5e_change_mtu(struct net_device new_channels.params.sw_mtu = new_mtu; if (params->xdp_prog && - !mlx5e_rx_is_linear_skb(priv->mdev, &new_channels.params)) { + !mlx5e_rx_is_linear_skb(&new_channels.params)) { netdev_err(netdev, "MTU(%d) > %d is not allowed while XDP enabled\n", - new_mtu, MLX5E_XDP_MAX_MTU); + new_mtu, mlx5e_xdp_max_mtu(params)); err = -EINVAL; goto out; } @@@ -4159,9 -4210,10 +4159,10 @@@ static int mlx5e_xdp_allowed(struct mlx new_channels.params = priv->channels.params; new_channels.params.xdp_prog = prog; - if (!mlx5e_rx_is_linear_skb(priv->mdev, &new_channels.params)) { + if (!mlx5e_rx_is_linear_skb(&new_channels.params)) { netdev_warn(netdev, "XDP is not allowed with MTU(%d) > %d\n", - new_channels.params.sw_mtu, MLX5E_XDP_MAX_MTU); + new_channels.params.sw_mtu, + mlx5e_xdp_max_mtu(&new_channels.params)); return -EINVAL; } diff --cc tools/testing/selftests/netfilter/Makefile index 80dae72a25c77,a37cb1192c6a6..3e6d1bcc28949 --- a/tools/testing/selftests/netfilter/Makefile +++ b/tools/testing/selftests/netfilter/Makefile @@@ -1,6 -1,6 +1,7 @@@ # SPDX-License-Identifier: GPL-2.0 # Makefile for netfilter selftests - TEST_PROGS := nft_trans_stress.sh nft_nat.sh bridge_brouter.sh -TEST_PROGS := nft_trans_stress.sh nft_nat.sh conntrack_icmp_related.sh ++TEST_PROGS := nft_trans_stress.sh nft_nat.sh bridge_brouter.sh \ ++ conntrack_icmp_related.sh include ../lib.mk diff --cc tools/testing/selftests/netfilter/nft_nat.sh index 248905130d5d3,3194007cf8d1b..21159f5f33628 --- a/tools/testing/selftests/netfilter/nft_nat.sh +++ b/tools/testing/selftests/netfilter/nft_nat.sh @@@ -346,7 -321,7 +346,8 @@@ EO test_masquerade6() { + local family=$1 + local natflags=$1 local lret=0 ip netns exec ns0 sysctl net.ipv6.conf.all.forwarding=1 > /dev/null @@@ -377,21 -352,16 +378,25 @@@ # add masquerading rule ip netns exec ns0 nft -f - < /dev/null # ping ns2->ns1 if [ $? -ne 0 ] ; then ++<<<<<<< HEAD + echo "ERROR: cannot ping ns1 from ns2 with active $family masquerading" ++======= + echo "ERROR: cannot ping ns1 from ns2 with active ipv6 masquerade $natflags" ++>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1 lret=1 fi @@@ -428,20 -398,26 +433,38 @@@ fi done ++<<<<<<< HEAD + ip netns exec ns0 nft flush chain $family nat postrouting ++======= + ip netns exec ns2 ping -q -c 1 dead:1::99 > /dev/null # ping ns2->ns1 + if [ $? -ne 0 ] ; then + echo "ERROR: cannot ping ns1 from ns2 with active ipv6 masquerade $natflags (attempt 2)" + lret=1 + fi + + ip netns exec ns0 nft flush chain ip6 nat postrouting ++>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1 if [ $? -ne 0 ]; then - echo "ERROR: Could not flush ip6 nat postrouting" 1>&2 + echo "ERROR: Could not flush $family nat postrouting" 1>&2 lret=1 fi ++<<<<<<< HEAD + test $lret -eq 0 && echo "PASS: $family IPv6 masquerade for ns2" ++======= + test $lret -eq 0 && echo "PASS: IPv6 masquerade $natflags for ns2" ++>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1 return $lret } test_masquerade() { ++<<<<<<< HEAD + local family=$1 ++======= + local natflags=$1 ++>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1 local lret=0 ip netns exec ns0 sysctl net.ipv4.conf.veth0.forwarding=1 > /dev/null @@@ -472,21 -448,16 +495,25 @@@ # add masquerading rule ip netns exec ns0 nft -f - < /dev/null # ping ns2->ns1 if [ $? -ne 0 ] ; then ++<<<<<<< HEAD + echo "ERROR: cannot ping ns1 from ns2 with active $family masquerading" ++======= + echo "ERROR: cannot ping ns1 from ns2 with active ip masquere $natflags" ++>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1 lret=1 fi @@@ -522,13 -493,19 +549,27 @@@ fi done ++<<<<<<< HEAD + ip netns exec ns0 nft flush chain $family nat postrouting ++======= + ip netns exec ns2 ping -q -c 1 10.0.1.99 > /dev/null # ping ns2->ns1 + if [ $? -ne 0 ] ; then + echo "ERROR: cannot ping ns1 from ns2 with active ip masquerade $natflags (attempt 2)" + lret=1 + fi + + ip netns exec ns0 nft flush chain ip nat postrouting ++>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1 if [ $? -ne 0 ]; then - echo "ERROR: Could not flush nat postrouting" 1>&2 + echo "ERROR: Could not flush $family nat postrouting" 1>&2 lret=1 fi ++<<<<<<< HEAD + test $lret -eq 0 && echo "PASS: $family IP masquerade for ns2" ++======= + test $lret -eq 0 && echo "PASS: IP masquerade $natflags for ns2" ++>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1 return $lret } @@@ -795,25 -760,20 +836,34 @@@ if [ $ret -eq 0 ];the fi reset_counters -test_local_dnat -test_local_dnat6 +test_local_dnat ip +test_local_dnat6 ip6 +reset_counters +$test_inet_nat && test_local_dnat inet +$test_inet_nat && test_local_dnat6 inet reset_counters ++<<<<<<< HEAD +test_masquerade ip +test_masquerade6 ip6 +reset_counters +$test_inet_nat && test_masquerade inet +$test_inet_nat && test_masquerade6 inet ++======= + test_masquerade "" + test_masquerade6 "" + + reset_counters + test_masquerade "fully-random" + test_masquerade6 "fully-random" ++>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1 reset_counters -test_redirect -test_redirect6 +test_redirect ip +test_redirect6 ip6 +reset_counters +$test_inet_nat && test_redirect inet +$test_inet_nat && test_redirect6 inet for i in 0 1 2; do ip netns del ns$i;done