From patchwork Mon Jun 19 13:53:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ganesh Goudar X-Patchwork-Id: 777778 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wrssD54d3z9s8F for ; Mon, 19 Jun 2017 23:54:08 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chelsious.onmicrosoft.com header.i=@chelsious.onmicrosoft.com header.b="p9W9SO8q"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751053AbdFSNyG (ORCPT ); Mon, 19 Jun 2017 09:54:06 -0400 Received: from mail-bl2nam02on0090.outbound.protection.outlook.com ([104.47.38.90]:49664 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751012AbdFSNyF (ORCPT ); Mon, 19 Jun 2017 09:54:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chelsious.onmicrosoft.com; s=selector1-chelsio-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GNQZmGMHq00VeYZGVp481WeJ+2NevydZ+ZeGmXBcKJ8=; b=p9W9SO8qFATJ7U0W1ZbNvc1RW4SAlGOc4FBOju84YoqRlNhb10ljl5L80DBAkSHZO8qluF0gVytf4aEVyARX1uXf6S9nV/2ncwuiuiR6D5XUVeYCi7nEH+FjzYSuytkCGa1gt6i8hcq1hkhOjMn/3Qu7jn2VH3zejau3ReULSPw= Received: from CY4PR12MB1432.namprd12.prod.outlook.com (10.168.170.139) by CY4PR12MB1797.namprd12.prod.outlook.com (10.175.63.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Mon, 19 Jun 2017 13:53:53 +0000 Received: from CY4PR12MB1432.namprd12.prod.outlook.com ([10.168.170.139]) by CY4PR12MB1432.namprd12.prod.outlook.com ([10.168.170.139]) with mapi id 15.01.1178.018; Mon, 19 Jun 2017 13:53:51 +0000 From: Ganesh GR To: "netdev@vger.kernel.org" , "davem@davemloft.net" CC: Nirranjan Kirubaharan , Indranil Choudhury , Venkatesh Pottem , "Raju Rangoju" , Stable Subject: Re: [PATCH net-next] cxgb4: notify uP to route ctrlq compl to rdma rspq Thread-Topic: [PATCH net-next] cxgb4: notify uP to route ctrlq compl to rdma rspq Thread-Index: AQHS6PU1YsJuOvxXt0mJjCUV3zangqIsMwtJ Date: Mon, 19 Jun 2017 13:53:51 +0000 Message-ID: References: <1497874248-9716-1-git-send-email-ganeshgr@chelsio.com> In-Reply-To: <1497874248-9716-1-git-send-email-ganeshgr@chelsio.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: chelsio.com; dkim=none (message not signed) header.d=none; chelsio.com; dmarc=none action=none header.from=chelsio.com; x-originating-ip: [103.227.97.128] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR12MB1797; 7:p052hJMAkrgzB7aFewoC/F5l9oMYRVBYskdGydNiVqfKWPJ0QQcr9aH9S5BcrBSqPr7Z64bnq/vJ7hu58rSHwvAb6h0pV430YVk8hErPXSveppK/rVDIICLudXrAuozTqR4sBcz55fqOwN0KA0SfGyJMJ8leRdYcxNyrPU4ASRBJhr6+A0fPBbaq8VOSS/i0Ac8p2qfHnhiOmkoLN56NR23N2oP9LSoX1o8NzeLtnRssIdm7yWDaEXvMhiVakh3+s5psIQZoYkkuvW3gZR1sTSSb2hdkYoDclQhjDW90XASY9OAfenwIo28XrQLQP/gO9zrNrvSuzhr3CoIUK4/DmwZ+Qa433uFPPOQr9PNWHKozfUZYV7U0+sYgvG6fc8jS0Ct1NsO/Bk1UVKcqSEvjUMFcUfqqudwG48dXcMri6DoS/GqPBmFZR3lTbGZgODosTc7OXBKwZcKoiauj0s9R/BTWByPOOgpnHBu/h45tLmJiFjbYHA3UxbErZmRiD9uvsN6j2WLmdBqylIdXd+hKqJ4FvbW2VkRqvnDSv2C7wum6HZk66rs0pfjZcVMBO4I2uh+ms8/LVrjjXfArgHMGy4WAwukaAY38WHvsvvHIHOilNmoahbU++wOBGX23NOxqaPjmdnkVw/GfDI2lTXTg7O/HgXYvKVXYh5zkkMiusy+EmJihcJHtwUztuNFZ+qYkcikHq3Sgdw1FDuNEPSYoGA2+G8pERqIBnyDVdWe0OljGhyQMZzPz6meuBlQOk23vvAndyx0/meJhbh89cC6KTkOuxlx/8apTDOwOanoeHiM= x-forefront-antispam-report: SFV:SKI; SCL:-1SFV:NSPM; SFS:(10019020)(6009001)(39400400002)(39840400002)(39450400003)(39410400002)(377454003)(2501003)(74316002)(7736002)(2950100002)(14454004)(53546009)(2900100001)(25786009)(189998001)(478600001)(229853002)(2906002)(3846002)(6116002)(102836003)(4326008)(54356999)(76176999)(50986999)(3660700001)(66066001)(3280700002)(8676002)(81166006)(53936002)(7696004)(5660300001)(9686003)(38730400002)(99286003)(55016002)(54906002)(8936002)(6506006)(122556002)(33656002)(77096006)(305945005)(6436002)(6246003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR12MB1797; H:CY4PR12MB1432.namprd12.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; x-ms-office365-filtering-correlation-id: ddb4c1a1-f0a7-42b9-0279-08d4b71a9e54 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075); SRVR:CY4PR12MB1797; x-ms-traffictypediagnostic: CY4PR12MB1797: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123558100)(20161123564025)(2016111802025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6043046)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1797; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1797; x-forefront-prvs: 0343AC1D30 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: chelsio.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jun 2017 13:53:51.6748 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 065db76d-a7ae-4c60-b78a-501e8fc17095 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1797 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch is supposed to go to net tree, I will send a v2. From: Ganesh Goudar Sent: Monday, June 19, 2017 5:40 PM To: netdev@vger.kernel.org; davem@davemloft.net Cc: Nirranjan Kirubaharan; Indranil Choudhury; Venkatesh Pottem; Raju Rangoju; Stable; Ganesh GR Subject: [PATCH net-next] cxgb4: notify uP to route ctrlq compl to rdma rspq   From: Raju Rangoju During the module initialisation there is a possible race (basically race between uld and lld) where neither the uld nor lld notifies the uP about where to route the ctrl queue completions. LLD skips notifying uP as the rdma queues were not created by then (will leave it to ULD to notify the uP). As the ULD comes up, it also skips notifying the uP as the flag FULL_INIT_DONE is not set yet (ULD assumes that the interface is not up yet). Consequently, this race between uld and lld leaves uP unnotified about where to send the ctrl queue completions to, leading to iwarp RI_RES WR failure. Here is the race: CPU 0                                   CPU1 - allocates nic rx queus - t4_sge_alloc_ctrl_txq() (if rdma rsp queues exists, tell uP to route ctrl queue compl to rdma rspq)                                 - acquires the mutex_lock                                 - allocates rdma response queues                                 - if FULL_INIT_DONE set,                                   tell uP to route ctrl queue compl                                   to rdma rspq                                 - relinquishes mutex_lock - acquires the mutex_lock - enable_rx() - set FULL_INIT_DONE - relinquishes mutex_lock This patch fixes the above issue. Fixes: e7519f9926f1('cxgb4: avoid enabling napi twice to the same queue') Signed-off-by: Raju Rangoju Acked-by: Steve Wise CC: Stable # 4.9+ Signed-off-by: Ganesh Goudar ---  drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 10 ++++++----  1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index ea1bfcf..53309f6 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -2171,9 +2171,10 @@ static int cxgb_up(struct adapter *adap)  {          int err;   +       mutex_lock(&uld_mutex);          err = setup_sge_queues(adap);          if (err) -               goto out; +               goto rel_lock;          err = setup_rss(adap);          if (err)                  goto freeq; @@ -2197,7 +2198,6 @@ static int cxgb_up(struct adapter *adap)                          goto irq_err;          }   -       mutex_lock(&uld_mutex);          enable_rx(adap);          t4_sge_start(adap);          t4_intr_enable(adap); @@ -2210,13 +2210,15 @@ static int cxgb_up(struct adapter *adap)  #endif          /* Initialize hash mac addr list*/          INIT_LIST_HEAD(&adap->mac_hlist); - out:          return err; +   irq_err:          dev_err(adap->pdev_dev, "request_irq failed, err %d\n", err);   freeq:          t4_free_sge_resources(adap); -       goto out; + rel_lock: +       mutex_unlock(&uld_mutex); +       return err;  }    static void cxgb_down(struct adapter *adapter)