From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10089.outbound.protection.outlook.com [40.107.1.89]) by dpdk.org (Postfix) with ESMTP id C69681B2E5 for ; Mon, 30 Oct 2017 11:07:59 +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=Yvau5eMcWX8KQhZlCHiGqq5pSB8JX+hjCZrpPNUUPsQ=; b=Yf+bku2Qz3FjNtIMbpYi/Qho1uOk2LN1e/PQxiTK02ZJpUxALt80YBR0NXe5WJNUxpwTERNNGB5A4YjPaFrGwZB6s253THTaWgJLEQC0huk9/VN5fv5LrrJWozi7/M/xS+qLl+DqJBqHhm3awf2FAvVm6fRKmohJhgdxQSKleaE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR0502MB3662.eurprd05.prod.outlook.com (2603:10a6:803:f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Mon, 30 Oct 2017 10:07:57 +0000 From: Matan Azrad To: Adrien Mazarguil Cc: dev@dpdk.org, Ophir Munk Date: Mon, 30 Oct 2017 10:07:23 +0000 Message-Id: <1509358049-18854-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1509358049-18854-1-git-send-email-matan@mellanox.com> References: <1508768520-4810-1-git-send-email-ophirmu@mellanox.com> <1509358049-18854-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR08CA0217.eurprd08.prod.outlook.com (2603:10a6:802:15::26) To VI1PR0502MB3662.eurprd05.prod.outlook.com (2603:10a6:803:f::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b04449b-029a-4d3a-d7e7-08d51f7e18cc X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(2017052603199); SRVR:VI1PR0502MB3662; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3662; 3:zNuE8f+SBWs2Ip32COI5gcwWwQDSPYtD8+gKUFgANiCrr5zNc/Lk7gSnSdeY77EvjZtVS7E+2gnfXbic2chxozf1g8dCYppCD7qmLB/YcOEJx8oxCawi+vdLNAV9fBnZhXTDfDfrs0MivthLE3W05CxPDPIX/NmvPDL96EAx3c2tth/EUer7gawjw2x754y8cZh8oPJ7dBQtgBjfS2KxUo6BulCDj5AtKPZwo/g/NLpXPLQgiYPOZwp7T+oFdy+E; 25:aZpzBwZ6gmFNyGHaUYu45FbscMj9F3ctxORHPaEnHIt2eugfsezzl63I9DZEdUA2PVgOWyV+PWMSeWGK4/0Mi/uFYBFCpD9GCT3vocPA1E1RB6zYOGfaKQtv5pKjhkLjAs50RIbiimoeQqbj6hAQ3HOR00mP78DVADCvJyHmGW4Jbm+8u2Jl4uyKQqw1/jYJp1iE8DAW7wo3rxKpKoN5UoJt9g2wmV0bs/g/Ag9arzCAkHiiOOV16hvSx1bcjKN/iLFXFLlKVElZgu+wLpdoBO5r/8CBEC8hfrad5J3nhO+CDxBfg0AxNSd5kzMU/eWluDkEo/U2kvVT7e2eutl2SA==; 31:Zj1UXa6EBpGxQtUfvNcsmoGUXmTx+Qf1BsGLQpo57pVpK/qaRawBDpEj/9/NxhfM05f14wUBEQzImmVAIy4UqVmYuijcd+hgYoaSqaps8UZ4HwDiYOTPm+yyouOa+u+S7OrOGXBKWEQ/gBOz/OaPF8AGDzxnk/brjZnrKtyXIgy3PrT9aOobxP+cyMnSw/+/A+zfVUmAEF3hZZokVcAqs1e4vctOHUCW7ZXLWd/uP0M= X-MS-TrafficTypeDiagnostic: VI1PR0502MB3662: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3662; 20:TcgMGUNHZO9i4Tz0lW/hdRDmOckdcsjoYAN4oirvhEbPkL+k9KiV6W1T1u2Orzpr87D0Dzaowbut1QLQuOsm9vH1Zv8LzHh81G62l+0xIs2zS86AkZ1TJUIxuMGUM0wdwTKsbgKOpkCCQSJt6wAnJ7TZSBJJVa2DOepTnZm8Ms9zXV40cktSLio5diMQAO8oFnA8/2pKPemlTecZLrfUhVYj66Tqmsr6Sw7Lz/y90UpK3MEo/sZJhQRIySl9gb9cWO9MagC4E/cHuWumZd//GxblgXsNegQ0FNbv96Gkv2P7dQ3pm4celsLqxf1XngTriugdPhI2tvJCiwwe7XPogk/w1eTFKaiR0/otGzuqICoF1Fb173nqeFefp8GVdGwlctVybkQOG4+9MS4DwYXtW2Fy54h/8W3RgduvbsRNOQA+oWR7nieAvU6muExJ252wU3SJvZfRp82uOBtGdvXyM9L0ddfZ+bNk9/AJY+wO9H9UfmHtRYSuZK/MIZuEK+fC; 4:4l2QI/ggtunAveFmwk/X9sSreMsWe9bOCVl5RyN+E6cExMFZGVjilRmZ/ZHQfL1VEiNYdEIDgOqAX97uKuzYKoArD1pd03jI1Z+pHVx+DgL/kNzyoJTW3xyivLmlb81KFfrgeoWF/D7hTUXK6dq/eWIcpLdhLIGYfIChPKbAyjXHZc579x7qXE8dKzK8v19cbxpQEJ0yGsjfQ40CegR39Qlfupk6gFGtpFkuZkGhjS8X1F6aXaSI4OYcgaKy5wzvFgX6cGZTPV4EuGggwAA2hXXuSvLJv0yxKXA8q34E5Dyne5kvxXzlZnG5FCMa4Kql 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)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0502MB3662; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0502MB3662; X-Forefront-PRVS: 0476D4AB88 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(199003)(189002)(16526018)(97736004)(66066001)(47776003)(21086003)(5660300001)(4326008)(50226002)(316002)(53936002)(55016002)(4720700003)(6666003)(16586007)(6916009)(48376002)(36756003)(50466002)(2906002)(7736002)(305945005)(2950100002)(106356001)(101416001)(6116002)(3846002)(69596002)(68736007)(33026002)(81156014)(81166006)(8676002)(105586002)(189998001)(33646002)(107886003)(478600001)(8936002)(5003940100001)(25786009)(86362001)(76176999)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0502MB3662; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; VI1PR0502MB3662; 23:dmff52rQzKk5L2aKkzx/CMQub1gi3bHjAwtoqy/?= =?us-ascii?Q?xWHkBz5S8FPlkM2dQQ73o9iIA3vIpLMG6na5C5145jjaULnYqRkkOp5OcRUx?= =?us-ascii?Q?4W8sWASWevr61pFHDsmryw4CKPPpUyTEXtcpkkBb5AIojyVIGxIU51aDbpFl?= =?us-ascii?Q?80HD3g/7qiIzY7i7EtPcs4AGFeDKmmBlRuGQSiCOkig/gQJcymIUtoocnpkQ?= =?us-ascii?Q?wGc4RW7ENugO4aTDYTisNyksauefg8zJY1ip+1aika9YGb+n/mFamdB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FLZMrdDzC5HESfei0ueCWA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3662; 6:yuboiOmcY+xfEnYYidIu7VzkSxciIddPrMubTrBHpbMWZdm+YDl0uI9pQLk3TLem8M1fUjRKkzXjRbFg++9Sub5yT93XDUNSKuy+7HrSUdTjQVYx6AYvBdVuef6nGSVIo+VopgZE7BGA84bUAFVrIaMGzXehAhAf9hLgf4WbzCX7Bu08emmQVPPs71HnZbGWcFUMr5iNW55XmguQm38HMc9uXxNviOD35g5SHp/1dMdtap0WyBAs5LE9zKzVN84xS2l1YXCEKaHB65bnQDwALXn6Yw9f5OdoefHVAeiZNN76yzlxprSqPOPlHzqh18+G13ZDL448GVjGXjmSNcAu5R76f/oVoY9pbW6vwsRvJ3o=; 5:5oVBSrYohCCRGWm5Y785NAglYbHU8fAjVNgiA3w5uymIVH7CzxIlKa2gGHU9k5d45QCl0ny1kCI1StsfCe/iAxzO3PrG/1Ew0mQ79853Ra52YQy0rCuuLVecjh640JkjjH2dPzmFhdXOCozJ7JOASvEti9vuefSy/cuYEjgfIyw=; 24:MkYl6fhFhqQMptK9D/hT6UkO69l/eo2PVZF75goGcgt01Oydx50wGe1romNDLPhFVcVEsw/FbNTFT7wWKhp17pj7MJtflZgZO02dcTvc4yQ=; 7:zwD3H6LGrWSR2ryr73oe3qJn+EzBebX1ILqP9lVuHmuI9j1nwj2EkTNnf6grgLTy4j2siBU1cLFUAFOa+oW8KFR+YhwH7Sy94CCtPP8Zz1Vzw2sz1V+HlKe4do4u0RBk92WHk1kfxbn9u3/DeqLskpa2LQY7FUZ4s88B/+yh/9D5vRkW0ljmUpCs/zvH6hq59WboIk49c0U8Up+BxmTgAmH+cciz0C6Yy+n1sP4nLgRjJpTjfe9JdaDbhEp2kB51 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2017 10:07:57.9430 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b04449b-029a-4d3a-d7e7-08d51f7e18cc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0502MB3662 Subject: [dpdk-dev] [PATCH v3 1/7] 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: Mon, 30 Oct 2017 10:08:00 -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, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c index 67dc712..4f899ff 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; @@ -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; } /** @@ -510,8 +508,6 @@ struct pv { assert(max <= elts_n); /* Always leave one free entry in the ring. */ --max; - if (max == 0) - return 0; if (max > pkts_n) max = pkts_n; for (i = 0; (i != max); ++i) { -- 1.8.3.1