From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0070.outbound.protection.outlook.com [104.47.32.70]) by dpdk.org (Postfix) with ESMTP id EC2EA5942; Mon, 1 May 2017 20:42:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BLbXnvu6xYt/TP+1k2TA/hQR85LjHl3H8ehEVeYgRaY=; b=k6YqKnrCCSxMS7h1Lm8AD5drb//3BvlnIezRzZ7GL+QMvoHym/L7VcNZsTLZFcEOnVtlGn9nS4KnjUq6lLYocbKCnsh7PQZmEwYD6/DMvim7tvsudPXGT3d/1KfAnA1v8g3XyiQcxCCbzlFTs92TL6WR2YgIOF3dH98TYjc78AQ= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.domain.name (171.76.125.157) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Mon, 1 May 2017 18:42:08 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, maciej.czekaj@caviumnetworks.com, Jerin Jacob , stable@dpdk.org Date: Tue, 2 May 2017 00:11:55 +0530 Message-Id: <20170501184155.27305-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.76.125.157] X-ClientProxiedBy: BN6PR1301CA0002.namprd13.prod.outlook.com (10.174.84.143) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c79e56fe-0c8e-4ed1-e187-08d490c1c755 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:jjyJ7729bkkDdQ5TIz2DCE85Iap8LBOc/c9w1WAMsNoC4Pw5j2OrL3ksN0gA5P3oIyhBlTPnZuoBaitWSZOSr5UbrG8mXEj033VzKRz5C9MX3HjpITijvUGJcJMaCXAybDiwNaFgQY6WWVaDFygaQwTPsEz3jajcTZduZ6NOcGIJv7JvUQZQLl2CRdu2mmWe84XHwcGnws9OqHShhr+H40RwWxXuB6OMm3YmYz+2eMp1lMI5T+odKExFOWwg3bbYtT/ah2NPryPSZA+hdFK3z7OkYWToTubWtdscb2cZLFjPY+y3PpDZakJfDHExmyqAi5y1E/rJ3AhPpPqvFkQZNg==; 25:qqlS/qrCTweEX8N6c7JCVA9tkwIxC+QX+R6lZ2AAeHGmO0K+UKVZ9UgCpXp7vwADp4IIaGxckOyJy+JUJXejRxKpnnFnyRTQpBLXedB7MUSwfd+Cc+7lufn7Favd4VUfciI2QYyLS7AtFIlnw/dsVq65GZvUZylsYpVFGYG1JDeiKZHGfUo6lnITDYRcfh7Dt2zTHKcJmyCxoAdPsv7Y5EShr+361Q88ud+LDCPxbPoFFk3WCsyrS5SaeSC9M9gqnxbPDuvckP9YwDRkbedt3AhGPqGe+AEzOW379zDgMyp6lRUvSEcwKvjkzJvXC2paOvxYaNVCtnBQUyYtksk8S3sw2lSpnnHTKUcNrOwrbnqajIPF6AYh5RYkI4HyUe0I0t3QwX5+2mTLXkOW4Ex3XqNV0jV4YvluunDWUYy2NbcGPkyrIDQm9ALq9xQf64cFvnYaZ3TURQqTQ7nEaJxhTw== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:Z7mRbjz2QMlfGnSpsBD/d3ImtV6/RN7YnMuEMBtVmLIABGzD9fcK0nQJ8h8Vnw5MXHqIyk/Jcyw9tpaQ7E1ZQyMn5tIG6rytS1DuduVnuVJxRispR34i+3M+JYoAfrDEgRQ+3eVAo5OgNKbJqNa1y7ntw3DtLt8METyiZRiPrzBdC56xaRD39Rzy2n5v85ZIEp9+p8mfLAmm+RzR/2q7FQfsKC7D4+E+pjXgg4c0XWaY3i0+SJ2eflt4Za0z4Mwr; 20:dOW6A05OZFVMAEf7G57d7/jsn3AKC3rWQTJNtOmOy5Uq2f/upIl4Ws256rKotZnUTNj/RjQqoVbEWEB6Q7FS0C4aSx+amIbJT2ZRE4mYy9EzzouF5NgpHrNpwba+ft7m3qvOCioPGm1dK2G8glqCaQfhdzvJhsG0/gzjAhk2kzeVfeDoYRsrjUyU4MtklBFCjaK1fnHcM+viba7nUYb1g0+VgPdgkFKQOq7cKlqwlONyfXLyrrtoPaBCOUzeUUwyq77H40LncDsvjc9OopcQULh40SeR+yLmLuGZe+QwnvwMrsbBB9gQoCq3fvtJKOErVm/Ojn8HOBABZcwkm/11tOycoA2Sd7rqzYv2ovkUSmddcAImVRNBF6MQzLHIO6UIUD073+u9oNL5qzW529OS7gZpK1FJA1GYG+mRBVwdi/bpHatEFKB8VsuCbtFBtHQWmO4vxTlbsLIMWiLK7M3QdcSi1vv6WMiVmrJ2l1ts0NIPUNdyhgAskbkrzFNLU+8yQJk76UqpeAAK64xqTfDMOp1Cec9Hl2ebQxzwljI1QG8PPjmSoPgkHcebpsnSZFXBlti+Cit3IA5GHhalMhWZGZ6P3qggHDRU3o2QfnASLHk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(6041248)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123555025)(6072148); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:UH4y94ckbI3z094wTYvx01GSoOYwlWo8uYSlZI6/Z7lrKHp9GQ2WH13ep4Ke2SOwzse9PeFZW0Q0HEcmbQvJYiPZHrQfcJiXe4W/gZq0qXdHrCmqD6Gv4Wf7eoFT+m0LJI+T3hqE7q/y6B2mCgt2zrKAvV8eW0gv7YWSSxGBy5eJN08u1NVgTsUnvW43OGUah+BzP9a0bmu17OXP4S8SWuGgKBeH6uJoQMOwm96T3Y/SGFJ0JXhaYTTzKIEvgzKFj71ci50IRDhnn1CFizveYjSnpE9DWrx//bcX+ePmz1/8oCHAcxO37ir19SYPgJzuHMZC75eXJkfhmtnsfn6TWdK8wkdJTs3vdMlLahWH1JwvnQPkTIQrDZcHbQxUMCd39N1r4yesBWyVZIQGUmK8Ff6GdxQTT8V0xo+czlE2vo6mw5ej0VT8chjWwrKrw5vvat2LhJlF5e9hUZKQWdF24frIv6o+PPbYQaKB6am7cEK1bosZW2NfUYwOPDSRqQhRkkYqD8z2Abp1k6tDd5GBcTHZRWPqOU0G1NMon21jW4IFIvr+D5ydJUqk+7C1ABny2w01y76N8+yRee3dZi3tIc98IQRNHErwQEygnzPp6PCc4mGy4FFrphDOa43Bu4U0OA4CvYLrQYdN7N+xHfWhaMNqYOLOIg+Hs5Yb7mI3RINLVHxg3xH9sC5OYZnVRYjDqXjuXpRhnCf+NP+dnsGZKNqXPQXiz1nGi14Lq2e1P6vuYW28Z+YAKlALsJtlLiQFtdLikeagmI4SAdAKldZyIQ== X-Forefront-PRVS: 02945962BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39400400002)(39840400002)(39850400002)(7736002)(575784001)(6116002)(3846002)(50986999)(1076002)(189998001)(5660300001)(305945005)(50466002)(47776003)(4326008)(36756003)(25786009)(48376002)(2351001)(2361001)(33646002)(2906002)(53416004)(42186005)(478600001)(38730400002)(110136004)(53936002)(50226002)(6506006)(6486002)(8676002)(6512007)(81166006)(6916009)(6666003)(42882006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1723; 23:Pso9c0fO8NWc0WrQVH4XL5UD04xLpY6fDEWKeMu?= =?us-ascii?Q?WKoqnChLNACTG/fhl2HDZXEHfvbnIsiOehKhqHvf6bRQ31ISa8D+EupNrelZ?= =?us-ascii?Q?aeqyB/G1jNcr1plC01MAneCGNA6ftEG8Gky0fvrdToz9OZzcYo/rHfjtC1i0?= =?us-ascii?Q?+Lvmhbl3gcAZqgeqTbxWhwO61dFQk89ZQpH8w+4O1zw+w6vlr1HEJr9aZqJF?= =?us-ascii?Q?6IhSL2EO9bkz6r7HOa1tTHzPTg2awNpRj3eCHj7SC6MomXqEFctPY/VYyIUt?= =?us-ascii?Q?E+pH6VrmfTbw+BkqBNwexDq0SI/qvN/rX7nihCtQP+pmkEPxdlOHb/gjbEOU?= =?us-ascii?Q?togzsbW/qrnw5QnWAGglqu2VReN1ru8+eB9dbScpYAENfuvc2YmN5HSZ3Aqh?= =?us-ascii?Q?i/0ODJqW9w0NegS61mrUXlmAfG1CtFU38Qt0m1ySvMjFu9H7H3dMPK24F2ER?= =?us-ascii?Q?UGM6U6pK48dNFGUmLChH8LJebAgy26BEDM0z9JbFqBNc/5ehNy5BEvyKh0Pd?= =?us-ascii?Q?+l/Dr9u0VgyDy4lXOP+pzsaapNRcVMUNtHEe08uxv/2tuE/1YRu5/Uhxb/qi?= =?us-ascii?Q?ZaodItqVzCFqFv/lVcXVCpvNUl4XNqG+7vXtzTe6K4S94+rX2JQ2iURqcvUg?= =?us-ascii?Q?O4tQ72Bz85Z+1jcrPnDC11P9wxd0Kn7gsg6/9gRbRYBZ5ZjqUilYYc5Yl5pY?= =?us-ascii?Q?OGt3HLgwNSvSmL0yb3UE3r94NSUndr49DcQQTdayQ9SgkJ281TvuU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fGiD7Jo4+p/InnlsyVEytNAkS+rvh4f8XtLy4+OTq+OECpzj+w=; 24:qg97MSPdGgXaBrhNNKgm7aHm4/5JcX7P5UTpj8sv8DUA1F7Od5tV+vVzfdBHT8l9uu2T4VLhtrs91eYW7nbMkRSpiAOqgZEXqyxhtAWBVi8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:QShmW0v8fTAmmDSrKqWSMXxxZCqOxmXSthPsV6RTZrBB7XNskPBMufkW+kkkLlGVGeLpQ7VaYEo75sNgGGRXI+X+bEhsy2FBpbANbsO0PKpwV2sxT1RiSwWOlZJnnCi9fbjuvBQa5j8G//7VzNDil93sXMvZ02jDaqOnBP6HYHI9z7NKDsdxCf87gB+EugCKwbC2SmdKYDbjytu1O2JsZQ7P1Z+E7l4IKg/fhU/Yw8opbq1puk+CVW2YvLUKtrrgo+h3D5Sp0ECbuzDvRvj5hEY1VoGP1hgTQkCYcS5GWBk6qWbvzgOfh00Z6YdHB/2z4RJxlv1mwOcGULxcV7Jn2g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2017 18:42:08.0963 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-stable] [dpdk-dev] [PATCH] net/thunderx: fix deadlock in Rx path X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 18:42:13 -0000 RBDR buffers are refilled when SW consumes the buffers from CQ. This creates deadlock case when CQ buffers exhausted due to lack of RBDR buffers. Fix is to refill the RBDR when rx_free_thresh meet, irrespective of the number of CQ buffers consumed. Fixes: e2d7fc9f0a24 ("net/thunderx: add single and multi-segment Rx") Cc: stable@dpdk.org Signed-off-by: Jerin Jacob --- drivers/net/thunderx/nicvf_rxtx.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c index 003ab0693..6cae8341b 100644 --- a/drivers/net/thunderx/nicvf_rxtx.c +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -464,11 +464,10 @@ nicvf_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxq->head = cqe_head; nicvf_addr_write(rxq->cq_door, to_process); rxq->recv_buffers += to_process; - if (rxq->recv_buffers > rxq->rx_free_thresh) { - rxq->recv_buffers -= nicvf_fill_rbdr(rxq, - rxq->rx_free_thresh); - NICVF_RX_ASSERT(rxq->recv_buffers >= 0); - } + } + if (rxq->recv_buffers > rxq->rx_free_thresh) { + rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); + NICVF_RX_ASSERT(rxq->recv_buffers >= 0); } return to_process; @@ -555,11 +554,10 @@ nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts, rxq->head = cqe_head; nicvf_addr_write(rxq->cq_door, to_process); rxq->recv_buffers += buffers_consumed; - if (rxq->recv_buffers > rxq->rx_free_thresh) { - rxq->recv_buffers -= - nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); - NICVF_RX_ASSERT(rxq->recv_buffers >= 0); - } + } + if (rxq->recv_buffers > rxq->rx_free_thresh) { + rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh); + NICVF_RX_ASSERT(rxq->recv_buffers >= 0); } return to_process; -- 2.12.2