Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH iproute2/net-next] ss: initialise variables outside of for loop
From: Stephen Hemminger @ 2016-12-02 22:18 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev
In-Reply-To: <1480679765-9014-1-git-send-email-simon.horman@netronome.com>

On Fri,  2 Dec 2016 12:56:05 +0100
Simon Horman <simon.horman@netronome.com> wrote:

> Initialise for loops outside of for loops. GCC flags this as being
> out of spec unless C99 or C11 mode is used.
> 
> With this change the entire tree appears to compile cleanly with -Wall.
> 
> $ gcc --version
> gcc (Debian 4.9.2-10) 4.9.2
> ...
> $ make
> ...
> ss.c: In function ‘unix_show_sock’:
> ss.c:3128:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
> ...
> 
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

Applied.
Note, I used to have -Wall in Makefile but old GCC were broken and would give
aliasing warnings.

^ permalink raw reply

* Re: [PATCH net-next v2 6/6] tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING
From: Paul Gortmaker @ 2016-12-02 22:30 UTC (permalink / raw)
  To: Yuchung Cheng
  Cc: David Miller, soheil, francisyyan, netdev, ncardwell, edumazet,
	linux-next@vger.kernel.org
In-Reply-To: <1480316838-154141-7-git-send-email-ycheng@google.com>

On Mon, Nov 28, 2016 at 2:07 AM, Yuchung Cheng <ycheng@google.com> wrote:
> From: Francis Yan <francisyyan@gmail.com>
>
> This patch exports the sender chronograph stats via the socket
> SO_TIMESTAMPING channel. Currently we can instrument how long a
> particular application unit of data was queued in TCP by tracking
> SOF_TIMESTAMPING_TX_SOFTWARE and SOF_TIMESTAMPING_TX_SCHED. Having

Seems a new linux-next failure leads back to here ; I did not run a
full bisect, since the variable seems confined to this commit:

net/socket.c:701: error: 'SCM_TIMESTAMPING_OPT_STATS' undeclared
(first use in this function)

http://kisskb.ellerman.id.au/kisskb/buildresult/12875981/

Paul.
--

