Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v3 net-next 0/7] net: l3mdev: Support for sockets bound to enslaved device
From: David Ahern @ 2017-08-07 18:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20170807.113942.927598740175023982.davem@davemloft.net>

On 8/7/17 12:39 PM, David Miller wrote:
> Series applied, let's see if it builds this time :-)

I did an allyesconfig build before sending just to make sure, so our
mileage better not vary.

^ permalink raw reply

* Re: [PATCH v3 net-next 0/7] net: l3mdev: Support for sockets bound to enslaved device
From: David Miller @ 2017-08-07 18:39 UTC (permalink / raw)
  To: dsahern; +Cc: netdev
In-Reply-To: <1502120662-1430-1-git-send-email-dsahern@gmail.com>

From: David Ahern <dsahern@gmail.com>
Date: Mon,  7 Aug 2017 08:44:15 -0700

> A missing piece to the VRF puzzle is the ability to bind sockets to
> devices enslaved to a VRF. This patch set adds the enslaved device
> index, sdif, to IPv4 and IPv6 socket lookups. The end result for users
> is the following scope options for services:
> 
> 1. "global" services - sockets not bound to any device
> 
>    Allows 1 service to work across all network interfaces with
>    connected sockets bound to the VRF the connection originates
>    (Requires net.ipv4.tcp_l3mdev_accept=1 for TCP and
>     net.ipv4.udp_l3mdev_accept=1 for UDP)
> 
> 2. "VRF" local services - sockets bound to a VRF
> 
>    Sockets work across all network interfaces enslaved to a VRF but
>    are limited to just the one VRF.
> 
> 3. "device" services - sockets bound to a specific network interface
> 
>    Service works only through the one specific interface.
> 
> v3
> - convert __inet_lookup_established in dccp_v4_err; missed in v2
> 
> v2
> - remove sk_lookup struct and add sdif as an argument to existing
>   functions
> 
> Changes since RFC:
> - no significant logic changes; mainly whitespace cleanups

Series applied, let's see if it builds this time :-)

^ permalink raw reply

* Re: pull-request: wireless-drivers-next 2017-08-07
From: David Miller @ 2017-08-07 18:35 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <87h8xjjukz.fsf@kamboji.qca.qualcomm.com>

From: Kalle Valo <kvalo@codeaurora.org>
Date: Mon, 07 Aug 2017 17:55:40 +0300

> here's the first pull request to net-next for 4.14, more info in the
> signed tag below. This time there's a simple conflict in iwlwifi but
> you can fix it just like Stephen did:
> 
> https://lkml.kernel.org/r/20170804120408.0d147e86@canb.auug.org.au
> 
> Please let me know if you have any problems.

Pulled, thanks Kalle.

^ permalink raw reply

* Re: [PATCH net-next v1 2/2] bpf: Extend check_uarg_tail_zero() checks
From: Daniel Borkmann @ 2017-08-07 18:34 UTC (permalink / raw)
  To: Mickaël Salaün, linux-kernel
  Cc: Alexei Starovoitov, David S . Miller, Kees Cook, Martin KaFai Lau,
	netdev, Alexei Starovoitov
In-Reply-To: <20170807163605.14194-2-mic@digikod.net>

