From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0107.outbound.protection.outlook.com [104.47.42.107]) by dpdk.org (Postfix) with ESMTP id D240A2C27 for ; Thu, 13 Apr 2017 09:52:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spirent1.onmicrosoft.com; s=selector1-spirent-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lrjZAIs4TXQk31tmxwovH1u59LXqQbi8BiYp5Uy4/dE=; b=g0TTs7UVyGz/RDPxrRY4+9OljzKP/Q7m4vqGUMWUf2vERAlnv8WQ0rd9shMtvY+cl9VF7vBAUw73pexoU9MEscuimDU8VFfnUXUEv5V8uSdcglt/5AosI+aRnVlgU5OumZwBdxfqpFQIy4yvrw4TLrZqfvO4ZHZbpqod3C91zAI= Received: from BY2PR1001MB1176.namprd10.prod.outlook.com (10.164.165.146) by BY2PR1001MB1176.namprd10.prod.outlook.com (10.164.165.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Thu, 13 Apr 2017 07:52:34 +0000 Received: from BY2PR1001MB1176.namprd10.prod.outlook.com ([10.164.165.146]) by BY2PR1001MB1176.namprd10.prod.outlook.com ([10.164.165.146]) with mapi id 15.01.1019.026; Thu, 13 Apr 2017 07:52:34 +0000 From: "Myers, Charles" To: "adrien.mazarguil@6wind.com" , "nelio.laranjeiro@6wind.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx4: fix rx not working after mbuf alloc failure Thread-Index: AQHStCm47pbyqxSMykqJAeL9wcUN2aHC680w Date: Thu, 13 Apr 2017 07:52:34 +0000 Message-ID: References: <1492069426-123358-1-git-send-email-Charles.Myers@spirent.com> In-Reply-To: <1492069426-123358-1-git-send-email-Charles.Myers@spirent.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=spirent.com; x-originating-ip: [74.87.49.203] x-microsoft-exchange-diagnostics: 1; BY2PR1001MB1176; 7:uLmJUcZBis5sOzc+SlumZoCpyfUK7ozgrdKH0afFooWiZn1M23E0pyDsZCOX9NnDB6x7oiXjoXgcgX9QXZG+Mkd/Gh/FL7t9A/m2Oc8DkEeS6SU2HEyCOQhLi/RnU7WFj9ofXdPkzzLodvtGCjsqv+1DAFXQHPURq2nQ2rY3IURwIBsBtg9iE6jcm87YVe5LxtwAQjjogUmKLPYBC5o0CKuodu6E/eus/6CXm4JVeKuLTjAqykULPNHDbLDUhINnFmVh4n9+2vLPBmHd+GSs+lRFxAgXKgBoE58LLr3zBeYqvbVTx/DV0fmxSP5UkQNH0WArWnXhxyETyf4XoZRXyw== x-ms-office365-filtering-correlation-id: 488d9992-9216-45ff-ed6e-08d482420c0a x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:BY2PR1001MB1176; 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)(93001095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(6072148); SRVR:BY2PR1001MB1176; BCL:0; PCL:0; RULEID:; SRVR:BY2PR1001MB1176; x-forefront-prvs: 02760F0D1C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39400400002)(39410400002)(39850400002)(39450400003)(81166006)(122556002)(305945005)(4326008)(3280700002)(77096006)(6506006)(2906002)(189998001)(38730400002)(74316002)(8936002)(2950100002)(25786009)(7736002)(53936002)(33656002)(86362001)(7696004)(9686003)(6436002)(8676002)(3660700001)(55016002)(99286003)(2501003)(5660300001)(102836003)(6116002)(2900100001)(3846002)(66066001)(50986999)(54356999)(76176999); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR1001MB1176; H:BY2PR1001MB1176.namprd10.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: spirent.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2017 07:52:34.5888 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: eb68cad0-6bd5-483f-a802-0f72f974373f X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR1001MB1176 X-Mailman-Approved-At: Thu, 13 Apr 2017 14:59:44 +0200 Subject: [dpdk-dev] [PATCH] net/mlx4: fix rx not working after mbuf alloc failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 07:52:37 -0000 I ran into an issue where the mlx4 driver stops receiving packets when mbuf= allocation fails in mlx4_rx_burst(). This issue appears to be caused because the code doesn't recycle the existi= ng mbuf to the sges array when mbuf allocation fails as is done in the code right above it which hand= les the (wc.status !=3D IBV_WC_SUCCESS) case. Copying the code from the above case before jumping to repost fixes the iss= ue for me. Signed-off-by: Charles Myers --- drivers/net/mlx4/mlx4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index aff915= 5..59d26fe 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -3169,6 +3169,9 @@ struct txq_mp2mr_mbuf_check_data { /* Increase out of memory counters. */ ++rxq->stats.rx_nombuf; ++rxq->priv->dev->data->rx_mbuf_alloc_failed; + + /* Add SGE to array for repost. */ + sges[i] =3D elt->sge; goto repost; } =20 -- 1.7.9.5