Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-14 Thread Eric Dumazet
On 6/14/19 7:25 AM, Eric Dumazet wrote: > On Fri, Jun 14, 2019 at 7:04 AM maowenan wrote: >> I agree that this is a special case. >> I propose one point about the sequence of synack, if two synack with two >> different >> sequence since the time elapse 64ns, this issue disappear. >> >>

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-14 Thread Eric Dumazet
On Fri, Jun 14, 2019 at 7:04 AM maowenan wrote: > I agree that this is a special case. > I propose one point about the sequence of synack, if two synack with two > different > sequence since the time elapse 64ns, this issue disappear. > >

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-14 Thread maowenan
On 2019/6/14 20:27, Eric Dumazet wrote: > On Fri, Jun 14, 2019 at 2:35 AM maowenan wrote: >> >> >> >> On 2019/6/14 12:28, Eric Dumazet wrote: >>> >>> >>> On 6/13/19 9:19 PM, maowenan wrote: @Eric, for this issue I only want to check TCP_NEW_SYN_RECV sk, is it OK like

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-14 Thread Eric Dumazet
On Fri, Jun 14, 2019 at 2:35 AM maowenan wrote: > > > > On 2019/6/14 12:28, Eric Dumazet wrote: > > > > > > On 6/13/19 9:19 PM, maowenan wrote: > >> > >> > >> @Eric, for this issue I only want to check TCP_NEW_SYN_RECV sk, is it OK > >> like below? > >> + if (!osk && sk->sk_state ==

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-14 Thread maowenan
On 2019/6/14 12:28, Eric Dumazet wrote: > > > On 6/13/19 9:19 PM, maowenan wrote: >> >> >> @Eric, for this issue I only want to check TCP_NEW_SYN_RECV sk, is it OK >> like below? >> + if (!osk && sk->sk_state == TCP_NEW_SYN_RECV) >> + reqsk =

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-13 Thread Eric Dumazet
On 6/13/19 9:19 PM, maowenan wrote: > > > @Eric, for this issue I only want to check TCP_NEW_SYN_RECV sk, is it OK like > below? > + if (!osk && sk->sk_state == TCP_NEW_SYN_RECV) > + reqsk = __inet_lookup_established(sock_net(sk), > _hashinfo, > +

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-13 Thread maowenan
>>> diff --git a/net/ipv4/inet_connection_sock.c >>> b/net/ipv4/inet_connection_sock.c >>> index 13ec7c3a9c49..fd45ed2fd985 100644 >>> --- a/net/ipv4/inet_connection_sock.c >>> +++ b/net/ipv4/inet_connection_sock.c >>> @@ -749,7 +749,7 @@ static void reqsk_timer_handler(struct timer_list *t) >>>

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-13 Thread maowenan
On 2019/6/13 0:30, Eric Dumazet wrote: > On Tue, Jun 11, 2019 at 8:49 PM Mao Wenan wrote: >> >> There is one issue about bonding mode BOND_MODE_BROADCAST, and >> two slaves with diffierent affinity, so packets will be handled >> by different cpu. These are two pre-conditions in this case. >>

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-13 Thread maowenan
On 2019/6/13 0:25, David Miller wrote: > From: Mao Wenan > Date: Wed, 12 Jun 2019 11:57:15 +0800 > >> diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c >> index c4503073248b..b6a1b5334565 100644 >> --- a/net/ipv4/inet_hashtables.c >> +++ b/net/ipv4/inet_hashtables.c >> @@

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-12 Thread Eric Dumazet
On Tue, Jun 11, 2019 at 8:49 PM Mao Wenan wrote: > > There is one issue about bonding mode BOND_MODE_BROADCAST, and > two slaves with diffierent affinity, so packets will be handled > by different cpu. These are two pre-conditions in this case. > > When two slaves receive the same syn packets at

Re: [PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-12 Thread David Miller
From: Mao Wenan Date: Wed, 12 Jun 2019 11:57:15 +0800 > diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c > index c4503073248b..b6a1b5334565 100644 > --- a/net/ipv4/inet_hashtables.c > +++ b/net/ipv4/inet_hashtables.c > @@ -477,6 +477,7 @@ bool inet_ehash_insert(struct sock

[PATCH net v2] tcp: avoid creating multiple req socks with the same tuples

2019-06-11 Thread Mao Wenan
There is one issue about bonding mode BOND_MODE_BROADCAST, and two slaves with diffierent affinity, so packets will be handled by different cpu. These are two pre-conditions in this case. When two slaves receive the same syn packets at the same time, two request sock(reqsk) will be created if