On 08/07/2017 06:36 PM, Mickaël Salaün wrote:
> The function check_uarg_tail_zero() was created from bpf(2) for
> BPF_OBJ_GET_INFO_BY_FD without taking the access_ok() nor the PAGE_SIZE
> checks. Make this checks more generally available while unlikely to be
> triggered, extend the memory range check and add an explanation
> including why the ToCToU should not be a security concern.
>
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Martin KaFai Lau <kafai@fb.com>
> Link: https://lkml.kernel.org/r/CAGXu5j+vRGFvJZmjtAcT8Hi8B+Wz0e1b6VKYZHfQP_=DXzC4CQ@mail.gmail.com
> ---
>   kernel/bpf/syscall.c | 26 +++++++++++++++-----------
>   1 file changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index c653ee0bd162..b884fdc371e0 100644
> --- a/kernel/bpf/syscall.c
> +++ b/kernel/bpf/syscall.c
> @@ -48,6 +48,15 @@ static const struct bpf_map_ops * const bpf_map_types[] = {
>   #undef BPF_MAP_TYPE
>   };
>
> +/*
> + * If we're handed a bigger struct than we know of, ensure all the unknown bits
> + * are 0 - i.e. new user-space does not rely on any kernel feature extensions
> + * we dont know about yet.

Nit: don't

> + *
> + * There is a ToCToU between this function call and the following
> + * copy_from_user() call. However, this should not be a concern since this

Lets make it a bit more clear to the reader: s/should not/is not/

> + * function is meant to be a future-proofing of bits.
> + */
>   static int check_uarg_tail_zero(void __user *uaddr,
>   				size_t expected_size,
>   				size_t actual_size)
> @@ -57,6 +66,12 @@ static int check_uarg_tail_zero(void __user *uaddr,
>   	unsigned char val;
>   	int err;
>
> +	if (unlikely(!access_ok(VERIFY_READ, uaddr, actual_size)))
> +		return -EFAULT;
> +
> +	if (unlikely(actual_size > PAGE_SIZE))	/* silly large */
> +		return -E2BIG;
> +

Yeah, moving the checks into check_uarg_tail_zero() is
fine by me. Can we make the 'silly large' test first, so
we don't generate unnecessary work if we bail out later
anyway?

Other than that:

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

Thanks,
Daniel

>   	if (actual_size <= expected_size)
>   		return 0;
>
> @@ -1393,17 +1408,6 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz
>   	if (!capable(CAP_SYS_ADMIN) && sysctl_unprivileged_bpf_disabled)
>   		return -EPERM;
>
> -	if (!access_ok(VERIFY_READ, uattr, 1))
> -		return -EFAULT;
> -
> -	if (size > PAGE_SIZE)	/* silly large */
> -		return -E2BIG;
> -
> -	/* If we're handed a bigger struct than we know of,
> -	 * ensure all the unknown bits are 0 - i.e. new
> -	 * user-space does not rely on any kernel feature
> -	 * extensions we dont know about yet.
> -	 */
>   	err = check_uarg_tail_zero(uattr, sizeof(attr), size);
>   	if (err)
>   		return err;
>

^ permalink raw reply

* [PATCH net-next 1/1] netvsc: make sure and unregister datapath
From: Stephen Hemminger @ 2017-08-07 18:30 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin; +Cc: devel, netdev
In-Reply-To: <20170807183000.10827-1-sthemmin@microsoft.com>

Go back to switching datapath directly in the notifier callback.
Otherwise datapath might not get switched on unregister.

No need for calling the NOTIFY_PEERS notifier since that is only for
a gratitious ARP/ND packet; but that is not required with Hyper-V
because both VF and synthetic NIC have the same MAC address.

Reported-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Fixes: 0c195567a8f6 ("netvsc: transparent VF management")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/net/hyperv/hyperv_net.h |  3 --
 drivers/net/hyperv/netvsc.c     |  2 --
 drivers/net/hyperv/netvsc_drv.c | 71 ++++++++++++++++-------------------------
 3 files changed, 28 insertions(+), 48 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index c701b059c5ac..d1ea99a12cf2 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -724,14 +724,11 @@ struct net_device_context {
 	struct net_device __rcu *vf_netdev;
 	struct netvsc_vf_pcpu_stats __percpu *vf_stats;
 	struct work_struct vf_takeover;
-	struct work_struct vf_notify;
 
 	/* 1: allocated, serial number is valid. 0: not allocated */
 	u32 vf_alloc;
 	/* Serial number of the VF to team with */
 	u32 vf_serial;
-
-	bool datapath;	/* 0 - synthetic, 1 - VF nic */
 };
 
 /* Per channel data */
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 9598220b3bcc..208f03aa83de 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -60,8 +60,6 @@ void netvsc_switch_datapath(struct net_device *ndev, bool vf)
 			       sizeof(struct nvsp_message),
 			       (unsigned long)init_pkt,
 			       VM_PKT_DATA_INBAND, 0);