> these sender chronograph stats exported simultaneously along with
> these timestamps allow further breaking down the various sender
> limitation.  For example, a video server can tell if a particular
> chunk of video on a connection takes a long time to deliver because
> TCP was experiencing small receive window. It is not possible to
> tell before this patch without packet traces.
>
> To prepare these stats, the user needs to set
> SOF_TIMESTAMPING_OPT_STATS and SOF_TIMESTAMPING_OPT_TSONLY flags
> while requesting other SOF_TIMESTAMPING TX timestamps. When the
> timestamps are available in the error queue, the stats are returned
> in a separate control message of type SCM_TIMESTAMPING_OPT_STATS,
> in a list of TLVs (struct nlattr) of types: TCP_NLA_BUSY_TIME,
> TCP_NLA_RWND_LIMITED, TCP_NLA_SNDBUF_LIMITED. Unit is microsecond.
>
> Signed-off-by: Francis Yan <francisyyan@gmail.com>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
> ---
> ChangeLog since v1:
>  - fix build break if CONFIG_INET is not defined
>
>  Documentation/networking/timestamping.txt | 10 ++++++++++
>  arch/alpha/include/uapi/asm/socket.h      |  2 ++
>  arch/frv/include/uapi/asm/socket.h        |  2 ++
>  arch/ia64/include/uapi/asm/socket.h       |  2 ++
>  arch/m32r/include/uapi/asm/socket.h       |  2 ++
>  arch/mips/include/uapi/asm/socket.h       |  2 ++
>  arch/mn10300/include/uapi/asm/socket.h    |  2 ++
>  arch/parisc/include/uapi/asm/socket.h     |  2 ++
>  arch/powerpc/include/uapi/asm/socket.h    |  2 ++
>  arch/s390/include/uapi/asm/socket.h       |  2 ++
>  arch/sparc/include/uapi/asm/socket.h      |  2 ++
>  arch/xtensa/include/uapi/asm/socket.h     |  2 ++
>  include/linux/tcp.h                       |  2 ++
>  include/uapi/asm-generic/socket.h         |  2 ++
>  include/uapi/linux/net_tstamp.h           |  3 ++-
>  include/uapi/linux/tcp.h                  |  8 ++++++++
>  net/core/skbuff.c                         | 14 +++++++++++---
>  net/core/sock.c                           |  7 +++++++
>  net/ipv4/tcp.c                            | 20 ++++++++++++++++++++
>  net/socket.c                              |  7 ++++++-
>  20 files changed, 90 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking/timestamping.txt
> index 671cccf..96f5069 100644
> --- a/Documentation/networking/timestamping.txt
> +++ b/Documentation/networking/timestamping.txt
> @@ -182,6 +182,16 @@ SOF_TIMESTAMPING_OPT_TSONLY:
>    the timestamp even if sysctl net.core.tstamp_allow_data is 0.
>    This option disables SOF_TIMESTAMPING_OPT_CMSG.
>
> +SOF_TIMESTAMPING_OPT_STATS:
> +
> +  Optional stats that are obtained along with the transmit timestamps.
> +  It must be used together with SOF_TIMESTAMPING_OPT_TSONLY. When the
> +  transmit timestamp is available, the stats are available in a
> +  separate control message of type SCM_TIMESTAMPING_OPT_STATS, as a
> +  list of TLVs (struct nlattr) of types. These stats allow the
> +  application to associate various transport layer stats with
> +  the transmit timestamps, such as how long a certain block of
> +  data was limited by peer's receiver window.
>
>  New applications are encouraged to pass SOF_TIMESTAMPING_OPT_ID to
>  disambiguate timestamps and SOF_TIMESTAMPING_OPT_TSONLY to operate
> diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
> index 9e46d6e..afc901b 100644
> --- a/arch/alpha/include/uapi/asm/socket.h
> +++ b/arch/alpha/include/uapi/asm/socket.h
> @@ -97,4 +97,6 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* _UAPI_ASM_SOCKET_H */
> diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h
> index afbc98f0..81e0353 100644
> --- a/arch/frv/include/uapi/asm/socket.h
> +++ b/arch/frv/include/uapi/asm/socket.h
> @@ -90,5 +90,7 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* _ASM_SOCKET_H */
>
> diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h
> index 0018fad..57feb0c 100644
> --- a/arch/ia64/include/uapi/asm/socket.h
> +++ b/arch/ia64/include/uapi/asm/socket.h
> @@ -99,4 +99,6 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* _ASM_IA64_SOCKET_H */
> diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
> index 5fe42fc..5853f8e9 100644
> --- a/arch/m32r/include/uapi/asm/socket.h
> +++ b/arch/m32r/include/uapi/asm/socket.h
> @@ -90,4 +90,6 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* _ASM_M32R_SOCKET_H */
> diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
> index 2027240a..566ecdc 100644
> --- a/arch/mips/include/uapi/asm/socket.h
> +++ b/arch/mips/include/uapi/asm/socket.h
> @@ -108,4 +108,6 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* _UAPI_ASM_SOCKET_H */
> diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h
> index 5129f23..0e12527 100644
> --- a/arch/mn10300/include/uapi/asm/socket.h
> +++ b/arch/mn10300/include/uapi/asm/socket.h
> @@ -90,4 +90,6 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* _ASM_SOCKET_H */
> diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
> index 9c935d7..7a109b7 100644
> --- a/arch/parisc/include/uapi/asm/socket.h
> +++ b/arch/parisc/include/uapi/asm/socket.h
> @@ -89,4 +89,6 @@
>
>  #define SO_CNX_ADVICE          0x402E
>
> +#define SCM_TIMESTAMPING_OPT_STATS     0x402F
> +
>  #endif /* _UAPI_ASM_SOCKET_H */
> diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h
> index 1672e33..44583a5 100644
> --- a/arch/powerpc/include/uapi/asm/socket.h
> +++ b/arch/powerpc/include/uapi/asm/socket.h
> @@ -97,4 +97,6 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* _ASM_POWERPC_SOCKET_H */
> diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h
> index 41b51c2..b24a64c 100644
> --- a/arch/s390/include/uapi/asm/socket.h
> +++ b/arch/s390/include/uapi/asm/socket.h
> @@ -96,4 +96,6 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* _ASM_SOCKET_H */
> diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
> index 31aede3..a25dc32 100644
> --- a/arch/sparc/include/uapi/asm/socket.h
> +++ b/arch/sparc/include/uapi/asm/socket.h
> @@ -86,6 +86,8 @@
>
>  #define SO_CNX_ADVICE          0x0037
>
> +#define SCM_TIMESTAMPING_OPT_STATS     0x0038
> +
>  /* Security levels - as per NRL IPv6 - don't actually do anything */
>  #define SO_SECURITY_AUTHENTICATION             0x5001
>  #define SO_SECURITY_ENCRYPTION_TRANSPORT       0x5002
> diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
> index 81435d9..9fdbe1f 100644
> --- a/arch/xtensa/include/uapi/asm/socket.h
> +++ b/arch/xtensa/include/uapi/asm/socket.h
> @@ -101,4 +101,6 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* _XTENSA_SOCKET_H */
> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
> index d5d3bd8..00e0ee8 100644
> --- a/include/linux/tcp.h
> +++ b/include/linux/tcp.h
> @@ -428,4 +428,6 @@ static inline void tcp_saved_syn_free(struct tcp_sock *tp)
>         tp->saved_syn = NULL;
>  }
>
> +struct sk_buff *tcp_get_timestamping_opt_stats(const struct sock *sk);
> +
>  #endif /* _LINUX_TCP_H */
> diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
> index 67d632f..2c748dd 100644
> --- a/include/uapi/asm-generic/socket.h
> +++ b/include/uapi/asm-generic/socket.h
> @@ -92,4 +92,6 @@
>
>  #define SO_CNX_ADVICE          53
>
> +#define SCM_TIMESTAMPING_OPT_STATS     54
> +
>  #endif /* __ASM_GENERIC_SOCKET_H */
> diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
> index 264e515..464dcca 100644
> --- a/include/uapi/linux/net_tstamp.h
> +++ b/include/uapi/linux/net_tstamp.h
> @@ -25,8 +25,9 @@ enum {
>         SOF_TIMESTAMPING_TX_ACK = (1<<9),
>         SOF_TIMESTAMPING_OPT_CMSG = (1<<10),
>         SOF_TIMESTAMPING_OPT_TSONLY = (1<<11),
> +       SOF_TIMESTAMPING_OPT_STATS = (1<<12),
>
> -       SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_TSONLY,
> +       SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_STATS,
>         SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
>                                  SOF_TIMESTAMPING_LAST
>  };
> diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
> index 2863b66..c53de26 100644
> --- a/include/uapi/linux/tcp.h
> +++ b/include/uapi/linux/tcp.h
> @@ -220,6 +220,14 @@ struct tcp_info {
>         __u64   tcpi_sndbuf_limited; /* Time (usec) limited by send buffer */
>  };
>
> +/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
> +enum {
> +       TCP_NLA_PAD,
> +       TCP_NLA_BUSY,           /* Time (usec) busy sending data */
> +       TCP_NLA_RWND_LIMITED,   /* Time (usec) limited by receive window */
> +       TCP_NLA_SNDBUF_LIMITED, /* Time (usec) limited by send buffer */
> +};
> +
>  /* for TCP_MD5SIG socket option */
>  #define TCP_MD5SIG_MAXKEYLEN   80
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index d1d1a5a..ea6fa95 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -3839,10 +3839,18 @@ void __skb_tstamp_tx(struct sk_buff *orig_skb,
>         if (!skb_may_tx_timestamp(sk, tsonly))
>                 return;
>
> -       if (tsonly)
> -               skb = alloc_skb(0, GFP_ATOMIC);
> -       else
> +       if (tsonly) {
> +#ifdef CONFIG_INET
> +               if ((sk->sk_tsflags & SOF_TIMESTAMPING_OPT_STATS) &&
> +                   sk->sk_protocol == IPPROTO_TCP &&
> +                   sk->sk_type == SOCK_STREAM)
> +                       skb = tcp_get_timestamping_opt_stats(sk);
> +               else
> +#endif
> +                       skb = alloc_skb(0, GFP_ATOMIC);
> +       } else {
>                 skb = skb_clone(orig_skb, GFP_ATOMIC);
> +       }
>         if (!skb)
>                 return;
>
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 14e6145..d8c7f8c 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -854,6 +854,13 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
>                                 sk->sk_tskey = 0;
>                         }
>                 }
> +
> +               if (val & SOF_TIMESTAMPING_OPT_STATS &&
> +                   !(val & SOF_TIMESTAMPING_OPT_TSONLY)) {
> +                       ret = -EINVAL;
> +                       break;
> +               }
> +
>                 sk->sk_tsflags = val;
>                 if (val & SOF_TIMESTAMPING_RX_SOFTWARE)
>                         sock_enable_timestamp(sk,
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index cdde20f..1149b48 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -2841,6 +2841,26 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
>  }
>  EXPORT_SYMBOL_GPL(tcp_get_info);
>
> +struct sk_buff *tcp_get_timestamping_opt_stats(const struct sock *sk)
> +{
> +       const struct tcp_sock *tp = tcp_sk(sk);
> +       struct sk_buff *stats;
> +       struct tcp_info info;
> +
> +       stats = alloc_skb(3 * nla_total_size_64bit(sizeof(u64)), GFP_ATOMIC);
> +       if (!stats)
> +               return NULL;
> +
> +       tcp_get_info_chrono_stats(tp, &info);
> +       nla_put_u64_64bit(stats, TCP_NLA_BUSY,
> +                         info.tcpi_busy_time, TCP_NLA_PAD);
> +       nla_put_u64_64bit(stats, TCP_NLA_RWND_LIMITED,
> +                         info.tcpi_rwnd_limited, TCP_NLA_PAD);
> +       nla_put_u64_64bit(stats, TCP_NLA_SNDBUF_LIMITED,
> +                         info.tcpi_sndbuf_limited, TCP_NLA_PAD);
> +       return stats;
> +}
> +
>  static int do_tcp_getsockopt(struct sock *sk, int level,
>                 int optname, char __user *optval, int __user *optlen)
>  {
> diff --git a/net/socket.c b/net/socket.c
> index e2584c5..e631894 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -693,9 +693,14 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
>             (sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE) &&
>             ktime_to_timespec_cond(shhwtstamps->hwtstamp, tss.ts + 2))
>                 empty = 0;
> -       if (!empty)
> +       if (!empty) {
>                 put_cmsg(msg, SOL_SOCKET,
>                          SCM_TIMESTAMPING, sizeof(tss), &tss);
> +
> +               if (skb->len && (sk->sk_tsflags & SOF_TIMESTAMPING_OPT_STATS))
> +                       put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMPING_OPT_STATS,
> +                                skb->len, skb->data);
> +       }
>  }
>  EXPORT_SYMBOL_GPL(__sock_recv_timestamp);
>
> --
> 2.8.0.rc3.226.g39d4020
>

^ permalink raw reply

* Re: [PATCH net v2] tcp: warn on bogus MSS and try to amend it
From: Marcelo Ricardo Leitner @ 2016-12-02 22:43 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: netdev, Jon Maxwell, Alex Sidorenko, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy, tlfalcon,
	Brian King, davem
In-Reply-To: <1480689924.18162.356.camel@edumazet-glaptop3.roam.corp.google.com>

