From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50057.outbound.protection.outlook.com [40.107.5.57]) by dpdk.org (Postfix) with ESMTP id E4E894C9D; Tue, 14 Aug 2018 18:32:36 +0200 (CEST) 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:X-MS-Exchange-SenderADCheck; bh=5+DCRvIj1gCvYtwc3ud6+GDRvSNsFrlsou+zDRQEFQ4=; b=bffZ3tgMKf8uzCKYeHSdIIdXwnUNJsGOO7YXPUV9aykvyXH4Y1SfUuxO0PZJ+mOzqsb41WJqbX4Rhe7EQRckmjAoUGGW48rXhLTORuVK9lCcCzsJtWg3lV/BlssN9pGQFJ6+NxzGDMf3L/z/BaLuNfwiXmFQrCiiYz8reWuI4vk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (209.116.155.178) by DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.18; Tue, 14 Aug 2018 16:32:31 +0000 Date: Tue, 14 Aug 2018 09:32:14 -0700 From: Yongseok Koh To: Shahaf Shuler Cc: dev@dpdk.org, rasland@mellanox.com, alialnu@mellanox.com, wisamm@mellanox.com, olgas@mellanox.com, stable@dpdk.org Message-ID: <20180814163213.GA49506@yongseok-MBP.local> References: <20180813070018.101262-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180813070018.101262-1-shahafs@mellanox.com> User-Agent: Mutt/1.9.3 (2018-01-21) X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: BN6PR10CA0040.namprd10.prod.outlook.com (2603:10b6:404:109::26) To DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b5fb4eac-c9b4-4a6f-6856-08d60203894c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB3980; X-Microsoft-Exchange-Diagnostics: 1; DB3PR0502MB3980; 3:tSaBAA4BB8UxgOiWDHYCUkv6zS4SOsVBwUTUsAptx29iry6o//czGqGaONUVje/K2IdmT0WNiIq2AiK2sRYNb+GT3i2Fb9gG/vXV+1RYtMsEdPM2xiYzy3h7tv27k3/2Kq/1XPj5gRP5FD66ycUmZaR6csXjhsq9LBr1Oezm9oB8a2HL22HtTbeVtBiaCgemuScS4JFFMI6iZa+jgqYt4P7eV9KvPEqTmycuNtr808oS1HRxOejAsZDbsaqYUyAb; 25:lQETBrXh2O+FvCKt9BOl1HHtoX6soj5VST/dGcP4uXp0B+BMCXm8NbVeeaBEMG2200wTwuvAtIAPg1oJiJMyczmmYSSE/5M16th+ksvrcaM3XxEPSKiE7B3swU0yvn83xh0rBf0X+2PnsoaVqt9oxYcZ1oPwTgtXp3/r7O8BO8ER7ugwmOvFXpVqQ1VTFM/BSU85/LqTtMoQs7BjsA3WjdpS2zErncMZbl6J7vruubprqo2dDmnlt4MkpP9F01tZYGAPdRDRYwnkfjQO4bMBT+q+lj+kPk4Vo9YsHzAyMJ4f2sjjWOU1a70AGIKUrjgwwQ1vn4HvumuZJIAjcnOzEQ==; 31:0Ivm3oioK6YshjB/reGAQgY3ap1mBRIorjTBMGcBMN2QAvOb79yhTxJ9d90K3cnCv0UBeDOUVhTQhNq6eQvzeXbb/8m5ksbcWcYVn5zfKj03pEFTMgdZHLA9Zv0Tn9rxzkFQyzNI79owmXf4EAFeFb5X1bEkA6ASnvaUmK1MiHQDElSlFS7TgY1sj7c7kqkT1MbCPKHVCCbTmTtIvDNS5pyhr1wopCiit129XWgVD34= X-MS-TrafficTypeDiagnostic: DB3PR0502MB3980: X-Microsoft-Exchange-Diagnostics: 1; DB3PR0502MB3980; 20:ZCbKKfqqQOQXz3/BtMi2oZb4iGsq0lY1LpXzgCxTFyOjS9yOsEcSnLMSLTXtyzd1i2S45vY+m3aRsWPqMcmPm5tdUiJ13GQzDdEfaDeI5KZEcCK7/A5sCOxW5D5V5gI2sVsz+MrhJFkVQqpG0dIBCVKhwhG0k+r8OtixWa8D1IeZsVX3SIjtKzv2Uaf5fCcxehbRMqaiiXqfDPlDHRC5s1AYZ1dkKNi9KnXGi33TVAWmhcM0aI4afZfATQY/pFG4/lbhv+QlnKWig7Oe4bzceKjAg1Zb7JShnTcNYWzv7C4GpPkFUZvbhmFMAkm9rpf+nbPv3WZSjyK371s0kvkeiU6tQFIjTImiWPS52xYj9uEDfKYn/tsgnvhOD+EhpiLZNvaWrikPEnk8/jvr7r7bZf7kqnfwCNtf03rBHC2eKhTYt9yxvFeYrST5T9G6urAGRLPL0SsyHneUUEVhJoK4Og+wr85bqkaD/hKii9C83JIloYlww2LLfr5KJlQPGSCH; 4:0dZdfngUX7ewBJeVhhT6BW0Z4Lp9qccgIBUZGFk/gTVWpS09t7VMWM1R9pCzTWqiXZx3FYnXnp4OxunIqF16REZ+AWnWwIu9jQZ8DYZzRDFqBrXGV6TBMRhkTvAHz07rU3n2hxZvorpMKw6z+fXBVWx1ZpcmzBRThGACfCnFNUWjKVA0qOwL/4ODVa/F1aIEXb+qwS/L49SyRKnBDbFIEKlehR3Ntnh4Fp/kEjOLYp5I5ZrdZ5Ry3pky2O9EbUwMnacgE5RN1kDk3R3LcRuc0cx00SuywMf7D2/pf4kAnkSF1HoWK5nKAjETh7VT9dg4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301033)(10201501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DB3PR0502MB3980; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3980; X-Forefront-PRVS: 0764C4A8CD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(136003)(366004)(39860400002)(376002)(189003)(199004)(106356001)(76176011)(16526019)(26005)(97736004)(446003)(33896004)(14444005)(956004)(6636002)(6862004)(486006)(50466002)(476003)(105586002)(11346002)(305945005)(386003)(6666003)(7736002)(6246003)(53936002)(66066001)(6506007)(47776003)(9686003)(450100002)(33656002)(7696005)(478600001)(25786009)(52116002)(98436002)(81166006)(55016002)(5660300001)(16586007)(86362001)(4326008)(575784001)(58126008)(23726003)(6116002)(3846002)(8676002)(68736007)(8936002)(316002)(2906002)(1076002)(81156014)(229853002)(18370500001)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3980; H:yongseok-MBP.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR0502MB3980; 23:QLEHhMghzu41crMdFY9kfyWWJ0c7TF615KO7r6m?= =?us-ascii?Q?3qqeQhyPLGUGKjUHSWrPmAhtGETuXG0ohG+dB/lDAGxGccK6xcttSotsxljP?= =?us-ascii?Q?U9dJpqE0nxanwgsGMKrxDTvHW0HFFl/aUu+bKVpauKZWjG21MRgKCzHPtJ6J?= =?us-ascii?Q?wk0YNZwRAaUtPNJ1d7T/tFauI5AkrWzD0t1PL/QV1796d7XEOawEDHs4SobK?= =?us-ascii?Q?zGJyZnKAUsMUK23bh0hu2T098K6M1g0LNih56nOqsA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KDkatBEiNI96d1i2oJKSDj+zw8ftlexL9Dbqt1IRMHak?= =?us-ascii?Q?5tEoDmvygwuzOx24+twAgqXMh8alSPXnZoiyXAHyG6nFqHTVSX8V9rbfxhiT?= =?us-ascii?Q?X7nrOt/k46ZMblWdVFfvoO8exCvXJN85ysgKRD18PwMmx5vE+/voD0kG0N9k?= =?us-ascii?Q?Kjwn1CZf1XPTNx3XkUqrCJklGymzQo0Jyqi8RMF0FjuecflUEybntuqldcfD?= =?us-ascii?Q?DduWNvcwr77BSW4NakhyEPtUgB1s=3D?= X-Microsoft-Antispam-Message-Info: bJmRByrqrVDxolZqVJBt3Z0kbrqRSCMx7Trur53MDvcQLJho44AURnaNJQLkFE9yW/1uUFps6jWOCf6s39KGm1zQPrFto8QI0IE3xZJ0z8L7+rl40FcliXnuRZZBFjwoMseekXrF3on+Kn8kzIELpjn+DXsmSzbNQ4J7rOMviv45CC71zrcgBjN3uiPPlIyXEz5SHVirVUSZz0cDC2Ak8xXG5ZQSehXEAS2MFNmAF1IlY1TA2IYsZDrKh2QcbaLg+G9pkYz3i2EG+3IefnbhpmGL4a3z7peCYKIEO4DI/1n81ZNbPYqaTO8VZ/BOalCdtk6ABVOvZcP5r3hUc3K08F13WqZZIPztEs4IO69tuZo= X-Microsoft-Exchange-Diagnostics: 1; DB3PR0502MB3980; 6:CbJ1I8RoERunJX2XB+EpOj/eHOxS7te8zATdxv3sjTguXNYP9kb+QAPIVBXBiziD3b2J294nAS312aXKypnZaVEJkatuZi4FJKeZX+YsF9A8vLFQD3LVXSPt5dSwXd1TB7wuKr1iX7eXAsuFNXcOlmM2s0rugkBPBwP0SVMLEgqSciRDrBwdPxmeA0V1ElpqF98ffaS0xF85FL1fHR6SwbuCHE2YWd7wNQ46JSsK64138cM6rP+jmnz3+GLK+8JXiWwtmq6fhZ4m+MKNwWl8m22r1AV9/ygjrdbIk9JOW5odgysyiU9UaL6pN98WWLeoRPV5kt5Aio2uUqxVwKihJ66weW8z4oLXQEL78N9gJIy6PamzMzFxfwBkYeH3PErRmoS8gS0m195t01bGAWQ1TtsqynSp2GVszDqqBxN0uWfC1x7f/PKWFQNJOhFreXSfbVnbI3xwabTfcdEYXrgN9w==; 5:XATzzj4+L4wHY7DAv3iJY29W25d5j2KrrSf3XxNHBzjSLN4xy1+lrXyBhzENi/1n9q0DQ9AESJ1HvDwtj/5HyBFbijOwzyhm5xTcBCjUAh2kHttcENSyDAVdee3sWsJI+/GlFEZofyPTLb8U7zOnS/whaT8Ymx+OQBqkIyoLBUM=; 7:GCq3kFUrnKHrxDJKO4kwrNiLIfnOKJX0XWGQq8+MmfqmoyI0jaFRcybRflAKJFSpQp4+5tmCxQgmzjy5iCcH3ZHQVtwE5pGRVP8CTLjAEKwSlZNipO3OTjC1kQxOMS/CjF8/SxePCV45b0EqYIkKHLWMg0GKSwteVkSw5V3b+K7Qoln/NAQYul7eoRJWowj0bj/Zr2dU6IamykprOP/3YOvhAnoq/WSgZxGkpGhefo6N8TVHRWi8C3NwZKtTrtTE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2018 16:32:31.6927 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5fb4eac-c9b4-4a6f-6856-08d60203894c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3980 Subject: Re: [dpdk-stable] [PATCH] net/mlx5: disable ConnectX-4 Lx Multi Packet Send by default 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: Tue, 14 Aug 2018 16:32:37 -0000 On Mon, Aug 13, 2018 at 10:00:18AM +0300, Shahaf Shuler wrote: > On ConnectX-4 Lx the Multi Packet Send (MPW) feature is considered > un-secure, as on some cases were the application provides incorrect mbufs > on the Tx burst the host or NIC can get stuck. > > Hence, disabling the feature by default for this specific NIC. > Users can still enable this feature and enjoy the performance gain > (mostly for low number of cores) by using the txq_mpw_en devarg. > > This patch will impact the out of the box performance of some application > using ConnectX-4 Lx for the sack of security and robustness. > > Cc: stable@dpdk.org > > Signed-off-by: Shahaf Shuler > --- > doc/guides/nics/mlx5.rst | 7 ++++++- > drivers/net/mlx5/mlx5.c | 9 +++++++-- > drivers/net/mlx5/mlx5_ethdev.c | 5 +++-- > drivers/net/mlx5/mlx5_prm.h | 3 ++- > 4 files changed, 18 insertions(+), 6 deletions(-) > > diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst > index 52e1213cf5..dbdb90b59b 100644 > --- a/doc/guides/nics/mlx5.rst > +++ b/doc/guides/nics/mlx5.rst > @@ -339,7 +339,12 @@ Run-time configuration > When those offloads are requested the MPS send function will not be used. > > It is currently only supported on the ConnectX-4 Lx, ConnectX-5 and Bluefield > - families of adapters. Enabled by default. > + families of adapters. > + On ConnectX-4 Lx the MPW is considered un-secure hence disabled by default. > + Users which enable the MPW should be aware that application which provides incorrect > + mbuf descriptors in the Tx burst can lead to serious errors in the host including, on some cases, > + NIC to get stuck. > + On ConnectX-5 and Bluefield the MPW is secure and enabled by default. > > - ``txq_mpw_hdr_dseg_en`` parameter [int] > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c > index ec63bc6e22..2e8f906f35 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -477,7 +477,11 @@ mlx5_args_check(const char *key, const char *val, void *opaque) > } else if (strcmp(MLX5_TXQS_MIN_INLINE, key) == 0) { > config->txqs_inline = tmp; > } else if (strcmp(MLX5_TXQ_MPW_EN, key) == 0) { > - config->mps = !!tmp ? config->mps : 0; > + tmp = !!tmp; > + if (tmp && config->mps == MLX5_MPW) > + config->mps = MLX5_MPW_USER_FORCED; > + else > + config->mps = tmp ? config->mps : 0; > } else if (strcmp(MLX5_TXQ_MPW_HDR_DSEG_EN, key) == 0) { > config->mpw_hdr_dseg = !!tmp; > } else if (strcmp(MLX5_TXQ_MAX_INLINE_LEN, key) == 0) { > @@ -1044,7 +1048,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, > } > DRV_LOG(INFO, "%sMPS is %s", > config.mps == MLX5_MPW_ENHANCED ? "enhanced " : "", > - config.mps != MLX5_MPW_DISABLED ? "enabled" : "disabled"); > + (config.mps != MLX5_MPW_DISABLED && config.mps != MLX5_MPW) ? > + "enabled" : "disabled"); > if (config.cqe_comp && !cqe_comp) { > DRV_LOG(WARNING, "Rx CQE compression isn't supported"); > config.cqe_comp = 0; > diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c > index 34c5b95ee6..48917b0f6b 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -1224,11 +1224,12 @@ mlx5_select_tx_function(struct rte_eth_dev *dev) > "port %u selected enhanced MPW Tx function", > dev->data->port_id); > } > - } else if (config->mps && (config->txq_inline > 0)) { > + } else if (config->mps == MLX5_MPW_USER_FORCED && > + (config->txq_inline > 0)) { > tx_pkt_burst = mlx5_tx_burst_mpw_inline; > DRV_LOG(DEBUG, "port %u selected MPW inline Tx function", > dev->data->port_id); > - } else if (config->mps) { > + } else if (config->mps == MLX5_MPW_USER_FORCED) { > tx_pkt_burst = mlx5_tx_burst_mpw; > DRV_LOG(DEBUG, "port %u selected MPW Tx function", > dev->data->port_id); > diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h > index 0870d32fdb..b64cd45eee 100644 > --- a/drivers/net/mlx5/mlx5_prm.h > +++ b/drivers/net/mlx5/mlx5_prm.h > @@ -197,7 +197,8 @@ struct mlx5_wqe64 { > /* MPW mode. */ > enum mlx5_mpw_mode { > MLX5_MPW_DISABLED, > - MLX5_MPW, > + MLX5_MPW, /* MPW is supported by the device. */ > + MLX5_MPW_USER_FORCED, /* MPW is supported and selected by the user. */ > MLX5_MPW_ENHANCED, /* Enhanced Multi-Packet Send WQE, a.k.a MPWv2. */ > }; Any specific reason to save device capability in this case? Currently, all the configurations made by PMD parameters are static in mlx5. We don't have an API to change it in runtime. E.g., once MPRQ is disabled (by default), there's no way to enable it even though HW supports it but to restart the app. How about making it aligned with behavior of MPRQ (and others)? Thanks, Yongseok.