-
-	net_device_ctx->datapath = vf;
 }
 
 static struct netvsc_device *alloc_net_device(void)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index e75c0f852a63..eb0023f55fe1 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1649,55 +1649,35 @@ static int netvsc_register_vf(struct net_device *vf_netdev)
 	return NOTIFY_OK;
 }
 
-/* Change datapath */
-static void netvsc_vf_update(struct work_struct *w)
+static int netvsc_vf_up(struct net_device *vf_netdev)
 {
-	struct net_device_context *ndev_ctx
-		= container_of(w, struct net_device_context, vf_notify);
-	struct net_device *ndev = hv_get_drvdata(ndev_ctx->device_ctx);
+	struct net_device_context *net_device_ctx;
 	struct netvsc_device *netvsc_dev;
-	struct net_device *vf_netdev;
-	bool vf_is_up;
-
-	if (!rtnl_trylock()) {
-		schedule_work(w);
-		return;
-	}
+	struct net_device *ndev;
 
-	vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);
-	if (!vf_netdev)
-		goto unlock;
+	ndev = get_netvsc_byref(vf_netdev);
+	if (!ndev)
+		return NOTIFY_DONE;
 
-	netvsc_dev = rtnl_dereference(ndev_ctx->nvdev);
+	net_device_ctx = netdev_priv(ndev);
+	netvsc_dev = rtnl_dereference(net_device_ctx->nvdev);
 	if (!netvsc_dev)
-		goto unlock;
-
-	vf_is_up = netif_running(vf_netdev);
-	if (vf_is_up != ndev_ctx->datapath) {
-		if (vf_is_up) {
-			netdev_info(ndev, "VF up: %s\n", vf_netdev->name);
-			rndis_filter_open(netvsc_dev);
-			netvsc_switch_datapath(ndev, true);
-			netdev_info(ndev, "Data path switched to VF: %s\n",
-				    vf_netdev->name);
-		} else {
-			netdev_info(ndev, "VF down: %s\n", vf_netdev->name);
-			netvsc_switch_datapath(ndev, false);
-			rndis_filter_close(netvsc_dev);
-			netdev_info(ndev, "Data path switched from VF: %s\n",
-				    vf_netdev->name);
-		}
+		return NOTIFY_DONE;
 
-		/* Now notify peers through VF device. */
-		call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, ndev);
-	}
-unlock:
-	rtnl_unlock();
+	/* Bump refcount when datapath is acvive - Why? */
+	rndis_filter_open(netvsc_dev);
+
+	/* notify the host to switch the data path. */
+	netvsc_switch_datapath(ndev, true);
+	netdev_info(ndev, "Data path switched to VF: %s\n", vf_netdev->name);
+
+	return NOTIFY_OK;
 }
 
-static int netvsc_vf_notify(struct net_device *vf_netdev)
+static int netvsc_vf_down(struct net_device *vf_netdev)
 {
 	struct net_device_context *net_device_ctx;
+	struct netvsc_device *netvsc_dev;
 	struct net_device *ndev;
 
 	ndev = get_netvsc_byref(vf_netdev);
@@ -1705,7 +1685,13 @@ static int netvsc_vf_notify(struct net_device *vf_netdev)
 		return NOTIFY_DONE;
 
 	net_device_ctx = netdev_priv(ndev);
-	schedule_work(&net_device_ctx->vf_notify);
+	netvsc_dev = rtnl_dereference(net_device_ctx->nvdev);
+	if (!netvsc_dev)
+		return NOTIFY_DONE;
+
+	netvsc_switch_datapath(ndev, false);
+	netdev_info(ndev, "Data path switched from VF: %s\n", vf_netdev->name);
+	rndis_filter_close(netvsc_dev);
 
 	return NOTIFY_OK;
 }
@@ -1721,7 +1707,6 @@ static int netvsc_unregister_vf(struct net_device *vf_netdev)
 
 	net_device_ctx = netdev_priv(ndev);
 	cancel_work_sync(&net_device_ctx->vf_takeover);
