From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30087.outbound.protection.outlook.com [40.107.3.87]) by dpdk.org (Postfix) with ESMTP id 424511B63A for ; Thu, 2 Nov 2017 17:43:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=hpRzPSGMs/iobE6YZNr4pUnc+lqlQcaCBVC8IOUwV4w=; b=LVDDRnT+UdY9WS4ZDAopepGK/ffyg5ddABGqd4p9ugVkK7U9m0/qypjVMG1nCYgS0bwsqGd9FxzvlG3pUViRZ5scpcnSH6p3ABOv6j4/T+FoLcXi0NXyxbrAqnXBdnULm7OCDynkOpIQxWr9iXeAsgeYJNGKF+6OQcea09Ju5h0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0502MB3659.eurprd05.prod.outlook.com (2603:10a6:7:85::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Thu, 2 Nov 2017 16:43:14 +0000 From: Matan Azrad To: Adrien Mazarguil Cc: dev@dpdk.org, Ophir Munk Date: Thu, 2 Nov 2017 16:42:44 +0000 Message-Id: <1509640971-8637-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1509640971-8637-1-git-send-email-matan@mellanox.com> References: <1509358049-18854-1-git-send-email-matan@mellanox.com> <1509640971-8637-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0801CA0068.eurprd08.prod.outlook.com (2603:10a6:800:7d::12) To HE1PR0502MB3659.eurprd05.prod.outlook.com (2603:10a6:7:85::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bdeb10c4-4ec3-48e0-777b-08d52210d033 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603199); SRVR:HE1PR0502MB3659; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3659; 3:JsKho42vjPUatEQsoLt9YxT5i5bOOPnblPty8ceIpmuncIlEbDIJWQdxAHjB60RJQTlFMDFWAW1Grwl1WUklfGRPNQbvYtg5Xx3QiioEt8798qMEJzpneUNRHEjTjWiwUQEoZ+ctv1fd/W81Z7fDvgfqUMOe0wlkEn2H/KBV7saqujPQXFvBfmvPsWRdjHZ0t/9C2tN4MFO7lLBmer5epGipZtqja4f5J/RwTrih7n0hkEEfT73Fwo+u8Ma0JAfq; 25:Xi5ERpyc1jBjSEFLnGfmHcQdNNXCOpTeqO3bbXlqo69i5D/K/2CHlaC3XLvvP2BZ7veepFbW1/QABIbBPFPFWBPHaZQ7ONmfnxj3qqwteHd7N7Ao4C1OzvLYYhjmesUjujRu8LW88AMu5BbQh7+G/nYsAjfXiwNAUIFLyf1uGBYyG+OmZABDZpGTgSOsVird4j7XbqzxK9qwsL9ymww5C3riD0sUZGhnXhQlsc6O00M8iZ9S7PgGBopObDJ90qLpFNQLC7xj8kLciWq13/3EbgQl7ciCipgYRGCvu0OzELUibbOYzar7Ug9+1Hn+cywHBB1YtATb613M9PIup8X5eQ==; 31:fIHwLWuN0XXATo3zTR4F2TZqmpsV4vxhG8meSqYSCUXmK8keAnGJJxE21r2S5Nj0G03IYxWgaq8VsxnJ620383j9tmpJe+t/iswbNqc5S/Ox/TDqWjTfBbDNvj5iDOeXKLSVs/5LvPlP1G6KAgJWL6FYrnG5HBMjpOBu3Fn8BWsqWZT0kr3I3VZZLPydq4RIuuBjb2iQCzAvH+mwIEctHWyOQWMfuZ5p/6NMgesNpLs= X-MS-TrafficTypeDiagnostic: HE1PR0502MB3659: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3659; 20:++CviWMD3N3ZOEtUkB2PmCITbrIwVLDHI7OehZUYvUd4OaQixidR+TC6Vn37xMmB93bRrWrrqfnBsOUbAOdM/aatsjhrkKpu2kPv4CwsbMO3xNSy2XTyg8OkgUOEoJxt3ijbLQ0o1pbSrd95QJTRLcwqtYDbdUAXsfW+4A5PmCzEMQRAKbZTip9dmnM4lsKYtQEgCzllh6p/xyfw13nloPQQwmv1X6tAz/aG7nKwft2RLUgPeygb/AkwdCd3XF0ufaeZEfthBP1DCVLhpgstXppHCGOFj4O9L+0yrgPN8BVYS+C4TAW7DYFuo0URSemyL32ybcEMlMufGPgoa8Fqyry94kx+GR6nP9owIa4U1URheXQXQzT9kXAbWHMzrmMnDjLz/vxIWp6eevmJSEP66M8svqfdpgRKH2+hMBUniBHaoS+X8JcIEUOu57eXGPZEPXYOEF/Wi+nqpkQvpI/fTgzuxl23lMkDlSJaDyn1e3asdonzNLG4aClFk5P2n/lc; 4:e/C9GQ/WWZrSshtFrkpJGzZ73/lmrRuX1AYfuVG7hmaktiRPIThg+FhxkGyg1yrSku1EKhJS4/hbe+xDyO+LCU8hYke1xgfmUwTBigrY3jNk+H/DN4LoIU+hsW1ENLiCudzP+zRxAPPTfavVpaUa+hvSkhy9daWTc4ngpjW6mywoF5CCQRnCoDRwEQh589alV4/3/XN1+LRqVZ0SF+BJB7Z7+EI2AohlbD78bB7Os1S0CU7SLjazALV2sp09m7aLe7oBybnESXYa0CGNTErtNddedz8GfW/pdjJchXo3hAJk5Mx5Wu7tqeqCUeot2fm9 X-Exchange-Antispam-Report-Test: UriScan:(60795455431006); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3231020)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0502MB3659; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0502MB3659; X-Forefront-PRVS: 047999FF16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(189002)(199003)(16586007)(50226002)(316002)(106356001)(105586002)(101416001)(21086003)(25786009)(8936002)(478600001)(4720700003)(8676002)(81156014)(189998001)(36756003)(33026002)(81166006)(97736004)(4326008)(5003940100001)(2906002)(55016002)(68736007)(33646002)(5660300001)(305945005)(107886003)(7736002)(50466002)(53936002)(48376002)(66066001)(16526018)(2950100002)(6916009)(6666003)(50986999)(47776003)(76176999)(3846002)(86362001)(69596002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0502MB3659; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0502MB3659; 23:CtQwXrVIMgytngPXrqBzFEELg3XnhiQPHpZtVpw?= =?us-ascii?Q?yDBOn7wtL72+4RpinFif9RJt0Ju61m24x6sru/bNfD/bzJZW0AKT3SfqDCsn?= =?us-ascii?Q?mEAOLZnNSMbkJ+xNDfqq8I5k1hnOYhQdaJs0R5bwwVR4flMZP+2M95XZhTwb?= =?us-ascii?Q?4P0qxFtuIQRpgYO0NKDrdWlPX5dzej0tN9ZArrwwh0FbuuUTDXRpnxV28dmD?= =?us-ascii?Q?T/n5k5CcCH2AlX4XXI+mdWFhxF6pYQgPFYYaI4qtNe8x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pcCQlI32KP+36ty3sKjZsnUK0NImo+x2rBsQZlw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3659; 6:p5tmyvWplWXNzmlwUl8GoEWiR9qnlCQhUt3jj725bPEABN+R6E7nGv941TLo9wRMeZNG2d5DD7AaTduHVFB96JsQA+mgFQddzNnHMyd4WNqekuEHm4RMek0sJXY85HvWHdhrDXiLuZWj0jiyOFGwIRJvNaoi4WcjG61EzLxJs0B4/QsHlfu9Dzft9qlZ2TtRXbjDVXdfPkMg3v4KwQ6pihEO7BcQdjRqO0J6qgjHqQevhV5iMYVlN2fCKGruzYVe0oILrKLeGcADktpdIFGYiTcT0B4ImlwGaY6Kk+rf78F0gAI21mGq/BhcTcmYgIAQrVcZ07E5NfcVt242HYFxk6TCqwwhIIEnP9j6NjChHi4=; 5:wPthHWbflZJEvokHeRL1zuCbOmEJUARredQBDV5QSRTrjG+uv4vK0d7PIckiBqOrpr49rfbGRnORM1uClYjSQQ7mlnCNKTzHapa6icCtAGgyKu9e4c3FYYaTRqrpHayPYRfu13QkkHITkXQ62YZ7Jjfo9T8zQyT45ikl89Hlv+k=; 24:dyp6zbq6zXnvr6Ew1lGlyUSq8unhbm625djvoKRBhDCRgJN192HUhbo21NTrp//8pB2uzOfDHINJyP1pUytKtFtKtJgD+gPp+bre7GwYm2E=; 7:DJaUnQ5HdyRZdHJ+txoMy40znoTO2OEUmwA0V84mJdmmua7azQ50UiDVhNDfO+In0H8cGoazKwIRd7rRkgDbKz7u659KSQrh0Hkti1ZZp2xkvNwMCr7ttqOQ01dTfZUnWBkkmvb3nIqN0y1lU7OuH+Q8pN5l0qHQy8he+VIqGEhPOf6naUfSH7sOBQYN50dKFFseyNotJpn9WnY/IOT5zuMTkOA13vyWC6meifKDhoIwRGp04QPKZgKX0jP76gLQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2017 16:43:14.2991 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bdeb10c4-4ec3-48e0-777b-08d52210d033 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3659 Subject: [dpdk-dev] [PATCH v5 1/8] net/mlx4: remove error flows from Tx fast path 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, 02 Nov 2017 16:43:16 -0000 Move unnecessary error flows to DEBUG mode. Signed-off-by: Matan Azrad Acked-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4_rxtx.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c index 67dc712..79c7fa2 100644 --- a/drivers/net/mlx4/mlx4_rxtx.c +++ b/drivers/net/mlx4/mlx4_rxtx.c @@ -169,6 +169,7 @@ struct pv { * Make sure we read the CQE after we read the ownership bit. */ rte_rmb(); +#ifndef NDEBUG if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_CQE_OPCODE_ERROR)) { struct mlx4_err_cqe *cqe_err = @@ -178,6 +179,7 @@ struct pv { (void *)txq, cqe_err->vendor_err, cqe_err->syndrome); } +#endif /* NDEBUG */ /* Get WQE index reported in the CQE. */ new_index = rte_be_to_cpu_16(cqe->wqe_index) & sq->txbb_cnt_mask; @@ -302,7 +304,7 @@ struct pv { * Packet to transmit. * * @return - * 0 on success, negative errno value otherwise and rte_errno is set. + * 0 on success, negative errno value otherwise. */ static inline int mlx4_post_send(struct txq *txq, struct rte_mbuf *pkt) @@ -322,7 +324,6 @@ struct pv { uint32_t byte_count; int wqe_real_size; int nr_txbbs; - int rc; struct pv *pv = (struct pv *)txq->bounce_buf; int pv_counter = 0; @@ -337,8 +338,7 @@ struct pv { if (((sq->head - sq->tail) + nr_txbbs + sq->headroom_txbbs) >= sq->txbb_cnt || nr_txbbs > MLX4_MAX_WQE_TXBBS) { - rc = ENOSPC; - goto err; + return -ENOSPC; } /* Get the control and data entries of the WQE. */ ctrl = (struct mlx4_wqe_ctrl_seg *)mlx4_get_send_wqe(sq, head_idx); @@ -354,6 +354,7 @@ struct pv { dseg->addr = rte_cpu_to_be_64(addr); /* Memory region key for this memory pool. */ lkey = mlx4_txq_mp2mr(txq, mlx4_txq_mb2mp(buf)); +#ifndef NDEBUG if (unlikely(lkey == (uint32_t)-1)) { /* MR does not exist. */ DEBUG("%p: unable to get MP <-> MR association", @@ -366,9 +367,9 @@ struct pv { ctrl->fence_size = (wqe_real_size >> 4) & 0x3f; mlx4_txq_stamp_freed_wqe(sq, head_idx, (sq->head & sq->txbb_cnt) ? 0 : 1); - rc = EFAULT; - goto err; + return -EFAULT; } +#endif /* NDEBUG */ dseg->lkey = rte_cpu_to_be_32(lkey); if (likely(buf->data_len)) { byte_count = rte_cpu_to_be_32(buf->data_len); @@ -471,9 +472,6 @@ struct pv { MLX4_BIT_WQE_OWN : 0)); sq->head += nr_txbbs; return 0; -err: - rte_errno = rc; - return -rc; } /** -- 1.8.3.1