All of lore.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Herbert Xu
	<herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>,
	Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Shlomo Pongratz <shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH 2/2] IB/ipoib: fix GRO merge failure for IPoIB originated TCP streams
Date: Thu, 2 Feb 2012 16:01:47 +0200	[thread overview]
Message-ID: <4F2A974B.209@mellanox.com> (raw)
In-Reply-To: <1328105262.2595.24.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

On 2/1/2012 4:07 PM, Eric Dumazet wrote:
>>> If we just turn it into a memcmp with a variable length would
>>> that work for you?
>>
>> I think yes, FWIW we will compare the IPoIB header, Roland is that okay for you?
>
> A memcmp(xxx, yyy, variable_len) will be out of line and slow, its a bit sad ... Are skb_mac_header(p) / skb_gro_mac_header(skb) going to point to IPoIB header ?

yes, both skb_mac_header(p) / skb_gro_mac_header(skb) point to IPoIB 
header, however (see next)


> Maybe we can keep a fastpath for ethernet case... (the "if (hlen == ETH_HLEN) being always predicted)
> Maybe need to introduce gro_hard_header_len as well)

today, IPoIB advertizes hard_header_len which is bigger than the IPoIB 
header len, this is done such that skbs sent by the network stack have 
enough headroom for a "pseudoheader" which for few flows (e.g unicast 
arp replies and multicast) is placed there by the ipoib hard_header 
function and later used by the xmit function.

So we can either try and change that, such that hard_header_len will be 
equal to the ipoib header len or add gro_hard_header_len as you 
suggested, any preferences?

Or.

Or.




>
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 115dee1..62abee4 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3500,14 +3500,20 @@ static inline gro_result_t
>   __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
>   {
>   	struct sk_buff *p;
> +	unsigned int hlen = skb->dev->hard_header_len;
>
>   	for (p = napi->gro_list; p; p = p->next) {
>   		unsigned long diffs;
>
>   		diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
>   		diffs |= p->vlan_tci ^ skb->vlan_tci;
> -		diffs |= compare_ether_header(skb_mac_header(p),
> -					      skb_gro_mac_header(skb));
> +		if (hlen == ETH_HLEN)
> +			diffs |= compare_ether_header(skb_mac_header(p),
> +						      skb_gro_mac_header(skb));
> +		else if (!diffs)
> +			diffs = memcmp(skb_mac_header(p),
> +					skb_gro_mac_header(skb),
> +					skb->dev->hard_header_len);
>   		NAPI_GRO_CB(p)->same_flow = !diffs;
>   		NAPI_GRO_CB(p)->flush = 0;
>   	}
>
>

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

WARNING: multiple messages have this Message-ID (diff)
From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Herbert Xu
	<herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>,
	Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Shlomo Pongratz <shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH 2/2] IB/ipoib: fix GRO merge failure for IPoIB originated TCP streams
Date: Thu, 2 Feb 2012 16:01:47 +0200	[thread overview]
Message-ID: <4F2A974B.209@mellanox.com> (raw)
In-Reply-To: <1328105262.2595.24.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

On 2/1/2012 4:07 PM, Eric Dumazet wrote:
>>> If we just turn it into a memcmp with a variable length would
>>> that work for you?
>>
>> I think yes, FWIW we will compare the IPoIB header, Roland is that okay for you?
>
> A memcmp(xxx, yyy, variable_len) will be out of line and slow, its a bit sad ... Are skb_mac_header(p) / skb_gro_mac_header(skb) going to point to IPoIB header ?

yes, both skb_mac_header(p) / skb_gro_mac_header(skb) point to IPoIB 
header, however (see next)


> Maybe we can keep a fastpath for ethernet case... (the "if (hlen == ETH_HLEN) being always predicted)
> Maybe need to introduce gro_hard_header_len as well)