-	cancel_work_sync(&net_device_ctx->vf_notify);
 
 	netdev_info(ndev, "VF unregistering: %s\n", vf_netdev->name);
 
@@ -1764,7 +1749,6 @@ static int netvsc_probe(struct hv_device *dev,
 	spin_lock_init(&net_device_ctx->lock);
 	INIT_LIST_HEAD(&net_device_ctx->reconfig_events);
 	INIT_WORK(&net_device_ctx->vf_takeover, netvsc_vf_setup);
-	INIT_WORK(&net_device_ctx->vf_notify, netvsc_vf_update);
 
 	net_device_ctx->vf_stats
 		= netdev_alloc_pcpu_stats(struct netvsc_vf_pcpu_stats);
@@ -1915,8 +1899,9 @@ static int netvsc_netdev_event(struct notifier_block *this,
 	case NETDEV_UNREGISTER:
 		return netvsc_unregister_vf(event_dev);
 	case NETDEV_UP:
+		return netvsc_vf_up(event_dev);
 	case NETDEV_DOWN:
-		return netvsc_vf_notify(event_dev);
+		return netvsc_vf_down(event_dev);
 	default:
 		return NOTIFY_DONE;
 	}
-- 
2.11.0

^ permalink raw reply related

* [PATCH net-next 0/1] netvsc: another VF datapath fix
From: Stephen Hemminger @ 2017-08-07 18:29 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin; +Cc: devel, netdev

Previous fix was incomplete.

Stephen Hemminger (1):
  netvsc: make sure and unregister datapath

 drivers/net/hyperv/hyperv_net.h |  3 --
 drivers/net/hyperv/netvsc.c     |  2 --
 drivers/net/hyperv/netvsc_drv.c | 71 ++++++++++++++++-------------------------
 3 files changed, 28 insertions(+), 48 deletions(-)

-- 
2.11.0

^ permalink raw reply

* Re: [PATCH RFC v2 3/5] samples/bpf: Fix inline asm issues building samples on arm64
From: David Miller @ 2017-08-07 18:28 UTC (permalink / raw)
  To: joelaf; +Cc: linux-kernel, fengc, alison, Juri.Lelli, ast, daniel, netdev
In-Reply-To: <20170807130602.31785-4-joelaf@google.com>


Please, no.

The amount of hellish hacks we are adding to deal with this is getting
way out of control.

BPF programs MUST have their own set of asm headers, this is the
only way to get around this issue in the long term.

I am also strongly against adding -static to the build.

^ permalink raw reply

* Re: [PATCH v2] hysdn: fix to a race condition in put_log_buffer
From: David Miller @ 2017-08-07 18:25 UTC (permalink / raw)
  To: avolkov
  Cc: isdn, sergei.shtylyov, netdev, linux-kernel, ldv-project,
	khoroshilov
In-Reply-To: <1502110454-3996-1-git-send-email-avolkov@ispras.ru>

From: Anton Volkov <avolkov@ispras.ru>
Date: Mon,  7 Aug 2017 15:54:14 +0300

> The synchronization type that was used earlier to guard the loop that
> deletes unused log buffers may lead to a situation that prevents any
> thread from going through the loop.
> 
> The patch deletes previously used synchronization mechanism and moves
> the loop under the spin_lock so the similar cases won't be feasible in
> the future.
> 
> Found by by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Anton Volkov <avolkov@ispras.ru>
> ---
> v2: Fixed coding style issues

Applied.

^ permalink raw reply

* Re: [PATCH net 1/1] s390/qeth: fix L3 next-hop in xmit qeth hdr
From: David Miller @ 2017-08-07 18:25 UTC (permalink / raw)
  To: ubraun; +Cc: netdev, linux-s390, jwi, schwidefsky, heiko.carstens, raspl
In-Reply-To: <20170807112839.91254-2-ubraun@linux.vnet.ibm.com>

From: Ursula Braun <ubraun@linux.vnet.ibm.com>
Date: Mon,  7 Aug 2017 13:28:39 +0200

> From: Julian Wiedmann <jwi@linux.vnet.ibm.com>
> 
> On L3, the qeth_hdr struct needs to be filled with the next-hop
> IP address.
> The current code accesses rtable->rt_gateway without checking that
> rtable is a valid address. The accidental access to a lowcore area
> results in a random next-hop address in the qeth_hdr.
> rtable (or more precisely, skb_dst(skb)) can be NULL in rare cases
> (for instance together with AF_PACKET sockets).
> This patch adds the missing NULL-ptr checks.
> 
> Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
> Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
> Fixes: 87e7597b5a3 qeth: Move away from using neighbour entries in qeth_l3_fill_header()

Applied.

^ permalink raw reply

* Re: [PATCH net-next v1 1/2] bpf: Move check_uarg_tail_zero() upward
From: Daniel Borkmann @ 2017-08-07 18:24 UTC (permalink / raw)
  To: Mickaël Salaün, linux-kernel
  Cc: Alexei Starovoitov, David S . Miller, Kees Cook, Martin KaFai Lau,
	netdev, Alexei Starovoitov
In-Reply-To: <20170807163605.14194-1-mic@digikod.net>

On 08/07/2017 06:36 PM, Mickaël Salaün wrote:
> The function check_uarg_tail_zero() may be useful for other part of the
> code in the syscall.c file. Move this function at the beginning of the
> file.
>
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Martin KaFai Lau <kafai@fb.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

^ permalink raw reply

* Re: [PATCH] hns3: fix unused function warning
From: David Miller @ 2017-08-07 18:24 UTC (permalink / raw)
  To: arnd
  Cc: yisen.zhuang, salil.mehta, xavier.huwei, lipeng321, netdev,
	linux-kernel
In-Reply-To: <20170807104230.3564976-1-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Mon,  7 Aug 2017 12:41:53 +0200

> Without CONFIG_PCI_IOV, we get a harmless warning about an
> unused function:
> 
> drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:2273:13: error: 'hclge_disable_sriov' defined but not used [-Werror=unused-function]
> 
> The #ifdefs in this driver are obviously wrong, so this just
> removes them and uses an IS_ENABLED() check that does the same
> thing correctly in a more readable way.
> 
> Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied.

^ permalink raw reply

* Re: [pull request][for-next 0/8] Mellanox, mlx5 shared 2017-08-07
From: David Miller @ 2017-08-07 18:20 UTC (permalink / raw)
  To: saeedm-VPRAkNaXOzVWk0Htik3J/w
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, leonro-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <20170807101808.22924-1-saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Saeed Mahameed <saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Date: Mon,  7 Aug 2017 13:18:00 +0300

> Hi Dave & Doug,
> 
> This series contains some low level updates for mlx5 core driver,
> to be shared as base code for net-next and rdma for-next mlx5
> 4.14 submissions.
> 
> Please find more information in the tag message below.
> 
> Please pull and let me know if there's any porblem.
> 
> Side note:
> This series merges cleanly with current net-next, but it will conflict with Jiri's patch
> "mlx5e: push cls_flower and mqprio setup_tc processing into separate functions"
> Which is under review.
> since this is shared code and must go to both rdma and net-next it has to be
> based on 4.13-rc4, so there is not much I can do about this.

I resolved the merge conflict as best as I could, please take a look.

Pulled, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH v1 net] TCP_USER_TIMEOUT and tcp_keepalive should conform to RFC5482
From: Rao Shoaib @ 2017-08-07 18:16 UTC (permalink / raw)
  To: davem, kuznet; +Cc: netdev