On Fri, Dec 02, 2016 at 06:45:24AM -0800, Eric Dumazet wrote:
> On Fri, 2016-12-02 at 08:55 -0200, Marcelo Ricardo Leitner wrote:
> > There have been some reports lately about TCP connection stalls caused
> > by NIC drivers that aren't setting gso_size on aggregated packets on rx
> > path. This causes TCP to assume that the MSS is actually the size of the
> > aggregated packet, which is invalid.
> > 
> > Although the proper fix is to be done at each driver, it's often hard
> > and cumbersome for one to debug, come to such root cause and report/fix
> > it.
> > 
> > This patch amends this situation in two ways. First, it adds a warning
> > on when this situation occurs, so it gives a hint to those trying to
> > debug this. It also limit the maximum probed MSS to the adverised MSS,
> > as it should never be any higher than that.
> > 
> > The result is that the connection may not have the best performance ever
> > but it shouldn't stall, and the admin will have a hint on what to look
> > for.
> > 
> > Tested with virtio by forcing gso_size to 0.
> > 
> > Cc: Jonathan Maxwell <jmaxwell37@gmail.com>
> > Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> > ---
> > v2: Updated msg as suggested by David.
> > 
> >  net/ipv4/tcp_input.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> > index a27b9c0e27c08b4e4aeaff3d0bfdf3ae561ba4d8..fd619eb93749b6de56a41669248b337c051d9fe2 100644
> > --- a/net/ipv4/tcp_input.c
> > +++ b/net/ipv4/tcp_input.c
> > @@ -144,7 +144,10 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb)
> >  	 */
> >  	len = skb_shinfo(skb)->gso_size ? : skb->len;
> >  	if (len >= icsk->icsk_ack.rcv_mss) {
> > -		icsk->icsk_ack.rcv_mss = len;
> > +		icsk->icsk_ack.rcv_mss = min_t(unsigned int, len,
> > +					       tcp_sk(sk)->advmss);
> > +		if (icsk->icsk_ack.rcv_mss != len)
> > +			pr_warn_once("Driver has suspect GRO implementation, TCP performance may be compromised.\n");
> >  	} else {
> >  		/* Otherwise, we make more careful check taking into account,
> >  		 * that SACKs block is variable.
> 
> 
> skb->dev is indeed NULL, but it might be worth getting back the device
> using skb->skb_iif maybe ?
> 

Yes, then it's possible. But I have to add an extra check because it
involves a search (iif -> net_device) and I can't wrap that inside
pr_warn_once(). I hope it doesn't get too cluttered then. Posting v3 in
a few.. Thanks

^ permalink raw reply

* [PATCH net v3] tcp: warn on bogus MSS and try to amend it
From: Marcelo Ricardo Leitner @ 2016-12-02 22:51 UTC (permalink / raw)
  To: netdev
  Cc: Jon Maxwell, Alex Sidorenko, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, tlfalcon, Brian King,
	Eric Dumazet, davem, marcelo.leitner

There have been some reports lately about TCP connection stalls caused
by NIC drivers that aren't setting gso_size on aggregated packets on rx
path. This causes TCP to assume that the MSS is actually the size of the
aggregated packet, which is invalid.

Although the proper fix is to be done at each driver, it's often hard
and cumbersome for one to debug, come to such root cause and report/fix
it.

This patch amends this situation in two ways. First, it adds a warning
on when this situation occurs, so it gives a hint to those trying to
debug this. It also limit the maximum probed MSS to the adverised MSS,
as it should never be any higher than that.

The result is that the connection may not have the best performance ever
but it shouldn't stall, and the admin will have a hint on what to look
for.

Tested with virtio by forcing gso_size to 0.

v2: updated msg per David suggestion
v3: use skb_iif to find the interface and also log its name, per Eric
    Dumazet suggestion. As the skb may be backlogged and the interface
    gone by then, we need to check if the number still has a meaning.

Cc: Jonathan Maxwell <jmaxwell37@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
---
 net/ipv4/tcp_input.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index a27b9c0e27c08b4e4aeaff3d0bfdf3ae561ba4d8..042a8a895e97d04afbdc377830537e8fd3b15d1e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -144,7 +144,21 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb)
 	 */
 	len = skb_shinfo(skb)->gso_size ? : skb->len;
 	if (len >= icsk->icsk_ack.rcv_mss) {
-		icsk->icsk_ack.rcv_mss = len;
+		static bool __once __read_mostly;
+
+		icsk->icsk_ack.rcv_mss = min_t(unsigned int, len,
+					       tcp_sk(sk)->advmss);
+		if (icsk->icsk_ack.rcv_mss != len && !__once) {
+			struct net_device *dev;
+
+			__once = true;
+
+			rcu_read_lock();
+			dev = dev_get_by_index_rcu(sock_net(sk), skb->skb_iif);
+			pr_warn_once("%s: Driver has suspect GRO implementation, TCP performance may be compromised.\n",
+				     dev ? dev->name : "Unknown driver");
+			rcu_read_unlock();
+		}
 	} else {
 		/* Otherwise, we make more careful check taking into account,
 		 * that SACKs block is variable.
-- 
2.9.3

^ permalink raw reply related

* [PATCH v2 0/3] uapi: add kbuild for some files
From: Stephen Hemminger @ 2016-12-02 22:53 UTC (permalink / raw)
  To: davem; +Cc: netdev, pablo, jhs, Stephen Hemminger

Some files which are in uapi but not being copied
by make headers_install

Stephen Hemminger (3):
  tc: export tunnel key file
  uapi: export tc_skbmod.h
  uapi: export nf_log.h

 include/uapi/linux/netfilter/Kbuild | 1 +
 include/uapi/linux/tc_act/Kbuild    | 2 ++
 2 files changed, 3 insertions(+)

V2 - typo in s/sbkmod/skbmod/

-- 
2.10.2

^ permalink raw reply

* [PATCH 1/3] uapi: export tc tunnel key file
From: Stephen Hemminger @ 2016-12-02 22:53 UTC (permalink / raw)
  To: davem; +Cc: netdev, pablo, jhs, Stephen Hemminger
In-Reply-To: <20161202225400.32751-1-sthemmin@microsoft.com>

Fixes commit 21609ae32aaf6c6fab0e ("net/sched: Introduce act_tunnel_key")
The file is necessary for iproute2 headers but was not being
copied by make install_headers

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 include/uapi/linux/tc_act/Kbuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
index e3969bd..9611c7b 100644
--- a/include/uapi/linux/tc_act/Kbuild
+++ b/include/uapi/linux/tc_act/Kbuild
@@ -11,3 +11,4 @@ header-y += tc_vlan.h
 header-y += tc_bpf.h
 header-y += tc_connmark.h
 header-y += tc_ife.h
+header-y += tc_tunnel_key.h
-- 
2.10.2

^ permalink raw reply related

* [PATCH 2/3] uapi: export tc_skbmod.h
From: Stephen Hemminger @ 2016-12-02 22:53 UTC (permalink / raw)
  To: davem; +Cc: netdev, pablo, jhs, Stephen Hemminger
In-Reply-To: <20161202225400.32751-1-sthemmin@microsoft.com>

Fixes commit 735cffe5d800 ("net_sched: Introduce skbmod action")
Not used by iproute2 but maybe in future.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 include/uapi/linux/tc_act/Kbuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
index 9611c7b..e3db740 100644
--- a/include/uapi/linux/tc_act/Kbuild
+++ b/include/uapi/linux/tc_act/Kbuild
@@ -12,3 +12,4 @@ header-y += tc_bpf.h
 header-y += tc_connmark.h
 header-y += tc_ife.h
 header-y += tc_tunnel_key.h
+header-y += tc_skbmod.h
-- 
2.10.2

^ permalink raw reply related

* [PATCH 3/3] uapi: export nf_log.h
From: Stephen Hemminger @ 2016-12-02 22:54 UTC (permalink / raw)
  To: davem; +Cc: netdev, pablo, jhs, Stephen Hemminger
In-Reply-To: <20161202225400.32751-1-sthemmin@microsoft.com>

File is in uapi directory but not being copied on
 make install_headers

Fixes commit 4ec9c8fbbc22 ("netfilter: nft_log: complete
NFTA_LOG_FLAGS attr support").

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 include/uapi/linux/netfilter/Kbuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index cd26d7a..03f194a 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -5,6 +5,7 @@ header-y += nf_conntrack_ftp.h
 header-y += nf_conntrack_sctp.h
 header-y += nf_conntrack_tcp.h
 header-y += nf_conntrack_tuple_common.h
+header-y += nf_log.h
 header-y += nf_tables.h
 header-y += nf_tables_compat.h
 header-y += nf_nat.h
-- 
2.10.2

^ permalink raw reply related

* [PATCH 0/3] UAPI export missing headers
From: Stephen Hemminger @ 2016-12-02 22:50 UTC (permalink / raw)
  To: davem; +Cc: netdev, pablo, jhs, Stephen Hemminger

Files not being exported by make install headers

Stephen Hemminger (3):
  tc: export tunnel key file
  uapi: export tc_skbmod.h
  uapi: export nf_log.h

 include/uapi/linux/netfilter/Kbuild | 1 +
 include/uapi/linux/tc_act/Kbuild    | 2 ++
 2 files changed, 3 insertions(+)

-- 
2.10.2

^ permalink raw reply

* [PATCH 2/3] uapi: export tc_skbmod.h
From: Stephen Hemminger @ 2016-12-02 22:50 UTC (permalink / raw)
  To: davem; +Cc: netdev, pablo, jhs, Stephen Hemminger
In-Reply-To: <20161202225050.30048-1-sthemmin@microsoft.com>

Fixes commit 735cffe5d800 ("net_sched: Introduce skbmod action")
Not used by iproute2 but maybe in future.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 include/uapi/linux/tc_act/Kbuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
index 9611c7b..721433e 100644
--- a/include/uapi/linux/tc_act/Kbuild
+++ b/include/uapi/linux/tc_act/Kbuild
@@ -12,3 +12,4 @@ header-y += tc_bpf.h
 header-y += tc_connmark.h
 header-y += tc_ife.h
 header-y += tc_tunnel_key.h
+header-y += tc_sbkmod.h
-- 
2.10.2

^ permalink raw reply related

* [PATCH 1/3] uapi: export tc tunnel key file
From: Stephen Hemminger @ 2016-12-02 22:50 UTC (permalink / raw)
  To: davem; +Cc: netdev, pablo, jhs, Stephen Hemminger
In-Reply-To: <20161202225050.30048-1-sthemmin@microsoft.com>

Fixes commit 21609ae32aaf6c6fab0e ("net/sched: Introduce act_tunnel_key")
The file is necessary for iproute2 headers but was not being
copied by make install_headers

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 include/uapi/linux/tc_act/Kbuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
index e3969bd..9611c7b 100644
--- a/include/uapi/linux/tc_act/Kbuild
+++ b/include/uapi/linux/tc_act/Kbuild
@@ -11,3 +11,4 @@ header-y += tc_vlan.h
 header-y += tc_bpf.h
 header-y += tc_connmark.h
 header-y += tc_ife.h
+header-y += tc_tunnel_key.h
-- 
2.10.2

^ permalink raw reply related

* [PATCH 3/3] uapi: export nf_log.h
From: Stephen Hemminger @ 2016-12-02 22:50 UTC (permalink / raw)
  To: davem; +Cc: netdev, pablo, jhs, Stephen Hemminger
In-Reply-To: <20161202225050.30048-1-sthemmin@microsoft.com>

File is in uapi directory but not being copied on
 make install_headers

Fixes commit 4ec9c8fbbc22 ("netfilter: nft_log: complete
NFTA_LOG_FLAGS attr support").

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 include/uapi/linux/netfilter/Kbuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index cd26d7a..03f194a 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -5,6 +5,7 @@ header-y += nf_conntrack_ftp.h
 header-y += nf_conntrack_sctp.h
 header-y += nf_conntrack_tcp.h
 header-y += nf_conntrack_tuple_common.h
+header-y += nf_log.h
 header-y += nf_tables.h
 header-y += nf_tables_compat.h
 header-y += nf_nat.h
-- 
2.10.2

^ permalink raw reply related

* Re: [PATCH net-next v2 6/6] tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING
From: Yuchung Cheng @ 2016-12-02 23:02 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: David Miller, Soheil Hassas Yeganeh, Francis Yan, netdev,
	Neal Cardwell, Eric Dumazet, linux-next@vger.kernel.org
In-Reply-To: <CAP=VYLov97ujr_mmjb2HbsgBhsex2cBaAsp92DDU+HdmyC_gtQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 14342 bytes --]

On Fri, Dec 2, 2016 at 2:30 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> On Mon, Nov 28, 2016 at 2:07 AM, Yuchung Cheng <ycheng@google.com> wrote:
>> From: Francis Yan <francisyyan@gmail.com>
>>
>> This patch exports the sender chronograph stats via the socket
>> SO_TIMESTAMPING channel. Currently we can instrument how long a
>> particular application unit of data was queued in TCP by tracking
>> SOF_TIMESTAMPING_TX_SOFTWARE and SOF_TIMESTAMPING_TX_SCHED. Having
>
> Seems a new linux-next failure leads back to here ; I did not run a
> full bisect, since the variable seems confined to this commit:
>
> net/socket.c:701: error: 'SCM_TIMESTAMPING_OPT_STATS' undeclared
> (first use in this function)
>
> http://kisskb.ellerman.id.au/kisskb/buildresult/12875981/
oops didn't patch avr32 arch. Does this fix work?

>
> Paul.
> --
>
>> these sender chronograph stats exported simultaneously along with
>> these timestamps allow further breaking down the various sender
>> limitation.  For example, a video server can tell if a particular
>> chunk of video on a connection takes a long time to deliver because
>> TCP was experiencing small receive window. It is not possible to
>> tell before this patch without packet traces.
>>
>> To prepare these stats, the user needs to set
>> SOF_TIMESTAMPING_OPT_STATS and SOF_TIMESTAMPING_OPT_TSONLY flags
>> while requesting other SOF_TIMESTAMPING TX timestamps. When the
>> timestamps are available in the error queue, the stats are returned
>> in a separate control message of type SCM_TIMESTAMPING_OPT_STATS,
>> in a list of TLVs (struct nlattr) of types: TCP_NLA_BUSY_TIME,
>> TCP_NLA_RWND_LIMITED, TCP_NLA_SNDBUF_LIMITED. Unit is microsecond.
>>
>> Signed-off-by: Francis Yan <francisyyan@gmail.com>
>> Signed-off-by: Yuchung Cheng <ycheng@google.com>
>> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
>> ---
>> ChangeLog since v1:
>>  - fix build break if CONFIG_INET is not defined
>>
>>  Documentation/networking/timestamping.txt | 10 ++++++++++
>>  arch/alpha/include/uapi/asm/socket.h      |  2 ++
>>  arch/frv/include/uapi/asm/socket.h        |  2 ++
>>  arch/ia64/include/uapi/asm/socket.h       |  2 ++
>>  arch/m32r/include/uapi/asm/socket.h       |  2 ++
>>  arch/mips/include/uapi/asm/socket.h       |  2 ++
>>  arch/mn10300/include/uapi/asm/socket.h    |  2 ++
>>  arch/parisc/include/uapi/asm/socket.h     |  2 ++
>>  arch/powerpc/include/uapi/asm/socket.h    |  2 ++
>>  arch/s390/include/uapi/asm/socket.h       |  2 ++
>>  arch/sparc/include/uapi/asm/socket.h      |  2 ++
>>  arch/xtensa/include/uapi/asm/socket.h     |  2 ++
>>  include/linux/tcp.h                       |  2 ++
>>  include/uapi/asm-generic/socket.h         |  2 ++
>>  include/uapi/linux/net_tstamp.h           |  3 ++-
>>  include/uapi/linux/tcp.h                  |  8 ++++++++
>>  net/core/skbuff.c                         | 14 +++++++++++---
>>  net/core/sock.c                           |  7 +++++++
>>  net/ipv4/tcp.c                            | 20 ++++++++++++++++++++
>>  net/socket.c                              |  7 ++++++-
>>  20 files changed, 90 insertions(+), 5 deletions(-)
>>
>> diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking/timestamping.txt
>> index 671cccf..96f5069 100644
>> --- a/Documentation/networking/timestamping.txt
>> +++ b/Documentation/networking/timestamping.txt
>> @@ -182,6 +182,16 @@ SOF_TIMESTAMPING_OPT_TSONLY:
>>    the timestamp even if sysctl net.core.tstamp_allow_data is 0.
>>    This option disables SOF_TIMESTAMPING_OPT_CMSG.
>>
>> +SOF_TIMESTAMPING_OPT_STATS:
>> +
>> +  Optional stats that are obtained along with the transmit timestamps.
>> +  It must be used together with SOF_TIMESTAMPING_OPT_TSONLY. When the
>> +  transmit timestamp is available, the stats are available in a
>> +  separate control message of type SCM_TIMESTAMPING_OPT_STATS, as a
>> +  list of TLVs (struct nlattr) of types. These stats allow the
>> +  application to associate various transport layer stats with
>> +  the transmit timestamps, such as how long a certain block of
>> +  data was limited by peer's receiver window.
>>
>>  New applications are encouraged to pass SOF_TIMESTAMPING_OPT_ID to
>>  disambiguate timestamps and SOF_TIMESTAMPING_OPT_TSONLY to operate
>> diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
>> index 9e46d6e..afc901b 100644
>> --- a/arch/alpha/include/uapi/asm/socket.h
>> +++ b/arch/alpha/include/uapi/asm/socket.h
>> @@ -97,4 +97,6 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* _UAPI_ASM_SOCKET_H */
>> diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h
>> index afbc98f0..81e0353 100644
>> --- a/arch/frv/include/uapi/asm/socket.h
>> +++ b/arch/frv/include/uapi/asm/socket.h
>> @@ -90,5 +90,7 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* _ASM_SOCKET_H */
>>
>> diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h
>> index 0018fad..57feb0c 100644
>> --- a/arch/ia64/include/uapi/asm/socket.h
>> +++ b/arch/ia64/include/uapi/asm/socket.h
>> @@ -99,4 +99,6 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* _ASM_IA64_SOCKET_H */
>> diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
>> index 5fe42fc..5853f8e9 100644
>> --- a/arch/m32r/include/uapi/asm/socket.h
>> +++ b/arch/m32r/include/uapi/asm/socket.h
>> @@ -90,4 +90,6 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* _ASM_M32R_SOCKET_H */
>> diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
>> index 2027240a..566ecdc 100644
>> --- a/arch/mips/include/uapi/asm/socket.h
>> +++ b/arch/mips/include/uapi/asm/socket.h
>> @@ -108,4 +108,6 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* _UAPI_ASM_SOCKET_H */
>> diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h
>> index 5129f23..0e12527 100644
>> --- a/arch/mn10300/include/uapi/asm/socket.h
>> +++ b/arch/mn10300/include/uapi/asm/socket.h
>> @@ -90,4 +90,6 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* _ASM_SOCKET_H */
>> diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
>> index 9c935d7..7a109b7 100644
>> --- a/arch/parisc/include/uapi/asm/socket.h
>> +++ b/arch/parisc/include/uapi/asm/socket.h
>> @@ -89,4 +89,6 @@
>>
>>  #define SO_CNX_ADVICE          0x402E
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     0x402F
>> +
>>  #endif /* _UAPI_ASM_SOCKET_H */
>> diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h
>> index 1672e33..44583a5 100644
>> --- a/arch/powerpc/include/uapi/asm/socket.h
>> +++ b/arch/powerpc/include/uapi/asm/socket.h
>> @@ -97,4 +97,6 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* _ASM_POWERPC_SOCKET_H */
>> diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h
>> index 41b51c2..b24a64c 100644
>> --- a/arch/s390/include/uapi/asm/socket.h
>> +++ b/arch/s390/include/uapi/asm/socket.h
>> @@ -96,4 +96,6 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* _ASM_SOCKET_H */
>> diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
>> index 31aede3..a25dc32 100644
>> --- a/arch/sparc/include/uapi/asm/socket.h
>> +++ b/arch/sparc/include/uapi/asm/socket.h
>> @@ -86,6 +86,8 @@
>>
>>  #define SO_CNX_ADVICE          0x0037
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     0x0038
>> +
>>  /* Security levels - as per NRL IPv6 - don't actually do anything */
>>  #define SO_SECURITY_AUTHENTICATION             0x5001
>>  #define SO_SECURITY_ENCRYPTION_TRANSPORT       0x5002
>> diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
>> index 81435d9..9fdbe1f 100644
>> --- a/arch/xtensa/include/uapi/asm/socket.h
>> +++ b/arch/xtensa/include/uapi/asm/socket.h
>> @@ -101,4 +101,6 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* _XTENSA_SOCKET_H */
>> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
>> index d5d3bd8..00e0ee8 100644
>> --- a/include/linux/tcp.h
>> +++ b/include/linux/tcp.h
>> @@ -428,4 +428,6 @@ static inline void tcp_saved_syn_free(struct tcp_sock *tp)
>>         tp->saved_syn = NULL;
>>  }
>>
>> +struct sk_buff *tcp_get_timestamping_opt_stats(const struct sock *sk);
>> +
>>  #endif /* _LINUX_TCP_H */
>> diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
>> index 67d632f..2c748dd 100644
>> --- a/include/uapi/asm-generic/socket.h
>> +++ b/include/uapi/asm-generic/socket.h
>> @@ -92,4 +92,6 @@
>>
>>  #define SO_CNX_ADVICE          53
>>
>> +#define SCM_TIMESTAMPING_OPT_STATS     54
>> +
>>  #endif /* __ASM_GENERIC_SOCKET_H */
>> diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
>> index 264e515..464dcca 100644
>> --- a/include/uapi/linux/net_tstamp.h
>> +++ b/include/uapi/linux/net_tstamp.h
>> @@ -25,8 +25,9 @@ enum {
>>         SOF_TIMESTAMPING_TX_ACK = (1<<9),
>>         SOF_TIMESTAMPING_OPT_CMSG = (1<<10),
>>         SOF_TIMESTAMPING_OPT_TSONLY = (1<<11),
>> +       SOF_TIMESTAMPING_OPT_STATS = (1<<12),
>>
>> -       SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_TSONLY,
>> +       SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_STATS,
>>         SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
>>                                  SOF_TIMESTAMPING_LAST
>>  };
>> diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
>> index 2863b66..c53de26 100644
>> --- a/include/uapi/linux/tcp.h
>> +++ b/include/uapi/linux/tcp.h
>> @@ -220,6 +220,14 @@ struct tcp_info {
>>         __u64   tcpi_sndbuf_limited; /* Time (usec) limited by send buffer */
>>  };
>>
>> +/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
>> +enum {
>> +       TCP_NLA_PAD,
>> +       TCP_NLA_BUSY,           /* Time (usec) busy sending data */
>> +       TCP_NLA_RWND_LIMITED,   /* Time (usec) limited by receive window */
>> +       TCP_NLA_SNDBUF_LIMITED, /* Time (usec) limited by send buffer */
>> +};
>> +
>>  /* for TCP_MD5SIG socket option */
>>  #define TCP_MD5SIG_MAXKEYLEN   80
>>
>> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
>> index d1d1a5a..ea6fa95 100644
>> --- a/net/core/skbuff.c
>> +++ b/net/core/skbuff.c
>> @@ -3839,10 +3839,18 @@ void __skb_tstamp_tx(struct sk_buff *orig_skb,
>>         if (!skb_may_tx_timestamp(sk, tsonly))
>>                 return;
>>
>> -       if (tsonly)
>> -               skb = alloc_skb(0, GFP_ATOMIC);
>> -       else
>> +       if (tsonly) {
>> +#ifdef CONFIG_INET
>> +               if ((sk->sk_tsflags & SOF_TIMESTAMPING_OPT_STATS) &&
>> +                   sk->sk_protocol == IPPROTO_TCP &&
>> +                   sk->sk_type == SOCK_STREAM)
>> +                       skb = tcp_get_timestamping_opt_stats(sk);
>> +               else
>> +#endif
>> +                       skb = alloc_skb(0, GFP_ATOMIC);
>> +       } else {
>>                 skb = skb_clone(orig_skb, GFP_ATOMIC);
>> +       }
>>         if (!skb)
>>                 return;
>>
>> diff --git a/net/core/sock.c b/net/core/sock.c
>> index 14e6145..d8c7f8c 100644
>> --- a/net/core/sock.c
>> +++ b/net/core/sock.c
>> @@ -854,6 +854,13 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
>>                                 sk->sk_tskey = 0;
>>                         }
>>                 }
>> +
>> +               if (val & SOF_TIMESTAMPING_OPT_STATS &&
>> +                   !(val & SOF_TIMESTAMPING_OPT_TSONLY)) {
>> +                       ret = -EINVAL;
>> +                       break;
>> +               }
>> +
>>                 sk->sk_tsflags = val;
>>                 if (val & SOF_TIMESTAMPING_RX_SOFTWARE)
>>                         sock_enable_timestamp(sk,
>> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
>> index cdde20f..1149b48 100644
>> --- a/net/ipv4/tcp.c
>> +++ b/net/ipv4/tcp.c
>> @@ -2841,6 +2841,26 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
>>  }
>>  EXPORT_SYMBOL_GPL(tcp_get_info);
>>
>> +struct sk_buff *tcp_get_timestamping_opt_stats(const struct sock *sk)
>> +{
>> +       const struct tcp_sock *tp = tcp_sk(sk);
>> +       struct sk_buff *stats;
>> +       struct tcp_info info;
>> +
>> +       stats = alloc_skb(3 * nla_total_size_64bit(sizeof(u64)), GFP_ATOMIC);
>> +       if (!stats)
>> +               return NULL;
>> +
>> +       tcp_get_info_chrono_stats(tp, &info);
>> +       nla_put_u64_64bit(stats, TCP_NLA_BUSY,
>> +                         info.tcpi_busy_time, TCP_NLA_PAD);
>> +       nla_put_u64_64bit(stats, TCP_NLA_RWND_LIMITED,
>> +                         info.tcpi_rwnd_limited, TCP_NLA_PAD);
>> +       nla_put_u64_64bit(stats, TCP_NLA_SNDBUF_LIMITED,
>> +                         info.tcpi_sndbuf_limited, TCP_NLA_PAD);
>> +       return stats;
>> +}
>> +
>>  static int do_tcp_getsockopt(struct sock *sk, int level,
>>                 int optname, char __user *optval, int __user *optlen)
>>  {
>> diff --git a/net/socket.c b/net/socket.c
>> index e2584c5..e631894 100644
>> --- a/net/socket.c
>> +++ b/net/socket.c
>> @@ -693,9 +693,14 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
>>             (sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE) &&
>>             ktime_to_timespec_cond(shhwtstamps->hwtstamp, tss.ts + 2))
>>                 empty = 0;
>> -       if (!empty)
>> +       if (!empty) {
>>                 put_cmsg(msg, SOL_SOCKET,
>>                          SCM_TIMESTAMPING, sizeof(tss), &tss);
>> +
>> +               if (skb->len && (sk->sk_tsflags & SOF_TIMESTAMPING_OPT_STATS))
>> +                       put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMPING_OPT_STATS,
>> +                                skb->len, skb->data);
>> +       }
>>  }
>>  EXPORT_SYMBOL_GPL(__sock_recv_timestamp);
>>
>> --
>> 2.8.0.rc3.226.g39d4020
>>

