From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0065.outbound.protection.outlook.com [104.47.0.65]) by dpdk.org (Postfix) with ESMTP id A42C11B25E for ; Tue, 31 Oct 2017 19:21:55 +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=V2sOFsESdf7pKxjxlUR5Pi/IL0Ov1q2yzfdlpfDv2nHMwJfI6S1D6+ktxsDiypgYuStxqvJipkiywO1Mec7ZBbIQKFCbkNgyP2KZlvutzTCDNt/8vAtHxCJ4vanHmI7sfhCEXf8RVQKIV6g2Uas/ILdsxomiRwdOi7BYVwXwWic= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR0502MB3664.eurprd05.prod.outlook.com (2603:10a6:803:f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Tue, 31 Oct 2017 18:21:53 +0000 From: Matan Azrad To: Adrien Mazarguil Cc: dev@dpdk.org, Ophir Munk Date: Tue, 31 Oct 2017 18:21:26 +0000 Message-Id: <1509474093-31388-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1509474093-31388-1-git-send-email-matan@mellanox.com> References: <1509358049-18854-1-git-send-email-matan@mellanox.com> <1509474093-31388-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0801CA0074.eurprd08.prod.outlook.com (2603:10a6:800:7d::18) To VI1PR0502MB3664.eurprd05.prod.outlook.com (2603:10a6:803:f::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 795e87e5-492d-428a-ffd9-08d5208c436d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(2017052603199); SRVR:VI1PR0502MB3664; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3664; 3:PccfMgBBs/hIiYiKbNGzC7BOAzCVcVuL1bCuklAq0P2uYzRYRQN9ymQUzJ/Bzy87hJ38ruZcK1HG1nZYIoSb1UdIw3o9lu7SdSnbQ3A+mjcFZiArFvztU2AGZH1gLGt7mN4A+jZMt5VRRrFKKUD+wkqIrEW36yUpK+TwWYAMTITS7m5+Rkybj2nyemMg+S2Kdabdw/cdhboqB5xUm6NisWQv0KYY7K/EZ42UjIQYod01hZ073NvYZvVf/mzZ+a7V; 25:Us2cUyQrcdzJb5lLZEwCU0zX1y619K4H6MoCEeKiM4RV2WJOUtbHYRE81sgXtHEjowXVHnV53/RikYtbCWi5IMdDZfo6bIRe8gQG+NpMeMQHHO63G5lMfGBaR3PGParzIipl/9DcZxaSV1VZPxFpIfdep1GwhGdZPFxC61cVNJmunllrP8Qm1BijPtQ5GK3GrIFh9MhrmY17Vd83Zv/8OCgZWSMFJV/O81WMkPIViktpZ8HCr6mKT++jOyKoooU+nD3w3QLmgkL3PuLuy2+8u41CSvifm3GXPVClYTUpy8NFe9aksGVSjw94yPCNhen30WtPgXW0Kao81n/z73Rkgg==; 31:bpQpzyoT99RySMKqb2LKTnfBLaJ5o7UwpUt1Kb1+Nn8E5KIrRmM7a17bxPg3FbG6DgiMmjO9JteqSdeb3LdMuksNChBiBmWHu/F9CWVuQvUOan5+jKloFIUigt/4C1Myy+cVJrK04oQl73Eg/tdeXJ9jBIHQbIvmbGDI0yp7SPsIz3yPVSXTV/n7ssqrMzQyyciQkU4FD8rHu0xxZcMGRzOcka5iNe0QRtvi8x6c2W4= X-MS-TrafficTypeDiagnostic: VI1PR0502MB3664: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3664; 20:j4cL6xvOYnlCFVrMMu5lkkZ9nifEMM1XXPdN74mQo/AH8UR3EfTOMevW2jy5Dv1sWnt81xsqrRt9DVIp2mycsVAqIgVyuzOk0MRdAyv9xGW8lnL1Fdqm0uvR/aPVwAy4qln0fZ21QeYaT6yoX+qH/bD9X61sU23KPD3da04uwZsV4l+mQkSa4oIJtHTv/JK66K1gv7Ds1mHRiks/JHI5n60vuV2VP/pZsxQVZ8/Pw2iMkZqqQhKhiUGSkJxeb75g+92sxKVk37g4Vdp+dxELwKdIdKXrcQwSl2bylM7wz0TIhe2TZ9Bic0iCzmn/nI37CEgq/og4EuStH5kFax4GWzDWqdsa4wRmB19C48svP1fdEgRYWcVvfxyeingCXkMa8glYMO3XdU3wneJN+O2Y0tbyEpQpDtq3ai5prA08fNKm3niJ8gdWEitvlRui4R8Xq++u3fncFzfldQbyTPAdMNHhsS3I/l0XXE2g3JOHNf6r5SnZ/GFEnvp7sof1dRM2; 4:ESiY5tFI3NZRrEbnWmbMv7VkQDDCI6xlCooiRf7ImlEVgqvXPZgbl9Vn/CLu4NqpjFzvRxtvo+H8/ZN2eCBskONYHGiczEoXbe+ctMC22bTkdGlJQT1LKhAi/qCts6HB3L9KmXBaAYDaGN9Djtu5SVU5mWmfBuqiNHe5Snbb0itlKXp/Xa+Voi2ubpyOaIwZiWHXGKHAGZ9VqhmU5KCA6AhDLYxzdF39e4oHBXjVl0BGpnWCF2CR5hoTrCzPuWzI8c0MPJBS+rbkJYejFa+b1XJjXbHwLkLzCFULTxiefOc5tH12sv29u6n576C2fxgR 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)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231020)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123558100)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0502MB3664; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0502MB3664; X-Forefront-PRVS: 04772EA191 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(189002)(199003)(50466002)(97736004)(66066001)(478600001)(189998001)(36756003)(33026002)(25786009)(7736002)(316002)(107886003)(16586007)(4326008)(86362001)(50226002)(53936002)(16526018)(101416001)(106356001)(5660300001)(2906002)(5003940100001)(69596002)(47776003)(6116002)(3846002)(68736007)(105586002)(81156014)(8936002)(81166006)(21086003)(305945005)(55016002)(4720700003)(2950100002)(76176999)(50986999)(6916009)(6666003)(48376002)(8676002)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0502MB3664; 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; VI1PR0502MB3664; 23:ZPkkJivge89KKXRxZKmGkmw1kofWvsfxrLhdNG5?= =?us-ascii?Q?fD+v9M3pyzLqg4it46DABzrOp+qDOP7eY0iOZlFXCS/s/Uri2Snnn469k3J+?= =?us-ascii?Q?aZ6M7r1i5/5HzDBiifHy1W5DTafj7IqZAuk4HWCtFB4qlGYzRlD/7TufZx4h?= =?us-ascii?Q?xnSCYiQBmOKMKjEckeLP+HlgT3xibDM8npibJ4hCCM3rSyMQ2DwiT0dZzFpg?= =?us-ascii?Q?ABwJ6PI5y74gl/SpydrTjbn2H934nelIrG9vCUR2YzX80gdlkK8ns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3kCK4GYYQTy5URso/Kt8pber//ehrSmWoG9w=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3664; 6:GAS1Tvp8MhorT5HFElpiooP8CBD78bMt6UvFxHHmSJhoU7xLoAYPaJ376p2LPfsmVnuB/qlnysvwtKgrwx8UCC+WPVgzOChjFQr/Xn73HyknMSr0QW0AkDqcRyXyS69AnNAO9yvMis86T4XH5xUu1eMSluYgK/SOLblRIkH5W3Zcl07o3lap923n8AfH3f2bi2TDRf7m19R59qvdkVgMIg62TkBdIidKBGgnd8txHZHVFo9gptjNKxDY3fTJsu6MpsH5GDml4MIXAuivyM1v64GM0oSL+nfUR6aUUsOSOMQ4BQFV1fKTwWaoQMdIREzm7h1UC0uhna9EZ7rnRl6tIbXGtWudNEm7CgspEX8lPGI=; 5:6SL2qIeISN4Q/J4XHZiPBQ/+jjlcJmK9eASbjgWTzOwkKQtLVIH66Hj476gGpwFPJXyWYLd1fUpxFkKDBOOmjp3RO6Ch97ga5jZ62kprg2t9Pm1gIcxTwPUxY/hpi++aQ/IwJP1xBNIZZsWHeJ2Ww5tfdD7csegqTr8rOqYYLtE=; 24:CI4U9vjz02sGsjZ5j3mCByjd+kg2wNUWXmgTEEW0kbLoNJfrk5yc+fbV2kGs+Xe/Ckyp5o6W5EWudVfRixtod/8zRgYU4LRrzaRdPLQtsck=; 7:KDVDHfEiMHqVNEu076tQzhMtub+kdLj69sR3/lzyZcCgNmu6QrNuDosIOOfNv2zpe06vUCPS0RBMZE0fH4j3S3+Fb1Yo87qRW3ntJac15RszDzCcnSWpODM4wU8ZKUZAaivo/SDOjPDYss3HPxW3bc3ERI+HR+xESXXIHsMF1az7Pt2Z3Yj2kC53F9X/2ifA9Bk5SqKH+vdU5SvwsD51dDSrt868thGI9cBGcf3woNbItSNcxrWhHjndiZUpxGVf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2017 18:21:53.5179 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 795e87e5-492d-428a-ffd9-08d5208c436d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0502MB3664 Subject: [dpdk-dev] [PATCH v4 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: Tue, 31 Oct 2017 18:21:55 -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