Change from version 0: Rationale behind the change:

The man page for tcp(7) states

when used with the TCP keepalive (SO_KEEPALIVE) option, TCP_USER_TIMEOUT will
override keepalive to  determine  when to close a connection due to keepalive
failure.

This is ambigious at best. user expectation is most likely that the connection
will be reset after TCP_USER_TIMEOUT milliseconds of inactivity.

The code however waits for the keepalive to kick-in (default 2hrs) and than
after one failure resets the conenction. 

What is the rationale for that ? The same effect can be obtained by simply
changing the value of tcp_keep_alive_probes.

Since the TCP_USER_TIMEOUT option was added based on RFC 5482 we need to follow 
the RFC. Which states

4.2 TCP keep-Alives:
   Some TCP implementations, such as those in BSD systems, use a
   different abort policy for TCP keep-alives than for user data.  Thus,
   the TCP keep-alive mechanism might abort a connection that would
   otherwise have survived the transient period without connectivity.
   Therefore, if a connection that enables keep-alives is also using the
   TCP User Timeout Option, then the keep-alive timer MUST be set to a
   value larger than that of the adopted USER TIMEOUT.

This patch enforces the MUST and also dis-associates user timeout from keep
alive.  A man page patch will be submitted separately.

Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com>
---
 net/ipv4/tcp.c       | 10 ++++++++--
 net/ipv4/tcp_timer.c |  9 +--------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 71ce33d..f2af44d 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2628,7 +2628,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
 		break;
 
 	case TCP_KEEPIDLE:
-		if (val < 1 || val > MAX_TCP_KEEPIDLE)
+		/* Per RFC5482 keepalive_time must be > user_timeout */
+		if (val < 1 || val > MAX_TCP_KEEPIDLE ||
+		    ((val * HZ) <= icsk->icsk_user_timeout))
 			err = -EINVAL;
 		else {
 			tp->keepalive_time = val * HZ;
@@ -2724,8 +2726,12 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
 	case TCP_USER_TIMEOUT:
 		/* Cap the max time in ms TCP will retry or probe the window
 		 * before giving up and aborting (ETIMEDOUT) a connection.
+		 * Per RFC5482 TCP user timeout must be < keepalive_time.
+		 * If the default value changes later -- all bets are off.
 		 */
-		if (val < 0)
+		if (val < 0 || (tp->keepalive_time &&
+				tp->keepalive_time <= msecs_to_jiffies(val)) ||
+		   net->ipv4.sysctl_tcp_keepalive_time <= msecs_to_jiffies(val))
 			err = -EINVAL;
 		else
 			icsk->icsk_user_timeout = msecs_to_jiffies(val);
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index c0feeee..d39fe60 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -664,14 +664,7 @@ static void tcp_keepalive_timer (unsigned long data)
 	elapsed = keepalive_time_elapsed(tp);
 
 	if (elapsed >= keepalive_time_when(tp)) {
-		/* If the TCP_USER_TIMEOUT option is enabled, use that
-		 * to determine when to timeout instead.
-		 */
-		if ((icsk->icsk_user_timeout != 0 &&
-		    elapsed >= icsk->icsk_user_timeout &&
-		    icsk->icsk_probes_out > 0) ||
-		    (icsk->icsk_user_timeout == 0 &&
-		    icsk->icsk_probes_out >= keepalive_probes(tp))) {
+		if (icsk->icsk_probes_out >= keepalive_probes(tp)) {
 			tcp_send_active_reset(sk, GFP_ATOMIC);
 			tcp_write_err(sk);
 			goto out;
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH net-next v3 13/13] net: switchdev: Remove bridge bypass support from switchdev
From: Florian Fainelli @ 2017-08-07 18:13 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev
  Cc: davem, jiri, ivecera, andrew, vivien.didelot, Woojung.Huh, mlxsw
In-Reply-To: <1502025351-41261-14-git-send-email-arkadis@mellanox.com>

On 08/06/2017 06:15 AM, Arkadi Sharshevsky wrote:
> Currently the bridge port flags, vlans, FDBs and MDBs can be offloaded
> through the bridge code, making the switchdev's SELF bridge bypass
> implementation to be redundant. This implies several changes:
> - No need for dump infra in switchdev, DSA's special case is handled
>   privately.
> - Remove obj_dump from switchdev_ops.
> - FDBs are removed from obj_add/del routines, due to the fact that they
>   are offloaded through the bridge notification chain.
> - The switchdev_port_bridge_xx() and switchdev_port_fdb_xx() functions
>   can be removed.
> 
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next v4 2/2] bpf: add a test case for syscalls/sys_{enter|exit}_* tracepoints
From: Daniel Borkmann @ 2017-08-07 18:12 UTC (permalink / raw)
  To: Yonghong Song, peterz, rostedt, ast, netdev; +Cc: kernel-team
In-Reply-To: <20170804230010.2792119-3-yhs@fb.com>

On 08/05/2017 01:00 AM, Yonghong Song wrote:
> Signed-off-by: Yonghong Song <yhs@fb.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

^ permalink raw reply

* Re: [PATCH net-next v3 12/13] net: bridge: Remove FDB deletion through switchdev object
From: Florian Fainelli @ 2017-08-07 18:12 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev
  Cc: davem, jiri, ivecera, andrew, vivien.didelot, Woojung.Huh, mlxsw
In-Reply-To: <1502025351-41261-13-git-send-email-arkadis@mellanox.com>

On 08/06/2017 06:15 AM, Arkadi Sharshevsky wrote:
> At this point no driver supports FDB add/del through switchdev object
> but rather via notification chain, thus, it is removed.
> 
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next v3 09/13] net: dsa: Remove support for MDB dump from DSA's drivers
From: Florian Fainelli @ 2017-08-07 18:09 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev
  Cc: davem, jiri, ivecera, andrew, vivien.didelot, Woojung.Huh, mlxsw
In-Reply-To: <1502025351-41261-10-git-send-email-arkadis@mellanox.com>

On 08/06/2017 06:15 AM, Arkadi Sharshevsky wrote:
> This is done as a preparation before removing support for MDB dump from
> DSA core. The MDBs are synced with the bridge and thus there is no
> need for special dump operation support.
> 
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next v3 08/13] net: dsa: Remove support for bypass bridge port attributes/vlan set
From: Florian Fainelli @ 2017-08-07 18:09 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev
  Cc: davem, jiri, ivecera, andrew, vivien.didelot, Woojung.Huh, mlxsw