[-- Attachment #2: ts-avr32-fix.diff --]
[-- Type: text/x-patch, Size: 335 bytes --]

diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h
index 1fd147f..5a65042 100644
--- a/arch/avr32/include/uapi/asm/socket.h
+++ b/arch/avr32/include/uapi/asm/socket.h
@@ -90,4 +90,6 @@
 
 #define SO_CNX_ADVICE		53
 
+#define SCM_TIMESTAMPING_OPT_STATS	54
+
 #endif /* _UAPI__ASM_AVR32_SOCKET_H */

^ permalink raw reply related

* [PATCH net-next] phy: add phy fixup unregister functions
From: Woojung.Huh @ 2016-12-02 23:04 UTC (permalink / raw)
  To: davem, f.fainelli, andrew; +Cc: netdev

From: Woojung Huh <woojung.huh@microchip.com>

Add functions to unregister phy fixup for modules.

phy_unregister_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask)
 Unregister phy fixup matches bus_id, phy_uid and phy_uid_mask
 from phy_fixup_list.
 Return 0 when find matched one and remove from the list.
 Return -ENODEV when fail to find it on the list.

phy_unregister_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask)
 Unregister phy fixup from phy_fixup_list.
 Use it for fixup registered by phy_register_fixup_for_uid()
 Return 0 when find matched one and remove from the list.
 Return -ENODEV when fail to find it on the list.

