From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756673AbcAHVIE (ORCPT ); Fri, 8 Jan 2016 16:08:04 -0500 Received: from mail-bl2on0121.outbound.protection.outlook.com ([65.55.169.121]:29998 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756530AbcAHVIA convert rfc822-to-8bit (ORCPT ); Fri, 8 Jan 2016 16:08:00 -0500 From: Haiyang Zhang To: Vitaly Kuznetsov , Simon Xiao , Eric Dumazet CC: Tom Herbert , "netdev@vger.kernel.org" , KY Srinivasan , "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" , David Miller Subject: RE: [PATCH net-next] hv_netvsc: don't make assumptions on struct flow_keys layout Thread-Topic: [PATCH net-next] hv_netvsc: don't make assumptions on struct flow_keys layout Thread-Index: AQHRSS5wio8pcMgzQEufP61mK8sY857wAiwAgAAKFhqAAhHOMA== Date: Fri, 8 Jan 2016 21:07:58 +0000 Message-ID: References: <1452159189-11473-1-git-send-email-vkuznets@redhat.com> <1452171150.8255.207.camel@edumazet-glaptop2.roam.corp.google.com> <877fjlfrid.fsf@vitty.brq.redhat.com> In-Reply-To: <877fjlfrid.fsf@vitty.brq.redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=haiyangz@microsoft.com; x-originating-ip: [173.48.116.247] x-microsoft-exchange-diagnostics: 1;BY1PR03MB1371;5:VcQsaXxIZzXT7kBmCbpw1KlRl2p8fh9YL5ufP4LH1lJIV8cv5n2tWu9prU/IVmN/Xwez/7uoKSNkm8NUTdbH1f3s69vebbScEYejAarlRgTQ2lhukkXhqol+Lvv0mtUc3sc1cDbMJPiVfQQzYxo4EQ==;24:BSaJfpPaMfkoyCvcGcGVqiImf68YRjeimXKStCloe92uqHXSzjmfRrH3xa9flqqlgVZ+IUlqb25hmmOf+qukvb9zawJSjP+Xyf/PGtpPnD8= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1371; x-ms-office365-filtering-correlation-id: 2c1f38e4-886e-4ca5-30d4-08d3186fc90c x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046)(61426038)(61427038);SRVR:BY1PR03MB1371;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1371; x-forefront-prvs: 0815F8251E x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(24454002)(199003)(377424004)(377454003)(189002)(164054003)(101416001)(122556002)(19580405001)(10090500001)(106116001)(19580395003)(40100003)(77096005)(5004730100002)(2421001)(66066001)(87936001)(8990500004)(106356001)(1096002)(33656002)(2561002)(3846002)(5008740100001)(2950100001)(50986999)(105586002)(586003)(81156007)(5002640100001)(102836003)(76176999)(5001770100001)(2900100001)(76576001)(1511001)(74316001)(5003600100002)(86362001)(99286002)(97736004)(10290500002)(5001960100002)(92566002)(2906002)(4326007)(1220700001)(6116002)(189998001)(54356999)(86612001)(5005710100001)(11100500001)(10400500002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1371;H:DM2PR0301MB0784.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2016 21:07:58.1265 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1371 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com] > Sent: Thursday, January 7, 2016 8:28 AM > To: Simon Xiao ; Eric Dumazet > > Cc: Tom Herbert ; netdev@vger.kernel.org; KY > Srinivasan ; Haiyang Zhang ; > devel@linuxdriverproject.org; linux-kernel@vger.kernel.org; David Miller > > Subject: Re: [PATCH net-next] hv_netvsc: don't make assumptions on > struct flow_keys layout > > Eric Dumazet writes: > > > On Thu, 2016-01-07 at 10:33 +0100, Vitaly Kuznetsov wrote: > >> Recent changes to 'struct flow_keys' (e.g commit d34af823ff40 ("net: > Add > >> VLAN ID to flow_keys")) introduced a performance regression in > netvsc > >> driver. Is problem is, however, not the above mentioned commit but > the > >> fact that netvsc_set_hash() function did some assumptions on the > struct > >> flow_keys data layout and this is wrong. We need to extract the data > we > >> need (src/dst addresses and ports) after the dissect. > >> > >> The issue could also be solved in a completely different way: as > suggested > >> by Eric instead of our own homegrown netvsc_set_hash() we could use > >> skb_get_hash() which does more or less the same. Unfortunately, the > >> testing done by Simon showed that Hyper-V hosts are not happy with > our > >> Jenkins hash, selecting the output queue with the current algorithm > based > >> on Toeplitz hash works significantly better. > > > > Were tests done on IPv6 traffic ? > > > > Simon, could you please test this patch for IPv6 and show us the numbers? > > > Toeplitz hash takes at least 100 ns to hash 12 bytes (one iteration > per > > bit : 96 iterations) > > > > For IPv6 it is 3 times this, since we have to hash 36 bytes. > > > > I do not see how it can compete with skb_get_hash() that directly > gives > > skb->hash for local TCP flows. > > > > My guess is that this is not the bottleneck, something is happening > behind the scene with out packets in Hyper-V host (e.g. re-distributing > them to hardware queues?) but I don't know the internals, Microsoft > folks could probably comment. The Hyper-V vRSS protocol lets us use the Toeplitz hash algorithm. We are currently running further tests, including IPv6 too, and will share the results when available. Thanks, - Haiyang