In-Reply-To: <1502025351-41261-9-git-send-email-arkadis@mellanox.com>

On 08/06/2017 06:15 AM, Arkadi Sharshevsky wrote:
> The bridge port attributes/vlan for DSA devices should be set only
> from bridge code. Furthermore, The vlans are synced totally with the
> bridge so there is no need for special dump support.
> 
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [RFC] iproute: Add support for extended ack to rtnl_talk
From: David Ahern @ 2017-08-07 18:09 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Simon Horman, Daniel Borkmann, Phil Sutter, David Miller, netdev
In-Reply-To: <20170807110649.052e028a@xeon-e3>

On 8/7/17 12:06 PM, Stephen Hemminger wrote:
>> Does not work. Seems like you pushed the RFC commit which was known to
>> be incomplete.
> 
> Patches welcome.

What exists does not even compile. Patches will be sent once you fix that.

^ permalink raw reply

* Re: [PATCH net-next v3 07/13] net: dsa: Remove support for vlan dump from DSA's drivers
From: Florian Fainelli @ 2017-08-07 18:09 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev
  Cc: davem, jiri, ivecera, andrew, vivien.didelot, Woojung.Huh, mlxsw
In-Reply-To: <1502025351-41261-8-git-send-email-arkadis@mellanox.com>

On 08/06/2017 06:15 AM, Arkadi Sharshevsky wrote:
> This is done as a preparation before removing support for vlan dump from
> DSA core. The vlans are synced with the bridge and thus there is no
> need for special dump operation support.
> 
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next v3 05/13] net: dsa: Move FDB add/del implementation inside DSA
From: Florian Fainelli @ 2017-08-07 18:08 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev
  Cc: davem, jiri, ivecera, andrew, vivien.didelot, Woojung.Huh, mlxsw
In-Reply-To: <1502025351-41261-6-git-send-email-arkadis@mellanox.com>