phy_unregister_fixup_for_id(const char *bus_id)
 Unregister phy fixup from phy_fixup_list.
 Use it for fixup registered by phy_register_fixup_for_id()
 Return 0 when find matched one and remove from the list.
 Return -ENODEV when fail to find it on the list.

Signed-off-by: Woojung Huh <woojung.huh@microchip.com>
---
 Documentation/networking/phy.txt |  9 ++++++++
 drivers/net/phy/phy_device.c     | 47 ++++++++++++++++++++++++++++++++++++++++
 include/linux/phy.h              |  4 ++++
 3 files changed, 60 insertions(+)

diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt
index e017d93..16f90d8 100644
--- a/Documentation/networking/phy.txt
+++ b/Documentation/networking/phy.txt
@@ -407,6 +407,15 @@ Board Fixups
  The stubs set one of the two matching criteria, and set the other one to
  match anything.
 
+ When phy_register_fixup() or *_for_uid()/*_for_id() is called at module,
+ unregister fixup and free allocate memory are required.
+
+ Call one of following function before unloading module.
+
+ int phy_unregister_fixup(const char *phy_id, u32 phy_uid, u32 phy_uid_mask);
+ int phy_unregister_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask);
+ int phy_register_fixup_for_id(const char *phy_id);
+
 Standards
 
  IEEE Standard 802.3: CSMA/CD Access Method and Physical Layer Specifications, Section Two:
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index aeaf1bc..32fa7c7 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -235,6 +235,53 @@ int phy_register_fixup_for_id(const char *bus_id,
 }
 EXPORT_SYMBOL(phy_register_fixup_for_id);
 
+/**
+ * phy_unregister_fixup - remove a phy_fixup from the list
+ * @bus_id: A string matches fixup->bus_id (or PHY_ANY_ID) in phy_fixup_list
+ * @phy_uid: A phy id matches fixup->phy_id (or PHY_ANY_UID) in phy_fixup_list
+ * @phy_uid_mask: Applied to phy_uid and fixup->phy_uid before comparison
+ */
+int phy_unregister_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask)
+{
+	struct list_head *pos, *n;
+	struct phy_fixup *fixup;
+	int ret;
+
+	ret = -ENODEV;
+
+	mutex_lock(&phy_fixup_lock);
+	list_for_each_safe(pos, n, &phy_fixup_list) {
+		fixup = list_entry(pos, struct phy_fixup, list);
+
+		if ((!strcmp(fixup->bus_id, bus_id)) &&
+		    ((fixup->phy_uid & phy_uid_mask) ==
+		     (phy_uid & phy_uid_mask))) {
+			list_del(&fixup->list);
+			kfree(fixup);
+			ret = 0;
+			break;
+		}
+	}
+	mutex_unlock(&phy_fixup_lock);
+
+	return ret;
+}
+EXPORT_SYMBOL(phy_unregister_fixup);
+
+/* Unregisters a fixup of any PHY with the UID in phy_uid */
+int phy_unregister_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask)
+{
+	return phy_unregister_fixup(PHY_ANY_ID, phy_uid, phy_uid_mask);
+}
+EXPORT_SYMBOL(phy_unregister_fixup_for_uid);
+
+/* Unregisters a fixup of the PHY with id string bus_id */
+int phy_unregister_fixup_for_id(const char *bus_id)
+{
+	return phy_unregister_fixup(bus_id, PHY_ANY_UID, 0xffffffff);
+}
+EXPORT_SYMBOL(phy_unregister_fixup_for_id);
+
 /* Returns 1 if fixup matches phydev in bus_id and phy_uid.
  * Fixups can be set to match any in one or more fields.
  */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index b53177f..745661d 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -859,6 +859,10 @@ int phy_register_fixup_for_id(const char *bus_id,
 int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
 			       int (*run)(struct phy_device *));
 
