From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0045.outbound.protection.outlook.com [104.47.0.45]) by dpdk.org (Postfix) with ESMTP id C685A1B4FA; Thu, 2 Aug 2018 23:06:51 +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=vZx7EAS5fXt/NJrsoFrLbSdrATA8XdXrck/OPVIMBiA=; b=IAlzNZlBRnv/byqa/qEFFEkWEV+ofoKr2R9GbGfjLYYmkPgL973n4iwAmgEVD3yxEtfXiRI9h+Z++5iTCqOzAw6Bavpah4LmzVUQbNNffg1x40lt39nT26G62v3FxeGdt4QaZZXJ/J/5UdmPPA4l6EIpso5pGkLxSxHmJ3Jj76U= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by HE1PR0501MB2041.eurprd05.prod.outlook.com (2603:10a6:3:35::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.21; Thu, 2 Aug 2018 21:06:47 +0000 From: Yongseok Koh To: shahafs@mellanox.com Cc: dev@dpdk.org, Yongseok Koh , stable@dpdk.org Date: Thu, 2 Aug 2018 14:06:31 -0700 Message-Id: <20180802210632.11006-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180802010557.16648-1-yskoh@mellanox.com> References: <20180802010557.16648-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: BYAPR02CA0036.namprd02.prod.outlook.com (2603:10b6:a02:ee::49) To HE1PR0501MB2041.eurprd05.prod.outlook.com (2603:10a6:3:35::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd938599-6f16-4028-6432-08d5f8bbdcb1 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0501MB2041; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2041; 3:WL1Sc6Ls8KmdFGcH7q3yBXqsX6WhgZqSxGd21xxIxUXImht84jh+LgD+y8kx5d77CRIQHbv5YZeM9LrYZUn1DCr8CBCEUQ/1B9FvwV3I467J9t3F2vFWuiwZlG6Nib6eHfum3RqTAk7oMiM38SE2yMbszMul07XqF+6pJ8y0/znMlIOZataIwPN0eEcGK5ha4nbwEEpZ+8u7t5R0gTYr4zRHuUJcKyfjBRiUCdBmwqfQxQxDOnnSxrtSoUZ7VIYZ; 25:iqDsO+VhVNEhIkDcluM111ib0bzxxY5v/1gIT6DSvzNirvKe7/V5qv204zXbC5pqhfP27r3Sp0eVpD9PwNQ9WBzZN8ebHRr2fxenQFsZq9NsS6OLm1XRjrsYmLVnMC0UNkR66viaQl5rO8FENBt2G7MvU0aENEj6KyW13cC5EvfpVoCu9PrralsnBefsE1GYkA81AMmeCVk4G+om13nba2Ya/xpX2yehVhozMDGsZjrLP9tzj8vZzAnDLxC8VX7OgwV5iOSGNktmA2bba4pWfJJnzacTREJtUOVBVJcKLogr5DAUXnQeS7SxzEyGoAGTkpibZqD00ztYuV5F7eH+ag==; 31:DtSlu458R78gwDhJa9IeYF3gMeBCyaKYvumFWfGucCCbYFojZUZzCY1P/SAzcExYA1+fWAg6J6XdFYwDduxgrgDBVHO/g1sX+mp/aK/53BLmHRyh7TdIbH+VagLF/1YknzgX+LeEIYPhwuF8y4hvcURtrB7a/P2HgdZl6fEtKpnwa1voT9DJp8cJycN6FY5FQofDysx1HomFPVOJOdowWffgReBV4ZTVZprVNMslT4o= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2041: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2041; 20:6zTpPMUYf4Udv91jZcWoPM291lLWnA6GMQn0wPfRp83zy08Xl3Z75wAIfNyXJyAycEFzlVc+C3wfK9dIbKOcbET2YpX6hDHV4MmcDnZXS/yX64rkG0yqo7WCyfbjTiM2/OyEe42lQEmqEhBMVuB9gASESZ1RbLip2qFFpHigrwKZVGKphEgMfAQGw5hkc+dfBmoTFUKv2ZpDOgXiHJ2rywJcU7pgwQNfrItFi6vyl5zsvYg+hTTbb04YPFPY7KEC05MTvpjrCmJ6DdBFyQ96rU9JB3NtBdvnKmJ0WqOCe4BKmqR8NRPD4CQ+3CXDDTpvVoI8bSicid4nVDocONrahpi0tdUWNbm5VmnQmdWZ/u1odizuXW9VtYLKdsSTnOMupfV/lg4eUUCX1JPdyPQhD3EDW2dAYvwuUBIsdt+rL7SdADolCs+xygZrM9DnbSXsGemQ8BjV55Bm1xDmWriCKtiOa0wClG6o6S/9R7w2VXLjOlLL40VlPXmnHErj9/6P; 4:Kb3GavwLfCKQZw+Vsgwnpc0aTkQ0tCqjfnhWE5sjix4QYRVXFqi0+Wa85XKHTX6qtT2AlMPXPYnECHYZMkWtvFu+OZTY/MTtAP/M7ZlqgrC67MdSW9jb2vUnMbEch6aLOCWvWVSpHZpiT2T/psEjlIaJnF4XNfIq5COvqfZHMMuxt39qW/0DgP9c0mqLoqvX3GclMhSHIC20ERU60bJYpkdvgYwICpR2YoMVv0U22ez/Czi3Uk+xzH6fIHjnXG++2r9Lwdh9WHCarDFB5VIl6A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:HE1PR0501MB2041; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2041; X-Forefront-PRVS: 07521929C1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(136003)(39860400002)(366004)(396003)(346002)(376002)(199004)(189003)(11346002)(86362001)(105586002)(450100002)(106356001)(21086003)(34206002)(25786009)(386003)(47776003)(66066001)(305945005)(53936002)(36756003)(6116002)(97736004)(3846002)(2906002)(7696005)(2351001)(4326008)(2616005)(478600001)(55016002)(48376002)(69596002)(50466002)(37006003)(68736007)(8936002)(2361001)(6666003)(16526019)(14444005)(26005)(486006)(51416003)(7736002)(446003)(956004)(52116002)(76176011)(81156014)(5660300001)(476003)(50226002)(81166006)(16586007)(316002)(1076002)(8676002)(6636002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2041; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0501MB2041; 23:Dr54/gtvJbaEwl0DPyowokpki0HZcl+jpZyoAzf?= =?us-ascii?Q?fgu7UR0GKl5+2koGkOGmTRyREw/jKDav5AmC5ZiBqmR0osLagPbRaE3Ee+qs?= =?us-ascii?Q?VUiG4zJoq0k79kcd3V0+I7oa/NWLkIemD1i2iF+WMcJMp/tjseMLeEfWpwjX?= =?us-ascii?Q?GJMn4LuMFS7BQbhnNzs1n+EpC5e38/dIwLwtobnz+L0aFgNXX3g99Z/nMMo8?= =?us-ascii?Q?0UA+NU2DOxshvVVUD70Ha6Q59FVb+FYIlsue5H8DQip9to2wMmdWUdWJWBni?= =?us-ascii?Q?0wOQi8T48h7x/2gbZ9abZlIH8dJ4eRyhUofPiKjA4PVY5OagLb5ZrCIiwPsz?= =?us-ascii?Q?SYyEK6MsDn9jioxB4itY09JwwsiGsIbC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?us-ascii?Q?BzLyCcl/Jtefcza/21HSOsX3mwfr1KjKfvWfKIfOU6qV/ejLydOi2q7E5Gh/?= =?us-ascii?Q?AaATwoy+JLaq39jlv2c8V2AKWZFPemaZONJO1PfXtIqNrM2R71HuhRjxOX2N?= =?us-ascii?Q?Cy3SQ8EYudd0LG1DAe9mdHst3fpPaek96XJEd0ZCLWnbdqFz3J8kISpqK1K4?= =?us-ascii?Q?y5XKS5GUV0w=3D=3D?= X-Microsoft-Antispam-Message-Info: rxvRTxLMFl3N5Pjlw2q7uwVxV+SHH7+FsOB1r1NIRWTJ9BRwkb9u0Q2TkMMhWYucuDytqkJCihBKahXtteTKCi6t4dlp9Yrm/1feNOXmlLFea0TqX749VuYtuYW8um6pCnP9MKiIk84JW8IcXfifbWaO3QVhWVlJvUprC10RD7Tw+FHVjKsNRrVR32dpQ55F1h/3pSEZhFnmqZ6s0RZBx+DRsgvxOD99vAPSVNVFP5PpsPTuiHrcEefRF9lTSwDkomHS/pavptgynPnQ24Ih7vhfLkHdtQpxjAVPpDPi+ol6LPKsEdVgO72ggUFQbQ/17nUowKkfYYVpWzc5VsmOJknN7TFfkR46ZkHm5XitUuQ= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2041; 6:/BZVJTAaUiR+rVs45423pwaRD/tek3tuzBM3kou/DzcCiwfIJcu/BSuEatUdpucZfusU/yyNFmSkMadXbZCnCuy6e8gV5W6CvwQoN/tqnhevclo4ry01uy4zWMgE3ugWKpylKkMgCQdc4hS96gnESTLfVI2C7PqRO3n9U+4CmEGmd4Qquuv1Mzpxre0CHUfdlnXY9ehkscJIT4HodSCiR3LbL/XxYE46Gu94bBP9Xs981etsg9WJ2cNg9d5bPuwQiDLanPWaghGC0aXMSPiElUG83RlE60uwmyXYz7/807EU6hmSuXqOIAqgU0abGkBuUMjeGa0RAheSeFwl1LDl7nVDOqbdJZuggNCbSW/dVs9tw1sjzSSJgjDEa2ebjApWpKDnDPBmIhF2GNrKoy5vr7IrvSoU4e6a/zR9mlOJmb+Pk6RiiP3kUYuou2XX6PA7M9jl+Bm2I052bNHVAaz7iw==; 5:LqSg7JvuDoH1hmr/15wDZttn9FRRAFVyWnVGdTM60RSF87dyU6OMEy2Aeo9o5xDpsF82nAjYMBF1Ko/sVGdza7DCyYALUbGrWzvWJ5jA1Q/mn+j/Y4KSbC8rxvfYZ1nxccMc1SRrHHsNsMg1lE4EeOgjwySKlju9ftaScEKoK5g=; 7:nrlhg3J6WviTY8qlXI8VQNGJkhdDSe35UacvR10sEuonE70krRxaznqruCvTLWz7ia4Fw5RKVugrHnJnlAKqErlBQGhUCbFkvwcFoxnjNsY1gYLsiOk144+LgCinFBEY/1572oHkvp7DbVZB3ZrYXzZYjV26J9ZduyE/prBd+aInzCaBCApUkiPvAWEA+W+sJT+upWCSdV1amgmCRv13EuPFvw2T2Fw8YNV9En0oAhz6EdmHiFrv3ZWw6jLP2TaC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 21:06:47.7079 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd938599-6f16-4028-6432-08d5f8bbdcb1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2041 Subject: [dpdk-dev] [PATCH v2 1/2] net/mlx5: preserve promisc flag for flow isolation mode 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 Aug 2018 21:06:52 -0000 mlx5_dev_ops_isolate doesn't have APIs for enabling/disabling promiscuous mode as it can't be enabled in flow isolation mode. If the function pointers are null, librte APIs such as rte_eth_promiscuous_enable/disable() fail to set the flag (dev->data->promiscuous). The flag is used when starting traffic by mlx5_traffic_enable(). When switching out of flow isolation mode, promiscuous mode will not be set even though it has been enabled. Fixes: 0887aa7f27f3 ("net/mlx5: add new operations for isolated mode") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh --- v2: * do not toggle promisc mode when switching flow isolation mode * add warning message when attempting to enable promisc in flow isolation mode drivers/net/mlx5/mlx5.c | 2 ++ drivers/net/mlx5/mlx5_rxmode.c | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index e3e2a181ac..83b82f11ab 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -399,6 +399,8 @@ const struct eth_dev_ops mlx5_dev_ops_isolate = { .dev_set_link_down = mlx5_set_link_down, .dev_set_link_up = mlx5_set_link_up, .dev_close = mlx5_dev_close, + .promiscuous_enable = mlx5_promiscuous_enable, + .promiscuous_disable = mlx5_promiscuous_disable, .link_update = mlx5_link_update, .stats_get = mlx5_stats_get, .stats_reset = mlx5_stats_reset, diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c index 80824bc43b..3c0373bb4d 100644 --- a/drivers/net/mlx5/mlx5_rxmode.c +++ b/drivers/net/mlx5/mlx5_rxmode.c @@ -32,10 +32,18 @@ void mlx5_promiscuous_enable(struct rte_eth_dev *dev) { + struct priv *priv = dev->data->dev_private; int ret; dev->data->promiscuous = 1; - if (((struct priv *)dev->data->dev_private)->config.vf) + if (priv->isolated) { + DRV_LOG(WARNING, + "port %u cannot enable promiscuous mode" + " in flow isolation mode", + dev->data->port_id); + return; + } + if (priv->config.vf) mlx5_nl_promisc(dev, 1); ret = mlx5_traffic_restart(dev); if (ret) @@ -52,10 +60,11 @@ mlx5_promiscuous_enable(struct rte_eth_dev *dev) void mlx5_promiscuous_disable(struct rte_eth_dev *dev) { + struct priv *priv = dev->data->dev_private; int ret; dev->data->promiscuous = 0; - if (((struct priv *)dev->data->dev_private)->config.vf) + if (priv->config.vf) mlx5_nl_promisc(dev, 0); ret = mlx5_traffic_restart(dev); if (ret) -- 2.11.0