On 08/06/2017 06:15 AM, Arkadi Sharshevsky wrote:
> Currently DSA uses switchdev's implementation of FDB add/del ndos. This
> patch moves the implementation inside DSA in order to support the legacy
> way for static FDB configuration.
> 
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next v3 04/13] net: dsa: Add support for learning FDB through notification
From: Florian Fainelli @ 2017-08-07 18:07 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev
  Cc: davem, jiri, ivecera, andrew, vivien.didelot, Woojung.Huh, mlxsw
In-Reply-To: <1502025351-41261-5-git-send-email-arkadis@mellanox.com>

On 08/06/2017 06:15 AM, Arkadi Sharshevsky wrote:
> Add support for learning FDB through notification. The driver defers
> the hardware update via ordered work queue. In case of a successful
> FDB add a notification is sent back to bridge.
> 
> In case of hw FDB del failure the static FDB will be deleted from
> the bridge, thus, the interface is moved to down state in order to
> indicate inconsistent situation.
> 
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [RFC] iproute: Add support for extended ack to rtnl_talk
From: Stephen Hemminger @ 2017-08-07 18:06 UTC (permalink / raw)
  To: David Ahern
  Cc: Simon Horman, Daniel Borkmann, Phil Sutter, David Miller, netdev
In-Reply-To: <8e8bc709-55b0-e207-b4bf-605bdf2ba323@gmail.com>

On Mon, 7 Aug 2017 10:48:23 -0600
David Ahern <dsahern@gmail.com> wrote:

> On 8/4/17 10:47 AM, Stephen Hemminger wrote:
> > I will put in the libmnl version. If it doesn't work because no one sent
> > me test cases, then fine. send a patch for that.  
> 
> This commit:
> 
> commit b6432e68ac2f1f6b4ea50aa0d6d47e72c445c71c
> Author: Stephen Hemminger <stephen@networkplumber.org>
> Date:   Fri Aug 4 09:52:15 2017 -0700
> 
>     iproute: Add support for extended ack to rtnl_talk
> 
> 
> Does not work. Seems like you pushed the RFC commit which was known to
> be incomplete.

Patches welcome.

> First, the Config is HAVE_MNL not HAVE_LIBMNL which is in lib/libnetlink.c.
> 
> Second, changing that to HAVE_MNL does not work -- something is not
> getting passed in correctly. Just remove the semicolon on the else path:
> 
> +#else
> +/* No extended error ack without libmnl */
> +static int nl_dump_ext_err(const struct nlmsghdr *nlh, nl_ext_ack_fn_t
> errfn)
> +{
> +       return 0;
> +}
> +#endif
> 
> and you will see that HAVE_MNL is never defined.

Ok, that I will fix.

^ permalink raw reply

* Re: [PATCH net-next v3 10/13] net: dsa: Remove redundant MDB dump support
From: Florian Fainelli @ 2017-08-07 18:04 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev
  Cc: davem, jiri, ivecera, andrew, vivien.didelot, Woojung.Huh, mlxsw
In-Reply-To: <1502025351-41261-11-git-send-email-arkadis@mellanox.com>

On 08/06/2017 06:15 AM, Arkadi Sharshevsky wrote:
> Currently the MDB HW database is synced with the bridge's one, thus,
> There is no need to support special dump functionality.
> 
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next v3 06/13] net: dsa: Add support for querying supported bridge flags
From: Florian Fainelli @ 2017-08-07 18:01 UTC (permalink / raw)
  To: Arkadi Sharshevsky, netdev
  Cc: davem, jiri, ivecera, andrew, vivien.didelot, Woojung.Huh, mlxsw
In-Reply-To: <1502025351-41261-7-git-send-email-arkadis@mellanox.com>

On 08/06/2017 06:15 AM, Arkadi Sharshevsky wrote:
> The DSA drivers do not support bridge flags offload. Yet, this attribute
> should be added in order for the bridge to fail when one tries set a
> flag on the port, as explained in commit dc0ecabd6231 ("net: switchdev:
> Add support for querying supported bridge flags by hardware").
> 
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox