[PATCH net-next 8/8] sock: document timestamping via cmsg in Documentation

2016-03-30 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Update docs and add code snippet for using cmsg for timestamping. Signed-off-by: Soheil Hassas Yeganeh <soh...@google.com> --- Documentation/networking/timestamping.txt | 48 +-- 1 file changed, 45 inse

[PATCH net-next 1/8] sock: break up sock_cmsg_snd into __sock_cmsg_snd and loop

2016-03-30 Thread Soheil Hassas Yeganeh
logic from the loop that walks the list, to allow having this called directly from a walker in the protocol specific code. Signed-off-by: Willem de Bruijn <will...@google.com> Signed-off-by: Soheil Hassas Yeganeh <soh...@google.com> --- include/net/sock.h | 2 ++ net/c

[PATCH net-next 0/8] add TX timestamping via cmsg

2016-03-30 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> This patch series aim at enabling TX timestamping via cmsg. Currently, to occasionally sample TX timestamping on a socket, applications need to call setsockopt twice: first for enabling timestamps and then for disabling them. This is an unnec

[PATCH net-next 7/8] sock: enable timestamping using control messages

2016-03-30 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Currently, SOL_TIMESTAMPING can only be enabled using setsockopt. This is very costly when users want to sample writes to gather tx timestamps. Add support for enabling SO_TIMESTAMPING via control messages by using tsflags added in `

[PATCH net-next 4/8] sock: accept SO_TIMESTAMPING flags in socket cmsg

2016-03-30 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Accept SO_TIMESTAMPING in control messages of the SOL_SOCKET level as a basis to accept timestamping requests per write. This implementation only accepts TX recording flags (i.e., SOF_TIMESTAMPING_TX_HARDWARE, SOF_TIMESTAMPING_TX_SO

[PATCH net-next 2/8] tcp: accept SOF_TIMESTAMPING_OPT_ID for passive TFO

2016-03-30 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> SOF_TIMESTAMPING_OPT_ID is set to get data-independent IDs to associate timestamps with send calls. For TCP connections, tp->snd_una is used as the starting point to calculate relative IDs. This socket option will fail if set before the

[PATCH net-next 3/8] tcp: use one bit in TCP_SKB_CB to mark ACK timestamps

2016-03-30 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Currently, to avoid a cache line miss for accessing skb_shinfo, tcp_ack_tstamp skips socket that do not have SOF_TIMESTAMPING_TX_ACK bit set in sk_tsflags. This is implemented based on an implicit assumption that the SOF_TIMESTAMPING_TX_ACK

[PATCH net-next 5/8] ipv4: process socket-level control messages in IPv4

2016-03-30 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Process socket-level control messages by invoking __sock_cmsg_send in ip_cmsg_send for control messages on the SOL_SOCKET layer. This makes sure whenever ip_cmsg_send is called in udp, icmp, and raw, we also process socket-level control me

[PATCH net-next 6/8] ipv6: process socket-level control messages in IPv6

2016-03-30 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Process socket-level control messages by invoking __sock_cmsg_send in ip6_datagram_send_ctl for control messages on the SOL_SOCKET layer. This makes sure whenever ip6_datagram_send_ctl is called for udp and raw, we also process socket-level c

Re: [PATCH net-next 0/8] add TX timestamping via cmsg

2016-03-30 Thread Soheil Hassas Yeganeh
On Wed, Mar 30, 2016 at 8:38 PM, Martin KaFai Lau <ka...@fb.com> wrote: > On Wed, Mar 30, 2016 at 06:37:20PM -0400, Soheil Hassas Yeganeh wrote: >> I will follow up with another patch to enable timestamping for >> active TFO (client-side TCP Fast Open) and also setting pac

[PATCH v2 net-next 0/8] add TX timestamping via cmsg

2016-04-01 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> This patch series aim at enabling TX timestamping via cmsg. Currently, to occasionally sample TX timestamping on a socket, applications need to call setsockopt twice: first for enabling timestamps and then for disabling them. This is an unnec

[PATCH v2 net-next 1/8] sock: break up sock_cmsg_snd into __sock_cmsg_snd and loop

2016-04-01 Thread Soheil Hassas Yeganeh
logic from the loop that walks the list, to allow having this called directly from a walker in the protocol specific code. Signed-off-by: Willem de Bruijn <will...@google.com> Signed-off-by: Soheil Hassas Yeganeh <soh...@google.com> --- include/net/sock.h | 2 ++ net/c

[PATCH v2 net-next 6/8] ipv6: process socket-level control messages in IPv6

2016-04-01 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Process socket-level control messages by invoking __sock_cmsg_send in ip6_datagram_send_ctl for control messages on the SOL_SOCKET layer. This makes sure whenever ip6_datagram_send_ctl is called for udp and raw, we also process socket-level c

[PATCH v2 net-next 3/8] tcp: use one bit in TCP_SKB_CB to mark ACK timestamps

2016-04-01 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Currently, to avoid a cache line miss for accessing skb_shinfo, tcp_ack_tstamp skips socket that do not have SOF_TIMESTAMPING_TX_ACK bit set in sk_tsflags. This is implemented based on an implicit assumption that the SOF_TIMESTAMPING_TX_ACK

[PATCH v2 net-next 2/8] tcp: accept SOF_TIMESTAMPING_OPT_ID for passive TFO

2016-04-01 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> SOF_TIMESTAMPING_OPT_ID is set to get data-independent IDs to associate timestamps with send calls. For TCP connections, tp->snd_una is used as the starting point to calculate relative IDs. This socket option will fail if set before the

[PATCH v2 net-next 5/8] ipv4: process socket-level control messages in IPv4

2016-04-01 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Process socket-level control messages by invoking __sock_cmsg_send in ip_cmsg_send for control messages on the SOL_SOCKET layer. This makes sure whenever ip_cmsg_send is called in udp, icmp, and raw, we also process socket-level control me

[PATCH v2 net-next 4/8] sock: accept SO_TIMESTAMPING flags in socket cmsg

2016-04-01 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Accept SO_TIMESTAMPING in control messages of the SOL_SOCKET level as a basis to accept timestamping requests per write. This implementation only accepts TX recording flags (i.e., SOF_TIMESTAMPING_TX_HARDWARE, SOF_TIMESTAMPING_TX_SO

[PATCH v2 net-next 8/8] sock: document timestamping via cmsg in Documentation

2016-04-01 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Update docs and add code snippet for using cmsg for timestamping. Signed-off-by: Soheil Hassas Yeganeh <soh...@google.com> Acked-by: Willem de Bruijn <will...@google.com> --- Documentation/networking/tim

[PATCH v2 net-next 7/8] sock: enable timestamping using control messages

2016-04-01 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Currently, SOL_TIMESTAMPING can only be enabled using setsockopt. This is very costly when users want to sample writes to gather tx timestamps. Add support for enabling SO_TIMESTAMPING via control messages by using tsflags added in `