+int phy_unregister_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask);
+int phy_unregister_fixup_for_id(const char *bus_id);
+int phy_unregister_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask);
+
 int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
 int phy_get_eee_err(struct phy_device *phydev);
 int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next] liquidio: 'imply' ptp instead of 'select'
From: Arnd Bergmann @ 2016-12-02 23:04 UTC (permalink / raw)
  To: David S. Miller
  Cc: Arnd Bergmann, Felix Manlunas, Thomas Gleixner, David Daney,
	Satanand Burla, Raghu Vatsavayi, Nicolas Pitre, Sunil Goutham,
	netdev, linux-kernel

ptp now depends on the optional POSIX_TIMERS setting and fails to build
if we select it without that:

warning: (LIQUIDIO_VF && TI_CPTS) selects PTP_1588_CLOCK which has unmet direct dependencies (NET && POSIX_TIMERS)
warning: (LIQUIDIO_VF && TI_CPTS) selects PTP_1588_CLOCK which has unmet direct dependencies (NET && POSIX_TIMERS)
ERROR: "posix_clock_unregister" [drivers/ptp/ptp.ko] undefined!
ERROR: "posix_clock_register" [drivers/ptp/ptp.ko] undefined!
ERROR: "pps_unregister_source" [drivers/ptp/ptp.ko] undefined!
ERROR: "pps_event" [drivers/ptp/ptp.ko] undefined!
ERROR: "pps_register_source" [drivers/ptp/ptp.ko] undefined!

