From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754974AbdDLQYp (ORCPT ); Wed, 12 Apr 2017 12:24:45 -0400 Received: from mail-cys01nam02on0100.outbound.protection.outlook.com ([104.47.37.100]:59744 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754946AbdDLQYk (ORCPT ); Wed, 12 Apr 2017 12:24:40 -0400 From: Haiyang Zhang To: David Miller CC: "netdev@vger.kernel.org" , KY Srinivasan , "olaf@aepfle.de" , "vkuznets@redhat.com" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH net-next,1/3] hv_netvsc: Use per socket hash when available Thread-Topic: [PATCH net-next,1/3] hv_netvsc: Use per socket hash when available Thread-Index: AQHSsMv1oEuUollVS0quV6hygdcp6qHBAu+AgADiBuA= Date: Wed, 12 Apr 2017 16:24:36 +0000 Message-ID: References: <1491699241-9944-1-git-send-email-haiyangz@exchange.microsoft.com> <20170411.221241.2175639910931847215.davem@davemloft.net> In-Reply-To: <20170411.221241.2175639910931847215.davem@davemloft.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [69.128.199.77] x-microsoft-exchange-diagnostics: 1;BN6PR03MB2483;7:ZmalHnhiKy+S7jBA9PsB2PgW0/ouN1mr10gQ2RCAtXP7JoSEuPIzvp852OWfCHTeutR9p/lUE8z9OVCiP51qkYOSzCVNlEnhFnERgCE63HE71sxRud2m1k4r82LbzjbFAhRw7pF5iKFIm00Tcr6R2BadgNBe8WY65YRRcVvl6i3xlKXNoVrDrgetyJkn/Do2zFuj2VgMfpGcZ8X1elWkGhtpe/kaUMMcR1e8Ws0MV7wNkt3vQbeFdbzgjDbhl8oc1Q45aEyOpzYPRvFirVEBTgZV8uYgVYODPSEPz71CTUjZ9cvyw8O57XA1JZ/7PnDnbsKlLGMwuPfOHw0OYT0LqPA5WJkgCxvPxhkDtO6g6OE= x-ms-office365-filtering-correlation-id: fa63cc55-700f-4d10-ec00-08d481c0693a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:BN6PR03MB2483; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(140211028294663); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(6072148);SRVR:BN6PR03MB2483;BCL:0;PCL:0;RULEID:;SRVR:BN6PR03MB2483; x-forefront-prvs: 027578BB13 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39410400002)(39850400002)(39400400002)(39860400002)(39450400003)(39840400002)(377454003)(13464003)(3280700002)(54906002)(66066001)(33656002)(6436002)(229853002)(53936002)(74316002)(2906002)(7736002)(6246003)(99286003)(54356999)(25786009)(55016002)(53546009)(189998001)(10290500002)(122556002)(5005710100001)(4326008)(76176999)(5660300001)(50986999)(6916009)(7696004)(305945005)(2900100001)(3846002)(110136004)(102836003)(86612001)(38730400002)(86362001)(6116002)(8676002)(8936002)(6506006)(3660700001)(81166006)(77096006)(10090500001)(9686003)(2950100002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR03MB2483;H:BLUPR03MB1412.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2017 16:24:36.4184 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2483 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3CGOtib031919 > -----Original Message----- > From: David Miller [mailto:davem@davemloft.net] > Sent: Tuesday, April 11, 2017 10:13 PM > To: Haiyang Zhang ; Haiyang Zhang > > Cc: netdev@vger.kernel.org; KY Srinivasan ; > olaf@aepfle.de; vkuznets@redhat.com; linux-kernel@vger.kernel.org > Subject: Re: [PATCH net-next,1/3] hv_netvsc: Use per socket hash when > available > > From: Haiyang Zhang > Date: Sat, 8 Apr 2017 17:53:59 -0700 > > > diff --git a/drivers/net/hyperv/netvsc_drv.c > b/drivers/net/hyperv/netvsc_drv.c > > index f24c289..0a129cb 100644 > > --- a/drivers/net/hyperv/netvsc_drv.c > > +++ b/drivers/net/hyperv/netvsc_drv.c > > @@ -211,9 +211,14 @@ static u16 netvsc_select_queue(struct net_device > *ndev, struct sk_buff *skb, > > int q_idx = sk_tx_queue_get(sk); > > > > if (q_idx < 0 || skb->ooo_okay || q_idx >= num_tx_queues) { > > - u16 hash = __skb_tx_hash(ndev, skb, VRSS_SEND_TAB_SIZE); > > + u16 hash; > > int new_idx; > > > > + if (sk) > > + skb_set_hash_from_sk(skb, sk); > > + > > + hash = __skb_tx_hash(ndev, skb, VRSS_SEND_TAB_SIZE); > > Please do not do this. > > TCP performs this operation for you for every pack it emits. > > And also every socket family that uses skb_set_owner_w() either > directly or indirectly gets this done as well. > > I do not want to see drivers start to get peppered with calls to this > thing. > > Explain the case which is missing that matters, and we can address > that instead. > > Thanks. Thanks for pointing this out. I did some tests, the skb->hash is indeed set to the sk->sk_txhash by upper layer. I will remove this patch, and re-submit other patches. Thanks, - Haiyang