[PATCH v3 net-next 5/8] ipv4: process socket-level control messages in IPv4

2016-04-02 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Process socket-level control messages by invoking __sock_cmsg_send in ip_cmsg_send for control messages on the SOL_SOCKET layer. This makes sure whenever ip_cmsg_send is called in udp, icmp, and raw, we also process socket-level control me

[PATCH v3 net-next 8/8] sock: document timestamping via cmsg in Documentation

2016-04-02 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Update docs and add code snippet for using cmsg for timestamping. Signed-off-by: Soheil Hassas Yeganeh <soh...@google.com> Acked-by: Willem de Bruijn <will...@google.com> --- Documentation/networking/tim

[PATCH v3 net-next 6/8] ipv6: process socket-level control messages in IPv6

2016-04-02 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Process socket-level control messages by invoking __sock_cmsg_send in ip6_datagram_send_ctl for control messages on the SOL_SOCKET layer. This makes sure whenever ip6_datagram_send_ctl is called for udp and raw, we also process socket-level c

[PATCH v3 net-next 7/8] sock: enable timestamping using control messages

2016-04-02 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Currently, SOL_TIMESTAMPING can only be enabled using setsockopt. This is very costly when users want to sample writes to gather tx timestamps. Add support for enabling SO_TIMESTAMPING via control messages by using tsflags added in `

[PATCH v3 net-next 4/8] sock: accept SO_TIMESTAMPING flags in socket cmsg

2016-04-02 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Accept SO_TIMESTAMPING in control messages of the SOL_SOCKET level as a basis to accept timestamping requests per write. This implementation only accepts TX recording flags (i.e., SOF_TIMESTAMPING_TX_HARDWARE, SOF_TIMESTAMPING_TX_SO

[PATCH v3 net-next 2/8] tcp: accept SOF_TIMESTAMPING_OPT_ID for passive TFO

2016-04-02 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> SOF_TIMESTAMPING_OPT_ID is set to get data-independent IDs to associate timestamps with send calls. For TCP connections, tp->snd_una is used as the starting point to calculate relative IDs. This socket option will fail if set before the

[PATCH v3 net-next 1/8] sock: break up sock_cmsg_snd into __sock_cmsg_snd and loop

2016-04-02 Thread Soheil Hassas Yeganeh
logic from the loop that walks the list, to allow having this called directly from a walker in the protocol specific code. Signed-off-by: Willem de Bruijn <will...@google.com> Signed-off-by: Soheil Hassas Yeganeh <soh...@google.com> --- include/net/sock.h | 2 ++ net/c

[PATCH v3 net-next 0/8] add TX timestamping via cmsg

2016-04-02 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> This patch series aim at enabling TX timestamping via cmsg. Currently, to occasionally sample TX timestamping on a socket, applications need to call setsockopt twice: first for enabling timestamps and then for disabling them. This is an unnec

[PATCH v3 net-next 3/8] tcp: use one bit in TCP_SKB_CB to mark ACK timestamps

2016-04-02 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Currently, to avoid a cache line miss for accessing skb_shinfo, tcp_ack_tstamp skips socket that do not have SOF_TIMESTAMPING_TX_ACK bit set in sk_tsflags. This is implemented based on an implicit assumption that the SOF_TIMESTAMPING_TX_ACK

Re: [PATCH v2 net-next 0/8] add TX timestamping via cmsg

2016-04-02 Thread Soheil Hassas Yeganeh
On Sat, Apr 2, 2016 at 9:27 PM, David Miller wrote: > From: David Miller > Date: Sat, 02 Apr 2016 21:19:42 -0400 (EDT) > >> Series applied, thanks. > > I had to revert, this breaks the build: > > net/l2tp/l2tp_ip6.c: In function ‘l2tp_ip6_sendmsg’: >

Re: [PATCH net-next 8/8] sock: document timestamping via cmsg in Documentation

2016-03-31 Thread Soheil Hassas Yeganeh
Hi Lino, On Thu, Mar 31, 2016 at 5:57 AM, Lino Sanfilippo <lsan...@marvell.com> wrote: > > Hi, > > > On 31.03.2016 00:37, Soheil Hassas Yeganeh wrote: > >> + >> +Moreover, applications must still enable timestamp reporting via >> +setsockopt

Re: [PATCH v4 net-next 0/3] tcp: Make use of MSG_EOR in tcp_sendmsg

2016-04-25 Thread Soheil Hassas Yeganeh
; tcp_sendpage because there could be >1 threads doing > sendmsg. > ~ Thanks to Eric Dumazet's suggestions on v2. > ~ The TCP timestamp bug fixes are separated into other threads. > > v2: > ~ Rework based on the recent work > "add TX timestamping via cmsg"

Re: [PATCH v4 net-next 3/3] tcp: Handle eor bit when fragmenting a skb

2016-04-25 Thread Soheil Hassas Yeganeh
F. 1:1(0) ack 16062 win 257 > 0.400 > . 16062:16062(0) ack 2 > > Signed-off-by: Martin KaFai Lau <ka...@fb.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > Cc: Soheil Hassas Yeganeh <soh...@google.com> > Cc:

Re: [PATCH v4 net-next 1/3] tcp: Make use of MSG_EOR in tcp_sendmsg

2016-04-25 Thread Soheil Hassas Yeganeh
F. 16061:16061(0) ack 1 > 0.400 < F. 1:1(0) ack 16062 win 257 > 0.400 > . 16062:16062(0) ack 2 > > Signed-off-by: Martin KaFai Lau <ka...@fb.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > Cc: Soheil Hassa

Re: [PATCH v4 net-next 2/3] tcp: Handle eor bit when coalescing skb

2016-04-25 Thread Soheil Hassas Yeganeh
730) ack 1 > 0.300 > P. 731:1461(730) ack 1 > 0.400 < . 1:1(0) ack 13141 win 257 > > 0.400 close(4) = 0 > 0.400 > F. 13141:13141(0) ack 1 > 0.500 < F. 1:1(0) ack 13142 win 257 > 0.500 > . 13142:13142(0) ack 2 > > Signed-off-by: Martin KaFai Lau <ka...@fb

[PATCH net-next 1/2] tcp: remove an unnecessary check in tcp_tx_timestamp

2016-04-25 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> tcp_tx_timestamp() receives tsflags as a parameter. tsflags is initialized to sk->sk_tsflags and is overridden by control messages. As a result the "sk->sk_tsflags || tsflags" is the same expression as "tsflags" R

[PATCH net-next 2/2] tcp: remove a redundant check for SKBTX_ACK_TSTAMP

2016-04-25 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> txstamp_ack in tcp_skb_cb is set iff the SKBTX_ACK_TSTAMP flag is set for an skb. Thus, it is not required to check shinfo->tx_flags if the txstamp_ack bit is checked. Remove the check on shinfo->tx_flags & SKBTX_ACK_TSTAMP, sinc

Re: [PATCH net] tcp: Fix SOF_TIMESTAMPING_TX_ACK when handling dup acks

2016-04-20 Thread Soheil Hassas Yeganeh
On Tue, Apr 19, 2016 at 9:54 AM, Soheil Hassas Yeganeh <soh...@google.com> wrote: > On Mon, Apr 18, 2016 at 6:39 PM, Martin KaFai Lau <ka...@fb.com> wrote: >> Assuming SOF_TIMESTAMPING_TX_ACK is on. When dup acks are received, >> it could incorrectly think that a sk

Re: [PATCH net-next 2/2] tcp: Merge txstamp_ack in tcp_skb_collapse_tstamp

2016-04-20 Thread Soheil Hassas Yeganeh
1 win 257 > 0.300 > P. 1:1461(1460) ack 1 > 0.400 < . 1:1(0) ack 14601 win 257 > > BPF Output Before: > ~ > > > BPF Output After: > ~ > <...>-2049 [007] d.s.89.185538: : ee_data:14599 > > Signed-off-by: Martin KaFai Lau <ka...@fb.c

Re: [RFC PATCH v3 net-next 2/3] tcp: Handle eor bit when coalescing skb

2016-04-20 Thread Soheil Hassas Yeganeh
gned-off-by: Martin KaFai Lau <ka...@fb.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > Cc: Soheil Hassas Yeganeh <soh...@google.com> > Cc: Willem de Bruijn <will...@google.com> > Cc: Yuchung Cheng <ych...@google.co

Re: [PATCH net 2/2] tcp: Merge tx_flags and tskey in tcp_shifted_skb

2016-04-20 Thread Soheil Hassas Yeganeh
:14601(5840) ack 1 > > 0.300 < . 1:1(0) ack 1 win 257 > 0.300 > P. 1:1461(1460) ack 1 > 0.400 < . 1:1(0) ack 14601 win 257 > > 0.400 close(4) = 0 > 0.400 > F. 14601:14601(0) ack 1 > 0.500 < F. 1:1(0) ack 14602 win 257 > 0.500 > . 14602:14602(0) ack 2 &

Re: [PATCH net-next 1/2] tcp: Carry txstamp_ack in tcp_fragment_tstamp

2016-04-20 Thread Soheil Hassas Yeganeh
00 < F. 1:1(0) ack 16062 win 257 > 0.400 > . 14602:14602(0) ack 2 > > Signed-off-by: Martin KaFai Lau <ka...@fb.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > Cc: Soheil Hassas Yeganeh <soh...@google.com> >

Re: [PATCH net 1/2] tcp: Merge tx_flags and tskey in tcp_collapse_retrans

2016-04-20 Thread Soheil Hassas Yeganeh
:1(0) ack 13142 win 257 > 0.500 > . 13142:13142(0) ack 2 > > Signed-off-by: Martin KaFai Lau <ka...@fb.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > Cc: Soheil Hassas Yeganeh <soh...@google.com> > Cc: Wille

Re: [RFC PATCH v3 net-next 2/3] tcp: Handle eor bit when coalescing skb

2016-04-21 Thread Soheil Hassas Yeganeh
On Thu, Apr 21, 2016 at 12:56 PM, Martin KaFai Lau <ka...@fb.com> wrote: > On Wed, Apr 20, 2016 at 04:04:54PM -0400, Soheil Hassas Yeganeh wrote: >> > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c >> > index a6e4a83..96bdf98 100644 >> > --- a/net/i

Re: [PATCH v2 net-next 7/7] tcp: make tcp_sendmsg() aware of socket backlog

2016-04-29 Thread Soheil Hassas Yeganeh
e to not call tcp_release_cb(), > but we might consider this later. > > Signed-off-by: Eric Dumazet <eduma...@google.com> > Cc: Soheil Hassas Yeganeh <soh...@google.com> > Cc: Alexei Starovoitov <a...@fb.com> > Cc: Marcelo Ricardo Leitner <marcelo.leit

Re: [PATCH v2 net-next 1/7] tcp: do not assume TCP code is non preemptible

2016-04-29 Thread Soheil Hassas Yeganeh
On Thu, Apr 28, 2016 at 11:10 PM, Eric Dumazet wrote: > We want to to make TCP stack preemptible, as draining prequeue > and backlog queues can take lot of time. > > Many SNMP updates were assuming that BH (and preemption) was disabled. > > Need to convert some

Re: [PATCH v2 net-next 4/7] udp: prepare for non BH masking at backlog processing

2016-04-29 Thread Soheil Hassas Yeganeh
-by: Eric Dumazet <eduma...@google.com> Acked-by: Soheil Hassas Yeganeh <soh...@google.com> > --- > net/ipv4/udp.c | 4 ++-- > net/ipv6/udp.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c > index 093284c5c03b..f6

Re: [PATCH v2 net-next 3/7] dccp: do not assume DCCP code is non preemptible

2016-04-29 Thread Soheil Hassas Yeganeh
On Thu, Apr 28, 2016 at 11:10 PM, Eric Dumazet <eduma...@google.com> wrote: > DCCP uses the generic backlog code, and this will soon > be changed to not disable BH when protocol is called back. > > Signed-off-by: Eric Dumazet <eduma...@google.com> Acked-by: Soheil Hassas Ye

Re: [PATCH v2 net-next 2/7] tcp: do not block bh during prequeue processing

2016-04-29 Thread Soheil Hassas Yeganeh
ve prequeue mode some care"), > processing a batch of packets might take time, better not block BH > at all. > > Signed-off-by: Eric Dumazet <eduma...@google.com> Acked-by: Soheil Hassas Yeganeh <soh...@google.com> > --- > net/ipv4/tcp.c | 4 > net/ipv4/tcp_i

Re: [PATCH v2 net-next 6/7] net: do not block BH while processing socket backlog

2016-04-29 Thread Soheil Hassas Yeganeh
> once ring buffer is filled. > > All users are now ready to be called from process context, > we can unblock BH and let interrupts be serviced faster. > > cond_resched_softirq() could be removed, as it has no more user. > > Signed-off-by: Eric Dumazet <eduma...@goo

Re: [PATCH v2 net-next 1/7] tcp: do not assume TCP code is non preemptible

2016-04-29 Thread Soheil Hassas Yeganeh
On Fri, Apr 29, 2016 at 10:37 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Fri, 2016-04-29 at 09:18 -0400, Soheil Hassas Yeganeh wrote: >> On Thu, Apr 28, 2016 at 11:10 PM, Eric Dumazet <eduma...@google.com> wrote: > >> > +

Re: [PATCH net-next 2/2] tcp: remove a redundant check for SKBTX_ACK_TSTAMP

2016-04-27 Thread Soheil Hassas Yeganeh
On Wed, Apr 27, 2016 at 2:19 PM, Martin KaFai Lau <ka...@fb.com> wrote: > On Mon, Apr 25, 2016 at 04:51:13PM -0400, Soheil Hassas Yeganeh wrote: >> From: Soheil Hassas Yeganeh <soh...@google.com> >> >> txstamp_ack in tcp_skb_cb is set iff the SKBTX_ACK_TSTAM

[PATCH v2 net-next 1/2] tcp: remove an unnecessary check in tcp_tx_timestamp

2016-04-27 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Remove the redundant check for sk->sk_tsflags in tcp_tx_timestamp. tcp_tx_timestamp() receives the tsflags as a parameter. As a result the "sk->sk_tsflags || tsflags" is redundant, since tsflags already includes sk->sk_ts

[PATCH v2 net-next 0/2] tcp: simplify ack tx timestamps

2016-04-27 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> v2: - Fully remove SKBTX_ACK_TSTAMP, as suggested by Willem de Bruijn. This patch series aims at removing redundant checks and fields for ack timestamps for TCP. Soheil Hassas Yeganeh (2): tcp: remove an unnecessary check in tcp_tx_tim

[PATCH v2 net-next 2/2] tcp: remove SKBTX_ACK_TSTAMP since it is redundant

2016-04-27 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> The SKBTX_ACK_TSTAMP flag is set in skb_shinfo->tx_flags when the timestamp of the TCP acknowledgement should be reported on error queue. Since accessing skb_shinfo is likely to incur a cache-line miss at the time of receivin

Re: [PATCH net-next] sock: ignore TIMESTAMP, RXQ_OVFL, WIFI_STATUS in sock_cmsg_send

2016-05-13 Thread Soheil Hassas Yeganeh
On Fri, May 13, 2016 at 2:03 AM, David Miller <da...@davemloft.net> wrote: > From: Soheil Hassas Yeganeh <soheil.k...@gmail.com> > Date: Fri, 13 May 2016 00:47:10 -0400 > >> From: Soheil Hassas Yeganeh <soh...@google.com> >> >> SO_TIMESTAMP(N

[PATCH net-next] sock: ignore TIMESTAMP, RXQ_OVFL, WIFI_STATUS in sock_cmsg_send

2016-05-12 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> SO_TIMESTAMP(NS), RXQ_OVFL, and WIFI_STATUS can be returned as receive-side control messages from recvmsg(). Although invalid, some applications may reflect those receive-side control messages back to sendmsg(). Since socket-level control me

Re: [PATCH net-next] sock: propagate __sock_cmsg_send() error

2016-05-13 Thread Soheil Hassas Yeganeh
ntrol messages in IPv4") > Fixes: ad1e46a83716 ("ipv6: process socket-level control messages in IPv6") > Signed-off-by: Eric Dumazet <eduma...@google.com> > Cc: Soheil Hassas Yeganeh <soh...@google.com> Acked-by: Soheil Hassas Yeganeh <soh...@google.com> > --- >

Re: [PATCH net-next] tcp: guarantee forward progress in tcp_sendmsg()

2016-05-02 Thread Soheil Hassas Yeganeh
always return true. > > Fix this by calling sk_flush_backlog() only if one skb had been > allocated and filled before last backlog check. > > Fixes: d41a69f1d390 ("tcp: make tcp_sendmsg() aware of socket backlog") > Signed-off-by: Eric Dumazet <eduma...@google.com> Ack

Re: [PATCH net] tcp: Fix SOF_TIMESTAMPING_TX_ACK when handling dup acks

2016-04-19 Thread Soheil Hassas Yeganeh
tsockopt(4, SOL_SOCKET, 37, [2688], 4) = 0 > 0.200 write(4, ..., 1460) = 1460 > 0.200 write(4, ..., 13140) = 13140 > > 0.200 > P. 1:1461(1460) ack 1 > 0.200 > . 1461:8761(7300) ack 1 > 0.200 > P. 8761:14601(5840) ack 1 > > 0.300 < . 1:1(0) ack 1 win 257 >

Re: [RFC PATCH v2 net-next 1/7] tcp: Carry txstamp_ack in tcp_fragment_tstamp

2016-04-19 Thread Soheil Hassas Yeganeh
On Tue, Apr 19, 2016 at 1:39 PM, Martin KaFai Lau <ka...@fb.com> wrote: > On Tue, Apr 19, 2016 at 01:21:04AM -0400, Soheil Hassas Yeganeh wrote: >> Could you please submit the timestamping patches separately as non RFCs? >> Thanks! > Agree. I will re-spin. Great, thank you very much!

Re: [RFC PATCH v2 net-next 2/7] tcp: Merge tx_flags/tskey/txstamp_ack in tcp_collapse_retrans

2016-04-19 Thread Soheil Hassas Yeganeh
On Tue, Apr 19, 2016 at 2:18 PM, Martin KaFai Lau wrote: > On Tue, Apr 19, 2016 at 10:35:52AM -0700, Eric Dumazet wrote: >> On Tue, Apr 19, 2016 at 10:28 AM, Martin KaFai Lau wrote: >> >> > A bit off topic, I feel like the SKBTX_ACK_TSTAMP and txstamp_ack are sort >>

Re: [RFC PATCH v2 net-next 2/7] tcp: Merge tx_flags/tskey/txstamp_ack in tcp_collapse_retrans

2016-04-19 Thread Soheil Hassas Yeganeh
On Tue, Apr 19, 2016 at 1:28 PM, Martin KaFai Lau <ka...@fb.com> wrote: > On Tue, Apr 19, 2016 at 01:32:14AM -0400, Soheil Hassas Yeganeh wrote: >> > + TCP_SKB_CB(skb)->txstamp_ack = >> > + !!(shinfo->tx_flags & SKBTX

Re: [RFC PATCH v2 net-next 1/7] tcp: Carry txstamp_ack in tcp_fragment_tstamp

2016-04-18 Thread Soheil Hassas Yeganeh
k 1 > 0.400 < F. 1:1(0) ack 16062 win 257 > 0.400 > . 14602:14602(0) ack 2 > > Signed-off-by: Martin KaFai Lau <ka...@fb.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > Cc: Soheil Hassas Yeganeh <soheil.k...

Re: [RFC PATCH v2 net-next 2/7] tcp: Merge tx_flags/tskey/txstamp_ack in tcp_collapse_retrans

2016-04-18 Thread Soheil Hassas Yeganeh
close(4) = 0 > 0.400 > F. 13141:13141(0) ack 1 > 0.500 < F. 1:1(0) ack 13142 win 257 > 0.500 > . 13142:13142(0) ack 2 > > Signed-off-by: Martin KaFai Lau <ka...@fb.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > C

Re: [RFC PATCH v2 net-next 3/7] tcp: Merge tx_flags/tskey/txstamp_ack in tcp_shifted_skb

2016-04-18 Thread Soheil Hassas Yeganeh
t; F. 1:1(0) ack 14602 win 257 > 0.500 > . 14602:14602(0) ack 2 > > Signed-off-by: Martin KaFai Lau <ka...@fb.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > Cc: Soheil Hassas Yeganeh <soheil.k...@gmail.com> Ac

[PATCH net] tcp: consider recv buf for the initial window scale

2016-07-28 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> tcp_select_initial_window() intends to advertise a window scaling for the maximum possible window size. To do so, it considers the maximum of net.ipv4.tcp_rmem[2] and net.core.rmem_max as the only possible upper-bounds. However,

[PATCH v2 net] tcp: consider recv buf for the initial window scale

2016-07-29 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> tcp_select_initial_window() intends to advertise a window scaling for the maximum possible window size. To do so, it considers the maximum of net.ipv4.tcp_rmem[2] and net.core.rmem_max as the only possible upper-bounds. However,

Re: [PATCH net] tcp: consider recv buf for the initial window scale

2016-07-29 Thread Soheil Hassas Yeganeh
On Fri, Jul 29, 2016 at 9:21 AM, Neal Cardwell <ncardw...@google.com> wrote: > > On Thu, Jul 28, 2016 at 11:11 PM, Soheil Hassas Yeganeh > <soheil.k...@gmail.com> wrote: > > > > From: Soheil Hassas Yeganeh <soh...@google.com> > > > > tcp_se

[PATCH net] packet: propagate sock_cmsg_send() error

2016-07-20 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> sock_cmsg_send() can return different error codes and not only -EINVAL, and we should properly propagate them. Fixes: c14ac9451c34 ("sock: enable timestamping using control messages") Signed-off-by: Soheil Hassas Yeganeh <so

Re: [PATCH v3] packet: fix second argument of sock_tx_timestamp()

2016-07-19 Thread Soheil Hassas Yeganeh
y: Kazuya Mizuguchi <kazuya.mizuguchi...@renesas.com> > Reported-by: Keita Kobayashi <keita.kobayashi...@renesas.com> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com> Acked-by: Soheil Hassas Yeganeh <soh...@google.com> > --- > Changes from v2:

[PATCH v2 net] sock: ignore SCM_RIGHTS and SCM_CREDENTIALS in __sock_cmsg_send

2016-07-11 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Sergei Trofimovich reported that pulse audio sends SCM_CREDENTIALS as a control message to TCP. Since __sock_cmsg_send does not support SCM_RIGHTS and SCM_CREDENTIALS, it returns an error and hence breaks pulse audio over TCP. SCM_

Re: [PATCH net] sock: ignore SCM_RIGHTS and SCM_CREDENTIALS in __sock_cmsg_send

2016-07-11 Thread Soheil Hassas Yeganeh
On Mon, Jul 11, 2016 at 4:39 PM, David Miller <da...@davemloft.net> wrote: > > From: Soheil Hassas Yeganeh <soheil.k...@gmail.com> > Date: Sun, 10 Jul 2016 12:51:46 -0400 > > > From: Soheil Hassas Yeganeh <soh...@google.com> > > > > Se

Re: [BUG?] tcp regression in v4.7-r1: c14ac9451c34832554db33386a4393be8bba3a7b breaks pulseaudio over TCP

2016-07-10 Thread Soheil Hassas Yeganeh
On Sun, Jul 10, 2016 at 7:42 AM, Sergei Trofimovich wrote: > Hi netdev folk! > > Commit c14ac9451c34832554db33386a4393be8bba3a7b > broke pulseaudio (PA) over TCP. Sorry that my patch broke your app and thanks for the bug report. Breaking PA was certainly not my intention. >

Re: [BUG?] tcp regression in v4.7-r1: c14ac9451c34832554db33386a4393be8bba3a7b breaks pulseaudio over TCP

2016-07-10 Thread Soheil Hassas Yeganeh
On Sun, Jul 10, 2016 at 12:25 PM, Sergei Trofimovich <sly...@gentoo.org> wrote: > On Sun, 10 Jul 2016 11:15:01 -0400 > Soheil Hassas Yeganeh <soh...@google.com> wrote: > >> On Sun, Jul 10, 2016 at 7:42 AM, Sergei Trofimovich <sly...@gentoo.org> >> wrote

[PATCH net] sock: ignore SCM_RIGHTS and SCM_CREDENTIALS in __sock_cmsg_send

2016-07-10 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Sergei Trofimovich reported that pulse audio sends SCM_CREDENTIALS as a control message to TCP. Since __sock_cmsg_send does not support SCM_RIGHTS and SCM_CREDENTIALS, it returns an error and hence breaks pulse audio over TCP. SCM_

Re: Extending socket timestamping API for NTP

2017-02-07 Thread Soheil Hassas Yeganeh
On Tue, Feb 7, 2017 at 6:01 AM, Miroslav Lichvar wrote: > 2) new SO_TIMESTAMPING option to receive from the error queue only >user data as was passed to sendmsg() instead of Ethernet frames > >Parsing Ethernet and IP headers (especially IPv6 options) is not >fun

Re: Extending socket timestamping API for NTP

2017-02-08 Thread Soheil Hassas Yeganeh
On Tue, Feb 7, 2017 at 2:32 PM, Willem de Bruijn wrote: >>> 2) new SO_TIMESTAMPING option to receive from the error queue only >>>user data as was passed to sendmsg() instead of Ethernet frames >>> >>>Parsing Ethernet and IP headers (especially IPv6

Re: [BUG] 4.10-rc8 - ping spinning?

2017-02-16 Thread Soheil Hassas Yeganeh
On Thu, Feb 16, 2017 at 11:08 AM, <l...@pengaru.com> wrote: > On Thu, Feb 16, 2017 at 10:52:19AM -0500, Soheil Hassas Yeganeh wrote: >> On Thu, Feb 16, 2017 at 10:50 AM, Soheil Hassas Yeganeh >> <soh...@google.com> wrote: >> > Thank you Vito for the report. &g

Re: [BUG] 4.10-rc8 - ping spinning?

2017-02-16 Thread Soheil Hassas Yeganeh
On Thu, Feb 16, 2017 at 10:50 AM, Soheil Hassas Yeganeh <soh...@google.com> wrote: > Thank you Vito for the report. > > The patch you cited actually resolves a similar backward compatibility > problem for traceroute. > > I suspect the problem here is that ther

Re: [BUG] 4.10-rc8 - ping spinning?

2017-02-16 Thread Soheil Hassas Yeganeh
d message below. This was sent to linux-kernel but > after digging a little I suspect it's specific to the network stack. > > Perusing the net/ changes between 4.9 and 4.10-rc8 this sounded awful related > to what I'm observing: > > commit 83a1a1a70e87f676fbb6086b26b6ac7f7fdd107d > Au

Re: [PATCH net-next 2/2] tcp: put a TLV list of TCP stats in error queue

2016-09-06 Thread Soheil Hassas Yeganeh
sage with a cmsg_type of > SCM_OPT_STATS containing the list of TLVs in its cmsg_data. > > Signed-off-by: Francis Y. Yan <francisy...@gmail.com> > Signed-off-by: Yuchung Cheng <ych...@google.com> Acked-by: Soheil Hassas Yeganeh <soh...@google.com>

Re: [PATCH net-next 1/2] tcp: measure rwnd-limited time

2016-09-06 Thread Soheil Hassas Yeganeh
nt) in tcp_sock to carefully handle tcp_info's reading of > rwnd_limited_ts and rwnd_limited in order to get a consistent snapshot > of both variables together. > > Signed-off-by: Francis Y. Yan <francisy...@gmail.com> > Signed-off-by: Yuchung Cheng <ych...@google.com> Acked-by: Soheil Hassas Yeganeh <soh...@google.com>

Re: [PATCH net-next] tcp: refine tcp_prune_ofo_queue() to not drop all packets

2016-08-17 Thread Soheil Hassas Yeganeh
esources. > > This patch cleans only a part of the out of order queue in order > to meet the memory constraints. > > Signed-off-by: Eric Dumazet <eduma...@google.com> > Cc: Neal Cardwell <ncardw...@google.com> > Cc: Yuchung Cheng <ych...@google.com> > C

[PATCH net] tun: fix transmit timestamp support

2016-08-23 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Instead of using sock_tx_timestamp, use skb_tx_timestamp to record software transmit timestamp of a packet. sock_tx_timestamp resets and overrides the tx_flags of the skb. The function is intended to be called from within the protocol laye

Re: [PATCH net] inet: Fix missing return value in inet6_hash

2016-10-25 Thread Soheil Hassas Yeganeh
in the IPv6 case. > > Fixes: 496611d7b5ea ("inet: create IPv6-equivalent inet_hash function") > Reported-by: Soheil Hassas Yeganeh <soh...@google.com> > Signed-off-by: Craig Gallek <kr...@google.com> Acked-by: Soheil Hassas Yeganeh <soh...@google.com> >

Re: [PATCH net] net: clear sk_err_soft in sk_clone_lock()

2016-10-28 Thread Soheil Hassas Yeganeh
ue in the child, as it > makes future getsockopt(SO_ERROR) calls quite unreliable. > > Signed-off-by: Eric Dumazet <eduma...@google.com> Acked-by: Soheil Hassas Yeganeh <soh...@google.com> > --- > net/core/sock.c |1 + > 1 file changed, 1 insertion(+

[PATCH net] sock: fix sendmmsg for partial sendmsg

2016-11-04 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Do not send the next message in sendmmsg for partial sendmsg invocations. sendmmsg assumes that it can continue sending the next message when the return value of the individual sendmsg invocations is positive. It results in corrupting th

Re: [PATCH net-next] tcp: remove unaligned accesses from tcp_get_info()

2016-11-09 Thread Soheil Hassas Yeganeh
we can avoid > the unaligned helpers. > > Suggested-by: David Miller <da...@davemloft.net> > Signed-off-by: Eric Dumazet <eduma...@google.com> Acked-by: Soheil Hassas Yeganeh <soh...@google.com> > --- > net/ipv4/tcp.c | 11 +-- > 1 file changed, 5 insertions

[PATCH net-next] sock: do not set sk_err in sock_dequeue_err_skb

2016-11-03 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Do not set sk_err when dequeuing errors from the error queue. Doing so results in: a) Bugs: By overwriting existing sk_err values, it possibly hides legitimate errors. It is also incorrect when local errors are queued with ip_local

Re: [PATCH net] tcp: fix return value for partial writes

2016-11-02 Thread Soheil Hassas Yeganeh
> Issue was diagnosed by Soheil and Willem, big kudos to them ! > > Fixes: d41a69f1d390f ("tcp: make tcp_sendmsg() aware of socket backlog") > Signed-off-by: Eric Dumazet <eduma...@google.com> > Cc: Willem de Bruijn <will...@google.com> > Cc: Soheil Hassas Y

[PATCH net-next] sock: reset sk_err for ICMP packets read from error queue

2016-11-30 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Only when ICMP packets are enqueued onto the error queue, sk_err is also set. Before f5f99309fa74 (sock: do not set sk_err in sock_dequeue_err_skb), a subsequent error queue read would set sk_err to the next error on the queue, or 0 if

Re: [PATCH] tcp: provide tx timestamps for partial writes

2017-01-03 Thread Soheil Hassas Yeganeh
On Mon, Jan 2, 2017 at 3:23 PM, Soheil Hassas Yeganeh <soh...@google.com> wrote: > On Mon, Jan 2, 2017 at 3:20 PM, Soheil Hassas Yeganeh > <soheil.k...@gmail.com> wrote: >> From: Soheil Hassas Yeganeh <soh...@google.com> >> >> For TCP sockets, tx times

Re: [PATCH] tcp: provide tx timestamps for partial writes

2017-01-04 Thread Soheil Hassas Yeganeh
On Wed, Jan 4, 2017 at 7:55 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: > > On Tue, 2017-01-03 at 10:22 -0500, Soheil Hassas Yeganeh wrote: > > On Mon, Jan 2, 2017 at 3:23 PM, Soheil Hassas Yeganeh <soh...@google.com> > > wrote: > > > On Mon, Jan 2,

[PATCH net-next v2] tcp: provide timestamps for partial writes

2017-01-04 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> For TCP sockets, TX timestamps are only captured when the user data is successfully and fully written to the socket. In many cases, however, TCP writes can be partial for which no timestamp is collected. Collect timestamps whenever any use

[PATCH] tcp: provide tx timestamps for partial writes

2017-01-02 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> For TCP sockets, tx timestamps are only captured when the user data is successfully and fully written to the socket. In many cases, however, TCP writes can be partial for which no timestamp is collected. Collect timestamps when the use

Re: [PATCH] tcp: provide tx timestamps for partial writes

2017-01-02 Thread Soheil Hassas Yeganeh
On Mon, Jan 2, 2017 at 3:20 PM, Soheil Hassas Yeganeh <soheil.k...@gmail.com> wrote: > From: Soheil Hassas Yeganeh <soh...@google.com> > > For TCP sockets, tx timestamps are only captured when the user data > is successfully and fully written to the socket. In many cases, &

[PATCH net 1/2] tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs

2017-03-18 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> __sock_recv_timestamp can be called for both normal skbs (for receive timestamps) and for skbs on the error queue (for transmit timestamps). Commit 1c885808e456 (tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING) assumes any skb

[PATCH net 2/2] tcp: mark skbs with SCM_TIMESTAMPING_OPT_STATS

2017-03-18 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> SOF_TIMESTAMPING_OPT_STATS can be enabled and disabled while packets are collected on the error queue. So, checking SOF_TIMESTAMPING_OPT_STATS in sk->sk_tsflags is not enough to safely assume that the skb contains OPT_STATS data.

[PATCH net-next 1/2] tcp: remove per-destination timestamp cache

2017-03-15 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> Commit 8a5bd45f6616 (tcp: randomize tcp timestamp offsets for each connection) randomizes TCP timestamps per connection. After this commit, there is no guarantee that the timestamps received from the same destination are monotonically incr

[PATCH net-next 2/2] tcp: remove tcp_tw_recycle

2017-03-15 Thread Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soh...@google.com> The tcp_tw_recycle was already broken for connections behind NAT, since the per-destination timestamp is not monotonically increasing for multiple machines behind a single destination address. After the randomization of TCP timestamp o

  1   2   >