It seems that two patches have collided here, the build failure
is a result of the combination. Changing the new option to 'imply'
as well fixes it.

Fixes: 111fc64a237f ("liquidio CN23XX: VF registration")
Fixes: d1cbfd771ce8 ("ptp_clock: Allow for it to be optional")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/cavium/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/Kconfig b/drivers/net/ethernet/cavium/Kconfig
index bbc8bd16cb97..dcbce6cac63e 100644
--- a/drivers/net/ethernet/cavium/Kconfig
+++ b/drivers/net/ethernet/cavium/Kconfig
@@ -77,7 +77,7 @@ config OCTEON_MGMT_ETHERNET
 config LIQUIDIO_VF
 	tristate "Cavium LiquidIO VF support"
 	depends on 64BIT && PCI_MSI
-	select PTP_1588_CLOCK
+	imply PTP_1588_CLOCK
 	---help---
 	  This driver supports Cavium LiquidIO Intelligent Server Adapter
 	  based on CN23XX chips.
-- 
2.9.0

^ permalink raw reply related

* Re: [[PATCH iproute2/net-next v2] 1/4] tc: flower: remove references to eth_type in manpage
From: Stephen Hemminger @ 2016-12-02 23:05 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev, Paul Blakey
In-Reply-To: <1480668321-20875-2-git-send-email-simon.horman@netronome.com>

On Fri,  2 Dec 2016 09:45:18 +0100
Simon Horman <simon.horman@netronome.com> wrote:

> Remove references to eth_type and ether_type (spelling error) in
> the tc flower manpage.
> 
> Also correct formatting of boldface text with whitespace.
> 
> Cc: Paul Blakey <paulb@mellanox.com>
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

Applied this one. Later ones still need rebase.

^ permalink raw reply

* Avoid deadlock situation due to use of xmit_lock
From: Lino Sanfilippo @ 2016-12-02 23:06 UTC (permalink / raw)
  To: bh74.an, ks.giri, vipul.pandya, peppe.cavallaro, alexandre.torgue
  Cc: linux-kernel, netdev

Hi,

