From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60069.outbound.protection.outlook.com [40.107.6.69]) by dpdk.org (Postfix) with ESMTP id D1C911B4FF; Thu, 2 Aug 2018 22:58:47 +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=ID6EdNmvfmE2eAQIG30KEpiDm9GuvTA5VciPHyHOSkYWbyrd49h4TXjwtVlgvy7vYjPGe/rBp110ST+0tbgj7WOmH4T/vgrRNoCwOWPIow9JytyWRIg3tVINfw0Ch6vEMqvGFb4f/lF/GrUdWtKNUqQIaRgd5fvTKD3sdV4G+Rw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:58:44 +0000 From: Yongseok Koh To: shahafs@mellanox.com Cc: dev@dpdk.org, Yongseok Koh , stable@dpdk.org Date: Thu, 2 Aug 2018 13:58:33 -0700 Message-Id: <20180802205834.10491-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: BN6PR03CA0011.namprd03.prod.outlook.com (2603:10b6:404:23::21) To VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93f49eb7-6653-48dc-189e-08d5f8babcc7 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2045; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 3:ibLVb8ivYjXAka7QEAWidKiV8T2znSzzljd670jKCWpeQECKlMA/OF6shBxlLvDmjBgI03JGNm+88Ex0lNHxqEGDgcFmn14h3gzR1tdsNCMMRA4i7JVZI22OaJ9Jt3/+RmZvqF8s7KA/vcU4k7Ia9E0PvBLqngNdk1ma8R0WT24ovguBrogtFyLudNm4bPelUaijOT6zammciys/+WEqqwOgwq/89JNW4XrufqZ0DraDsWy63aXHoMATIljt4q8c; 25:5GAjArZEeifEB1Di0elXJqYriBAEp3ecVc5pWNLCUJUc+hySKB8mt/KekGYl9+MxD+9aZQB1vXOsgTFpHZVyRGFfrHniP8jS8BRttiEKvRi+v9GLu6GoVVB3yOgrpVK0r0Wlvem78kBM03EhftUJUTnw6MwptqPeOKT00outpw6TDkBa2wGLP00Ld1Ji5O1nsZT/JrAsQsge0fRPJVO9OTqtsFByQaJ0aSMrJWYm7s8/H3wi/2CaQCfXm+NRkk8DjfuF4P3DcMbKh0SlPMMdBavi/ItumQKHLpJeWP2f+YuWWATxKfys++wpTTopZajs0h13YR/jt21hj22633YoEg==; 31:ipsGtzBxy93QvMf3viuwqXQgLYowXz2BYZ1GDuuIpB+Ylzm4sBdqZ8WlRL4FWMAdDKsHMti3PkiN8wit6Xcloxyec826SER54Bz3rHaKO77EOkZmiX7KwHoOdvYITiFjjXzIBfFLObIQ+FfSDWEQrDJjKE48TEgWKM4p22uWTSak9yiJH5LOSXgtvM50A9P3iXLl9/L5N9+MH6L9f0fV6Nn9nnC5KA2v1R8hp6zuknw= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2045: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 20:055btKI1IERn53r48IGf6h2BpdkFcGSh/UsZgR42RHEjcm5rzypsXBt97nAqlInOHBpWxQfFv0QnbTfa+wG6PKJzh1kkzU9h6r6xdqLJgrZHf4AuK7yuY/fs0EKVCet2GTGYvr6YbbUYdSAoLvUc06hgyoyru3BDFO7RVxtbbwE5nVyYBUCvmMJSJSXVTYZrv2/K28iRggszwHe7Zl6bpkQYIJtFbtTLLd0FiKd2xyhe7YhbhKvmEm6HpWf5Gt1+9HYyCgH1H//jnMWWacfqdOO4qQNUdAUjrJDrHOD0oice54rvzIZgwql+zHkhLy0hIvN0OCPfPSqapXRaBc+AFcGhDqUqiVfv6K9bWabwCMKLbpDj01gxNnGZt+O9YRT+btdAU+UX1IcROK83XZsZ1kMYky+xo0lpUvucKYVbZHKrm1/KQTAtESOhXQSrEVfrCGgVXNx9H7+SzpOaDjIuUeQykB2tKWodu9JNrI/x1RtfTOGqy8rIWvtSydYmkrii; 4:GBslW1FY4DcvKsaYEqQtumXNVPwOrYB22JuVARJCN89F9LUb26B9kM3dUqJwT+0HqAurz+6bRyWWQ8WNfBU6cnRzAIPRkzQnJg48k1xwzTAfE0AXG+2h57/8yruIzBTUNkCjTYiQ6fhr87luhNgCjwrsKxIgpojiPQO4C6adDivfIcX8QOr26VWe8yoj+TINiqkblkPjMPEu3746HdgYAVWVakHZg8Jc9LTxXZI6JFDxniqbiiuwkG0dZlxhCyWo4SFIXs4sQ+N0AN2PUAASwA== 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)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR0501MB2045; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2045; X-Forefront-PRVS: 07521929C1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(136003)(376002)(39860400002)(199004)(189003)(53936002)(51416003)(478600001)(55016002)(26005)(14444005)(486006)(316002)(386003)(476003)(2616005)(2906002)(956004)(50466002)(16586007)(37006003)(48376002)(97736004)(450100002)(105586002)(4326008)(25786009)(6636002)(106356001)(2361001)(7696005)(52116002)(86362001)(6666003)(50226002)(5660300001)(8936002)(305945005)(47776003)(81166006)(7736002)(66066001)(3846002)(16526019)(81156014)(6116002)(34206002)(69596002)(8676002)(1076002)(21086003)(2351001)(36756003)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2045; 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; VI1PR0501MB2045; 23:Vrv2Z62vdxs3e/h6SpCeuG3ddE7ewb5jPP+If+3?= =?us-ascii?Q?SZLnwyJdj2SZL20kUi+QgNUDzRJsyUdT996ot2pBaBlNWxogjYxPdSD3Dq3G?= =?us-ascii?Q?r2Ozr3bWWlKmnAOqqqUVjy8IDYYB9xYvFRZbqPWHvYW+O7vRJyEvLvT5YGTA?= =?us-ascii?Q?JA1/HPpUXMBZ9MGX3xzsUB1Y2ZY2ERrJ3M9RGlUt8Ppjdgi6wtg5FK6rQedu?= =?us-ascii?Q?sV234s2euhKrUtevBtlymtW5nep2hJprrriZdtt1H1wrIN6oy4TItbfnD/P4?= =?us-ascii?Q?VRfqv2yMpZMx1CJos8serApSgFTzIleHyrSW8yg6HHDagxbROAUddnI8Hh6X?= =?us-ascii?Q?8tL/lLDfhqTfHEbeh9Jkt/HCvLpChToZGH7fsLiWXFpExC1e5KAzDMq63FLT?= =?us-ascii?Q?lhKEBikWtaOH46XtZfiHXDJAaE6tCefzeOXJp31p9e/vPsJtj8yq/2T+Y36g?= =?us-ascii?Q?FBzPMBxWXukWKMxYi+3NlplmCTJTb5pdpNFY1bas+mo3Qzd8p3dM1GYkSXsY?= =?us-ascii?Q?zS+UYGOlZ+xjEwglHJ6tfZPydA+FHKudwOD2jcbkFtR0WM41qiUERBGI6OoA?= =?us-ascii?Q?hB37cyrWjG4JhWW5O2BxNk30eSok/7iQbIbJ2iO+x9CuOcC1OR67DHmGwUWM?= =?us-ascii?Q?c31FSeOHm+GYHiXn17xIYNTK169RD3sHulz30dNqASKnxy++xRQ51ODAldAM?= =?us-ascii?Q?rjl55GvL1asuuoz3VNHhIyg3uO3wGDOxkG9PST82TRfXfJK/7u0hp2X2+aCR?= =?us-ascii?Q?8wnijXnjrQ+39jCN5PJ2DjxeeoT9sbR38hh600irzGCuuknXxrbRCg1KqJFm?= =?us-ascii?Q?ohHGzIBCmcprZEpJh3ZCY7vpfu7oXIcuO7nWnfNZebQZj0T6H8Sa9UytWz+T?= =?us-ascii?Q?8Rw+tcFabJPJA54otJW/heDdLahKLkbv9TgBrPKlgT84wQKmDFor1n91pddB?= =?us-ascii?Q?oYMjD4nzzeNbztTgJaWDDfaI/BCO/8/AcTYTyfzhvx1755d2GxsY3KlNMdJb?= =?us-ascii?Q?PLKVvKyv2Oywscg1x0J966os7a+4bA8riY2qhStMYs7CBy+Kl0UZMbhr2uhQ?= =?us-ascii?Q?GTNBOu/Syt28skH2VX5HE8vg9Es+fzpTb9KlPEg8/OfYuULcI/ik0HR+v6/8?= =?us-ascii?Q?b7mTaY98eF6LNZSXR7oFd8QzB77c5G4lTejRZQxnXz/Cm4JewYex+ck3dbc5?= =?us-ascii?Q?8nGlWi43tk1bH+cN9BgZ+uJ/jkLfDfU3l3wX1ghRbFSqs/+gbCFbZwE/n8nU?= =?us-ascii?Q?abGpsGJhcsa0fY5pTyoMZrJy6Csz1CZiqjbl4TnKk?= X-Microsoft-Antispam-Message-Info: T/fmnuF8yS86tmWBkXaI5MgBCC2Q8bxO9LxzcVo230BsLNBcnczXQaMbo8BSnBJNAgNyzefNwwz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DlcnegPRD5XQK5MtA8zDqDeB0TgSBzlj28iQuIcGrIPf79/UFqee0m87MUVaqbKlqizde+Pz9dj7splsL6qu7HjpDC2VbVFdevRWyNeiz9kPr+JWF1NV2SQ6mWNzX/9EhAaTWOVxfOLaIX3diZwBWKRbNkdCwApxSerMYhOV1+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:58:44.7304 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93f49eb7-6653-48dc-189e-08d5f8babcc7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2045 Subject: [dpdk-dev] [PATCH 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 20:58:48 -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