today, IPoIB advertizes hard_header_len which is bigger than the IPoIB 
header len, this is done such that skbs sent by the network stack have 
enough headroom for a "pseudoheader" which for few flows (e.g unicast 
arp replies and multicast) is placed there by the ipoib hard_header 
function and later used by the xmit function.

So we can either try and change that, such that hard_header_len will be 
equal to the ipoib header len or add gro_hard_header_len as you 
suggested, any preferences?

Or.

Or.




>
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 115dee1..62abee4 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3500,14 +3500,20 @@ static inline gro_result_t
>   __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
>   {
>   	struct sk_buff *p;
> +	unsigned int hlen = skb->dev->hard_header_len;
>
>   	for (p = napi->gro_list; p; p = p->next) {
>   		unsigned long diffs;
>
>   		diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
>   		diffs |= p->vlan_tci ^ skb->vlan_tci;
> -		diffs |= compare_ether_header(skb_mac_header(p),
> -					      skb_gro_mac_header(skb));
> +		if (hlen == ETH_HLEN)
> +			diffs |= compare_ether_header(skb_mac_header(p),
> +						      skb_gro_mac_header(skb));
> +		else if (!diffs)
> +			diffs = memcmp(skb_mac_header(p),
> +					skb_gro_mac_header(skb),
> +					skb->dev->hard_header_len);
>   		NAPI_GRO_CB(p)->same_flow = !diffs;
>   		NAPI_GRO_CB(p)->flush = 0;
>   	}
>
>

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

  reply	other threads:[~2012-02-02 14:01 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26 14:39 [PATCH 0/2] IB/{mlx4,ipoib}: bug fixes for vendor mads and ipoib/gro Or Gerlitz
     [not found] ` <alpine.LRH.2.00.1201261624540.30384-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
2012-01-26 14:41   ` [PATCH 1/2] IB/mlx4: pass SMP vendor-specific attribute MADs to firmware Or Gerlitz
     [not found]     ` <alpine.LRH.2.00.1201261640360.31408-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
2012-01-26 18:59       ` Ira Weiny
2012-01-26 14:43   ` [PATCH 2/2] IB/ipoib: fix GRO merge failure for IPoIB originated TCP streams Or Gerlitz
     [not found]     ` <alpine.LRH.2.00.1201261642340.31408-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
2012-01-30  4:36       ` Roland Dreier
     [not found]         ` <CAL1RGDUm8ROxFFMa+D1ZD5jF+cK+kV8aEVzspgnZFNXeuai+fA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-30  7:44           ` Shlomo Pongratz
     [not found]             ` <36F7E4A28C18BE4DB7C86058E7B607240BE9687A-SlGPd/IId7auSA5JZHE7gA@public.gmane.org>
2012-01-30 18:11               ` Roland Dreier
     [not found]                 ` <CAL1RGDXjjQ-PhCv-9WJX45NuovC9XiS=_7507OsyvLW_gBaJ5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-30 18:16                   ` Or Gerlitz
     [not found]                     ` <CAJZOPZLhgDysSASyMLNpOrmGzEyfyHAQjGLVei6ZNSFfb7TM1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-30 19:00                       ` Roland Dreier
2012-01-30  7:44           ` Or Gerlitz
2012-01-30  7:44             ` Or Gerlitz
     [not found]             ` <4F264A6C.3070706-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-01-30  8:04               ` Eric Dumazet
2012-01-30  8:11                 ` Or Gerlitz
2012-01-30  8:11                   ` Or Gerlitz
2012-01-30  8:18                 ` Herbert Xu
     [not found]                   ` <20120130081849.GA7848-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2012-01-30  8:53                     ` Eric Dumazet
2012-01-30  8:57                       ` Herbert Xu
     [not found]                         ` <20120130085742.GA8262-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2012-01-30 16:43                           ` David Miller
2012-02-01  8:23                           ` Or Gerlitz
     [not found]                             ` <CAJZOPZJb1HvcS0XXKLvoDuoi1EfYTY-awwY2g0aHWoS=4qmdyQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01  8:38                               ` Herbert Xu
     [not found]                                 ` <20120201083837.GA7081-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2012-02-01  9:43                                   ` Or Gerlitz
2012-02-01 14:07                                     ` Eric Dumazet
2012-02-02 14:01                                       ` Or Gerlitz [this message]
2012-02-02 14:01                                         ` Or Gerlitz
     [not found]                                         ` <4F2A974B.209-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-02-02 14:38                                           ` Eric Dumazet
2012-02-02 14:44                                             ` Eric Dumazet
2012-02-02 21:42                                               ` Or Gerlitz
2012-02-02 15:43                                             ` Or Gerlitz
2012-02-02 15:43                                               ` Or Gerlitz
2012-01-30  8:25                 ` Michał Mirosław
2012-02-02 21:58       ` Or Gerlitz
2012-02-02 21:58         ` Or Gerlitz
     [not found]         ` <alpine.LRH.2.00.1202022352560.30300-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
2012-02-03  7:18           ` Hefty, Sean
     [not found]             ` <1828884A29C6694DAF28B7E6B8A823733349A5D2-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-02-03  9:00               ` Eric Dumazet
2012-02-03 20:24                 ` Hefty, Sean
     [not found]                   ` <1828884A29C6694DAF28B7E6B8A823733349A6C9-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-02-06 15:05                     ` Or Gerlitz
     [not found]                       ` <4F2FEC36.6090800-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-02-06 15:21                         ` Eric Dumazet
2012-02-06 15:22                           ` Or Gerlitz
     [not found]                             ` <4F2FF050.7040400-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-02-06 16:27                               ` [PATCH net-next] gro: introduce gro_mac_header_len Eric Dumazet
2012-02-06 16:31                                 ` David Miller
     [not found]                                   ` <20120206.113145.1284864994961472499.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-06 16:44                                     ` Or Gerlitz
2012-02-06 16:44                                       ` Or Gerlitz
     [not found]                                       ` <4F300353.2080705-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-02-06 17:00                                         ` David Miller
2012-02-06 16:47                                   ` [PATCH net-next V2] " Eric Dumazet
2012-02-06 16:58                                     ` David Miller
2012-02-06 16:58                                       ` David Miller
2012-02-06 17:07                                       ` Eric Dumazet
2012-02-06 17:11                                         ` Or Gerlitz
2012-02-06 17:11                                           ` Or Gerlitz
     [not found]                                           ` <4F3009AE.2090605-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-02-06 17:19                                             ` Eric Dumazet
     [not found]                                       ` <20120206.115859.1384761795375582044.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-06 17:09                                         ` Or Gerlitz
2012-02-06 17:09                                           ` Or Gerlitz
2012-02-06 17:23                                         ` Roland Dreier
     [not found]                                           ` <CAG4TOxOBCbEEOtP62ZM1R3-6umebdbJFkK0bnjphLCZOgHzt1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06 19:12                                             ` David Miller
     [not found]                                               ` <20120206.141223.332863167187002998.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-06 19:23                                                 ` Roland Dreier
     [not found]                                                   ` <CAG4TOxNgJ3=AFuA==Km815YzW8eQ7nD_UAzkXLSXcAyaCAAvPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06 19:32                                                     ` David Miller
     [not found]                                                       ` <20120206.143230.1415707004934341114.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-06 19:51                                                         ` David Miller
     [not found]                                                           ` <20120206.145148.558736903670696169.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-06 19:56                                                             ` David Miller
     [not found]                                                               ` <20120206.145652.1575591691467905094.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-06 20:01                                                                 ` Roland Dreier
     [not found]                                                                   ` <CAG4TOxNcB8+SP3f0WhZG1GZ481s+=7pVRv91vzAbwDzUZD8g_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06 20:15                                                                     ` David Miller
     [not found]                                                                       ` <20120206.151509.1959432192519622134.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-07 19:51                                                                         ` Roland Dreier
2012-02-07 20:33                                                                           ` David Miller
     [not found]                                                                             ` <20120207.153325.1941809701255235550.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-07 20:34                                                                               ` Roland Dreier
     [not found]                                                                                 ` <CAG4TOxP2iEgT64L8vAR6P139U-HyHSxU8gdWw+cLsDwWSGkrwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-08  0:51                                                                                   ` [PATCH] IPoIB: Stop lying about hard_header_len and use skb->cb to stash LL addresses Roland Dreier
2012-02-08  7:29                                                                                     ` Hefty, Sean
     [not found]                                                                                       ` <1828884A29C6694DAF28B7E6B8A82373374C1C26-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-02-08  7:50                                                                                         ` Eric Dumazet
2012-02-08 14:28                                                                                           ` Or Gerlitz
2012-02-08 20:50                                                                                     ` David Miller
2012-02-06 19:59                                                             ` [PATCH net-next V2] gro: introduce gro_mac_header_len Roland Dreier
2012-02-07 16:29                                                             ` Or Gerlitz
2012-02-08 18:51                                     ` [PATCH net-next] gro: more generic L2 header check Eric Dumazet
2012-02-08 18:51                                       ` Eric Dumazet
2012-02-08 20:50                                       ` David Miller
     [not found]                                         ` <20120208.155027.599792363539233740.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-08 21:08                                           ` Or Gerlitz
     [not found]                                             ` <CAJZOPZL_zEbNwUfVOmQeODny7HDf24gOc1HStfBxim_UtD-kvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-08 21:31                                               ` David Miller
     [not found]                                                 ` <20120208.163159.2229331610142060560.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-08 21:49                                                   ` Or Gerlitz
     [not found]                                                     ` <CAJZOPZLLteDbm0prTN3-npubtFun=kO2DYT7ea=E-HyJ84gaiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-08 23:09                                                       ` David Miller
     [not found]                                                         ` <20120208.180917.586628615268005115.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-08 23:20                                                           ` Or Gerlitz
     [not found]                                                             ` <CAJZOPZ+SyGsDpnK89wNWtBn4Jdzc2tg1diKjbHSv=n75XiG+ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-08 23:26                                                               ` David Miller
     [not found]                                                                 ` <20120208.182629.1816927738607872730.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-09 10:46                                                                   ` Or Gerlitz
2012-02-09 10:46                                                                     ` Or Gerlitz
     [not found]                                                                     ` <4F33A3FC.1050205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-02-09 18:52                                                                       ` David Miller
     [not found]                                                                         ` <20120209.135235.957414875716615693.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-09 20:04                                                                           ` Or Gerlitz
2012-02-09 20:29                                                                             ` David Miller
     [not found]                                                                               ` <20120209.152943.1123862542883793404.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-09 22:18                                                                                 ` Or Gerlitz
     [not found]                                                                                   ` <CAJZOPZKUG-tT+Zd=1EiLhgRxg4VEDrisBJQ99XtARMvK68UWfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-09 22:28                                                                                     ` David Miller
2012-01-29  7:28   ` [PATCH 0/2] IB/{mlx4,ipoib}: bug fixes for vendor mads and ipoib/gro Or Gerlitz
     [not found]     ` <4F24F51F.20309-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-01-31 19:12       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A8237333498CF8-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-02-01  2:14           ` Roland Dreier
     [not found]             ` <CAL1RGDW-uSrgpBhOr5gm4gWVrP3bqv2jihKqjpoPmbPoga_DJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 17:26               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237333499FCE-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-02-02 16:50                   ` Hefty, Sean
     [not found]                     ` <1828884A29C6694DAF28B7E6B8A823733349A32B-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-02-02 21:55                       ` Or Gerlitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F2A974B.209@mellanox.com \
    --to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.