after stumbling over a potential deadlock situation in the altera driver 
(see http://marc.info/?l=linux-netdev&m=148054615230447&w=2), I checked
all other ethernet drivers for the same issue and actually found it in 2
more, namely stmmac, and sxgbe. Please see the commit messages for a 
description of the problem.
These 2 patches fix the concerning drivers.

Regards,
Lino

^ permalink raw reply

* [PATCH 2/2] net: ethernet: stmmac: do not use xmit_lock in tx completion handler
From: Lino Sanfilippo @ 2016-12-02 23:06 UTC (permalink / raw)
  To: bh74.an, ks.giri, vipul.pandya, peppe.cavallaro, alexandre.torgue
  Cc: linux-kernel, netdev, Lino Sanfilippo
In-Reply-To: <1480719966-12839-1-git-send-email-LinoSanfilippo@gmx.de>

The driver already uses its private lock for synchronization between the
xmit function and the xmit completion handler, making the additional use of
the xmit_lock unnecessary.
Furthermore the driver does not set NETIF_F_LLTX resulting in xmit to be
called with the xmit_lock held and then taking the private lock.
On the other hand the xmit completion handler uses the reverse locking
order, by first taking the private lock, and then the xmit_lock, which
leads to the potential danger of a deadlock.

Fix this issue by not taking the xmit_lock in the completion handler.
By doing this also remove an unnecessary double check for a stopped tx
queue.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Please note that this patch is only compile tested.

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 48a4e84..8def423 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1380,14 +1380,9 @@ static void stmmac_tx_clean(struct stmmac_priv *priv)
 
 	if (unlikely(netif_queue_stopped(priv->dev) &&
 		     stmmac_tx_avail(priv) > STMMAC_TX_THRESH)) {
-		netif_tx_lock(priv->dev);
-		if (netif_queue_stopped(priv->dev) &&
-		    stmmac_tx_avail(priv) > STMMAC_TX_THRESH) {
-			netif_dbg(priv, tx_done, priv->dev,
-				  "%s: restart transmit\n", __func__);
-			netif_wake_queue(priv->dev);
-		}
-		netif_tx_unlock(priv->dev);
+		netif_dbg(priv, tx_done, priv->dev,
+			  "%s: restart transmit\n", __func__);
+		netif_wake_queue(priv->dev);
 	}
 
 	if ((priv->eee_enabled) && (!priv->tx_path_in_lpi_mode)) {
-- 
1.9.1

^ permalink raw reply related

* Re: [[PATCH iproute2/net-next v2] 2/4] tc: flower: document SCTP ip_proto
From: Stephen Hemminger @ 2016-12-02 23:06 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev
In-Reply-To: <1480668321-20875-3-git-send-email-simon.horman@netronome.com>

On Fri,  2 Dec 2016 09:45:19 +0100
Simon Horman <simon.horman@netronome.com> wrote:

> Add SCTP ip_proto to help text and man page.
> 
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

This doesn't apply cleanly to current net-next git.
Probably some of the other man page changes caused reject.

^ permalink raw reply

* [PATCH 1/2] net: ethernet: sxgbe: do not use xmit_lock in tx completion handler
From: Lino Sanfilippo @ 2016-12-02 23:06 UTC (permalink / raw)
  To: bh74.an, ks.giri, vipul.pandya, peppe.cavallaro, alexandre.torgue
  Cc: linux-kernel, netdev, Lino Sanfilippo
In-Reply-To: <1480719966-12839-1-git-send-email-LinoSanfilippo@gmx.de>

The driver already uses its private lock for synchronization between the
xmit function and the xmit completion handler, making the additional use of
the xmit_lock unnecessary.
Furthermore the driver does not set NETIF_F_LLTX resulting in xmit to be
called with the xmit_lock held and then taking the private lock.
On the other hand the xmit completion handler uses the reverse locking
order, by first taking the private lock, and then the xmit_lock, which
leads to the potential danger of a deadlock.

Fix this issue by not taking the xmit_lock in the completion handler.
By doing this also remove an unnecessary double check for a stopped tx
queue.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
---
 drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Please note that this patch is only compile tested.

diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
index 5dbe406..578cbec 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
@@ -782,14 +782,9 @@ static void sxgbe_tx_queue_clean(struct sxgbe_tx_queue *tqueue)
 	/* wake up queue */
 	if (unlikely(netif_tx_queue_stopped(dev_txq) &&
 		     sxgbe_tx_avail(tqueue, tx_rsize) > SXGBE_TX_THRESH(priv))) {
-		netif_tx_lock(priv->dev);
-		if (netif_tx_queue_stopped(dev_txq) &&
-		    sxgbe_tx_avail(tqueue, tx_rsize) > SXGBE_TX_THRESH(priv)) {
-			if (netif_msg_tx_done(priv))
-				pr_debug("%s: restart transmit\n", __func__);
-			netif_tx_wake_queue(dev_txq);
-		}
-		netif_tx_unlock(priv->dev);
+		if (netif_msg_tx_done(priv))
+			pr_debug("%s: restart transmit\n", __func__);
+		netif_tx_wake_queue(dev_txq);
 	}
 
 	spin_unlock(&tqueue->tx_lock);
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH/RFC iproute2/net-next 1/3] tc: flower: update headers for TCA_FLOWER_KEY_ICMP*
From: Stephen Hemminger @ 2016-12-02 23:06 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev, Jamal Hadi Salim, Jiri Pirko
In-Reply-To: <1480672785-14570-2-git-send-email-simon.horman@netronome.com>

On Fri,  2 Dec 2016 10:59:43 +0100
Simon Horman <simon.horman@netronome.com> wrote:

> These are proposed changes for net-next.
> 
> Signed-off-by: Simon Horman <simon.horman@netronome.com>
> ---
>  include/linux/pkt_cls.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
> index a3d8a4f17d8e..fa435ea8ad21 100644
> --- a/include/linux/pkt_cls.h
> +++ b/include/linux/pkt_cls.h
> @@ -403,6 +403,16 @@ enum {
>  	TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK,	/* be16 */
>  	TCA_FLOWER_KEY_ENC_UDP_DST_PORT,	/* be16 */
>  	TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK,	/* be16 */
> +
> +	TCA_FLOWER_KEY_ICMPV4_CODE,     /* u8 */
> +	TCA_FLOWER_KEY_ICMPV4_CODE_MASK,/* u8 */
> +	TCA_FLOWER_KEY_ICMPV4_TYPE,     /* u8 */
> +	TCA_FLOWER_KEY_ICMPV4_TYPE_MASK,/* u8 */
> +	TCA_FLOWER_KEY_ICMPV6_CODE,     /* u8 */
> +	TCA_FLOWER_KEY_ICMPV6_CODE_MASK,/* u8 */
> +	TCA_FLOWER_KEY_ICMPV6_TYPE,     /* u8 */
> +	TCA_FLOWER_KEY_ICMPV6_TYPE_MASK,/* u8 */
> +
>  	__TCA_FLOWER_MAX,
>  };
>  

I picked this up by updating from kernel headers.

^ permalink raw reply

* Re: iproute2 public git outdated?
From: Stephen Hemminger @ 2016-12-02 23:10 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netdev
In-Reply-To: <20161201121806.GA21576@orbyte.nwl.cc>

On Thu, 1 Dec 2016 13:18:06 +0100
Phil Sutter <phil@nwl.cc> wrote:

> Hi,
> 
> I am using iproute2's public git repo at this URL:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
> 
> To my surprise, neither master nor net-next branches have received new
> commits since end of October. Did the repo location change or was it
> just not updated for a while?
> 
> Thanks, Phil

I was on the road, and moving between houses. Sorry for the extended delay.

^ permalink raw reply

* Re: [PATCH] iproute2: ss: escape all null bytes in abstract unix domain socket
From: Stephen Hemminger @ 2016-12-02 23:18 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Isaac Boukris, davem, netdev, linux-kernel
In-Reply-To: <1480705196.18162.381.camel@edumazet-glaptop3.roam.corp.google.com>

On Fri, 02 Dec 2016 10:59:56 -0800
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> On Sat, 2016-11-12 at 10:17 +0300, Stephen Hemminger wrote:
> > On Sat, 29 Oct 2016 22:20:19 +0300
> > Isaac Boukris <iboukris@gmail.com> wrote:
> >   
> > > Abstract unix domain socket may embed null characters,
> > > these should be translated to '@' when printed by ss the
> > > same way the null prefix is currently being translated.
> > > 
> > > Signed-off-by: Isaac Boukris <iboukris@gmail.com>  
> > 
> > Applied  
> 
> Probably not a good idea to have :
> 
>                        for (int i = 0; i < len; i++)
>                                if (name[i] == '\0')
>                                        name[i] = '@';
> 
> ss.c: In function 'unix_show_sock':
> ss.c:3128:4: error: 'for' loop initial declarations are only allowed in C99 mode
> ss.c:3128:4: note: use option -std=c99 or -std=gnu99 to compile your code
> make[1]: *** [ss.o] Error 1
> 
> 
> 

Thanks, fixed by patch from Simon

^ permalink raw reply

* Re: [PATCH net-next] liquidio: 'imply' ptp instead of 'select'
From: Nicolas Pitre @ 2016-12-02 23:20 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: David S. Miller, Felix Manlunas, Thomas Gleixner, David Daney,
	Satanand Burla, Raghu Vatsavayi, Sunil Goutham, netdev,
	linux-kernel
In-Reply-To: <20161202230451.1639318-1-arnd@arndb.de>

On Sat, 3 Dec 2016, Arnd Bergmann wrote:

> ptp now depends on the optional POSIX_TIMERS setting and fails to build
> if we select it without that:
> 
> warning: (LIQUIDIO_VF && TI_CPTS) selects PTP_1588_CLOCK which has unmet direct dependencies (NET && POSIX_TIMERS)
> warning: (LIQUIDIO_VF && TI_CPTS) selects PTP_1588_CLOCK which has unmet direct dependencies (NET && POSIX_TIMERS)
> ERROR: "posix_clock_unregister" [drivers/ptp/ptp.ko] undefined!
> ERROR: "posix_clock_register" [drivers/ptp/ptp.ko] undefined!
> ERROR: "pps_unregister_source" [drivers/ptp/ptp.ko] undefined!
> ERROR: "pps_event" [drivers/ptp/ptp.ko] undefined!
> ERROR: "pps_register_source" [drivers/ptp/ptp.ko] undefined!
> 
> It seems that two patches have collided here, the build failure
> is a result of the combination. Changing the new option to 'imply'
> as well fixes it.
> 
> Fixes: 111fc64a237f ("liquidio CN23XX: VF registration")
> Fixes: d1cbfd771ce8 ("ptp_clock: Allow for it to be optional")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Nicolas Pitre <nico@linaro.org>

> ---
>  drivers/net/ethernet/cavium/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/cavium/Kconfig b/drivers/net/ethernet/cavium/Kconfig
> index bbc8bd16cb97..dcbce6cac63e 100644
> --- a/drivers/net/ethernet/cavium/Kconfig
> +++ b/drivers/net/ethernet/cavium/Kconfig
> @@ -77,7 +77,7 @@ config OCTEON_MGMT_ETHERNET
>  config LIQUIDIO_VF
>  	tristate "Cavium LiquidIO VF support"
>  	depends on 64BIT && PCI_MSI
> -	select PTP_1588_CLOCK
> +	imply PTP_1588_CLOCK
>  	---help---
>  	  This driver supports Cavium LiquidIO Intelligent Server Adapter
>  	  based on CN23XX chips.
> -- 
> 2.9.0
> 
> 

^ permalink raw reply

* Re: [PATCH net-next] liquidio: 'imply' ptp instead of 'select'
From: David Daney @ 2016-12-02 23:20 UTC (permalink / raw)
  To: Arnd Bergmann, David S. Miller
  Cc: Felix Manlunas, Thomas Gleixner, David Daney, Satanand Burla,
	Raghu Vatsavayi, Nicolas Pitre, Sunil Goutham, netdev,
	linux-kernel
In-Reply-To: <20161202230451.1639318-1-arnd@arndb.de>

On 12/02/2016 03:04 PM, Arnd Bergmann wrote:
> ptp now depends on the optional POSIX_TIMERS setting and fails to build
> if we select it without that:
>
> warning: (LIQUIDIO_VF && TI_CPTS) selects PTP_1588_CLOCK which has unmet direct dependencies (NET && POSIX_TIMERS)
> warning: (LIQUIDIO_VF && TI_CPTS) selects PTP_1588_CLOCK which has unmet direct dependencies (NET && POSIX_TIMERS)
> ERROR: "posix_clock_unregister" [drivers/ptp/ptp.ko] undefined!
> ERROR: "posix_clock_register" [drivers/ptp/ptp.ko] undefined!
> ERROR: "pps_unregister_source" [drivers/ptp/ptp.ko] undefined!
> ERROR: "pps_event" [drivers/ptp/ptp.ko] undefined!
> ERROR: "pps_register_source" [drivers/ptp/ptp.ko] undefined!
>
> It seems that two patches have collided here, the build failure
> is a result of the combination. Changing the new option to 'imply'
> as well fixes it.
>
> Fixes: 111fc64a237f ("liquidio CN23XX: VF registration")
> Fixes: d1cbfd771ce8 ("ptp_clock: Allow for it to be optional")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I didn't know about this new "imply" thing.  This seems like a plausible 
fix, so...

Acked-by: David Daney <david.daney@cavium.com>

Thanks for fixing this up.


> ---
>  drivers/net/ethernet/cavium/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/cavium/Kconfig b/drivers/net/ethernet/cavium/Kconfig
> index bbc8bd16cb97..dcbce6cac63e 100644
> --- a/drivers/net/ethernet/cavium/Kconfig
> +++ b/drivers/net/ethernet/cavium/Kconfig
> @@ -77,7 +77,7 @@ config OCTEON_MGMT_ETHERNET
>  config LIQUIDIO_VF
>  	tristate "Cavium LiquidIO VF support"
>  	depends on 64BIT && PCI_MSI
> -	select PTP_1588_CLOCK
> +	imply PTP_1588_CLOCK
>  	---help---
>  	  This driver supports Cavium LiquidIO Intelligent Server Adapter
>  	  based on CN23XX chips.
>

^ 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