From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40063.outbound.protection.outlook.com [40.107.4.63]) by dpdk.org (Postfix) with ESMTP id 079EB1B3A2; Thu, 2 Aug 2018 03:06:16 +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=eu/y6pqlSjaKASwerg3oCOzFfN1AKLEfloXbtPlBrlk=; b=Uz13paWhMkmVs9rAJgZ8/EgsTY3czW19WwEyqlX4MVUqV8GqcsWkRD8aLI25NrZmDn1+nTsLdVCg8pth00AxcmjLamOOt5uuMs4fLvVuvQE/uqKrA1+Uv5rHXOBO3Lvp6b8DQhGGGTmW2CLtqC/7jYPgm4L8xmkK5s5rw6IymvY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by AM5PR0501MB2034.eurprd05.prod.outlook.com (2603:10a6:203:1a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Thu, 2 Aug 2018 01:06:14 +0000 From: Yongseok Koh To: shahafs@mellanox.com Cc: dev@dpdk.org, Yongseok Koh , stable@dpdk.org Date: Wed, 1 Aug 2018 18:05:57 -0700 Message-Id: <20180802010557.16648-2-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: MWHPR15CA0054.namprd15.prod.outlook.com (2603:10b6:301:4c::16) To AM5PR0501MB2034.eurprd05.prod.outlook.com (2603:10a6:203:1a::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bfa7f225-3e27-48ad-7842-08d5f8142544 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0501MB2034; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2034; 3:M9LrebsKQPg+Cs6317zqFc39e5i4qU45sp/IzTWqhS1jguwrg2q1Ak81xM/9DgFjHQ9r3nkxjeEAv3RPQgJmTf04awD0UTEEMN9DnC6JO0nBdWNNeDcAN+SE+1Zjoaymz2zgnjbKbphnW8Wwdf8L3G4VdtP6+M02Sd6EmgAAGAm7PrFTzFNDu5fr2lhxtGqDZkr3h91ps/ztTASYQoki8LtIwU9a6t3JYZrqQMt35Pch8yhA/hDw/OaeJgcQ63E7; 25:hY6Fi9mKb6ymJ96wCKIpBt/kOLjU0BexuESa2eJKZ0VmL0VwsvjNpyNbuXJHbMsbHNmrphuei3IG3hQw2xO0/FdSVavnFb9SbQI/CjyUrOvlSeRFWTU/pTBzfZCD53HZEs0j0KuCpOzoj9vR+16+TygSjm9e+D2O8/jqbibBlW0YE30Dp3fdJXOSxil6ECFCiHlL1UTjvdP0aieuNRYXDu1h1jNABZznJVGTE975kxZpOOkCNp+v36r6GRyBROrC/1qcnUHcq6mDPuRqkJUfw1uhNt7JKM6sglFzBiiPfg/fwMXpT2sXbutuWFVsZ/haEe24GCfJf05yFrLWgbqsBQ==; 31:5gaLhEQa6HXJP3CBMWslKlvE6LfvkIRGK8IINjYacT26aBhHA6FERGD9/75Q4DIJrE1rjxeMS0iKcLVTSIB0uWQw3uSz2G80I3Jv3Prx0KGF6DCGnAIfed+SVfU5Gsbu8nNXt38eqrCLtHpZzg1CUz8qhN6LYaUQsQR7Dz3razF0XsdGYbYy6/oDJ1iPRQVG79RFYmDoYnSjyTnLUVpDzTv8Xh+kOJ/+Bh22YGvFZ48= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2034: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2034; 20:2ZKd9ussJYhMzq+wMzDn4vduCgl0j3qQegF1pw5F9nbnZl/YjyO4z7lSnf4rmeYZH/a0iF07DawObODy+VQdKcTPmg94YsuikIlaNpkFx9FKYZ3/H/QhYDxqMAsP8S52l42TwLmZrPPofaw8MRUCHGsuZwfLIE3mdVNDdIxBkg2Ibd1FH0qv6nDR4IBfBYPS8d0/GUEhuX01tWw0TMnw0i7d9meSO8tOX8c7TXYaPKMcZfnjjI57tD7A55F9pxRSIqxZE1PAd3ZDS/PodajuVyAYt9dTsH/4Ir/UoSD/opYnPBt7qMjdwdIjMfFtgYBi/HY0HCjghDB2CfeakfuD/wfEztfKZM7VQtXArq0syxSdFjfuZkE90CacLbe6nuER9pSd44EmiQimc1SbpokqqtZeEhl+pZuj+qWMnubc/HOpjp+SzDpMawvY+dCuBHXqk4Z6Th8prHfM9mN3B2DSLuBrp3FL5g1LcH2gHWlEmAv+xgMQ1c7d+vz2V8W1KAiQ; 4:ETSp39iUNDZ0LA3SxUpyhrZzrd+eFnMlA6mqkmxmAdGTZom8yKu6TGAQtDpjk3E+JkUtPfIE7pdI17vb+QaTmuyon74Z1mGRWTwpEAOpxT3JqqTbhd1Qaf50DM9+yEwSTDjE0UxNnDrCwvDpunXe5XLAhzqSchk/9amBF/IX4UGuvYFkohRO3eqQigUhmrGBTKlE1OjaywOunG+6ckVwFXuGkUReZAOmpRoM+8OpsCaFBzx0Ntukwu/nOwpL9P9+El0juBOmz3xT5ZoATBRJWQ== 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)(10201501046)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:AM5PR0501MB2034; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2034; X-Forefront-PRVS: 07521929C1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(136003)(376002)(346002)(39860400002)(366004)(189003)(199004)(11346002)(26005)(2616005)(6116002)(105586002)(25786009)(2351001)(486006)(956004)(8676002)(34206002)(446003)(4326008)(3846002)(386003)(86362001)(476003)(1076002)(55016002)(36756003)(106356001)(81156014)(50226002)(21086003)(81166006)(53936002)(47776003)(69596002)(97736004)(5660300001)(316002)(52116002)(37006003)(6666003)(48376002)(2361001)(6636002)(7736002)(66066001)(16526019)(50466002)(68736007)(450100002)(76176011)(2906002)(14444005)(8936002)(305945005)(7696005)(51416003)(16586007)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2034; H:mellanox.com; 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; AM5PR0501MB2034; 23:1F9jRjC63IN9CvunSoOXv4w2DEj38p4YLpobXR+?= =?us-ascii?Q?S4Mx67YtAIAyqo+TIDDAm92AGeSFExoSK2RPtjVNS4gTxcM57svfp3mHGe4l?= =?us-ascii?Q?28940uxngtYdO4MexTuPEfffA9BehPN4KfdS93MtEX7VPa+nuwudlxap+xu7?= =?us-ascii?Q?Nk2s19oJLDEEyy+ljPHu1P+Z1jF+FE7RofXGNsOCGGI9BqF4ShDc+TvSXLRz?= =?us-ascii?Q?PGO5qZfhBHvMAwbctn+9pg6Ju1Qc2Kz/IYLfrbsqMJXEAXRr4t3mpkPs1eKD?= =?us-ascii?Q?ktdBjuO3Ta6XhSm6QVwn8spDgIPFWwXMllND6bwmqaXDiSwKhb2043jOUSvX?= =?us-ascii?Q?+emcwqJMu6dORHshjIreSQwnAwbN49J4PAEblGE9BsU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eNWps9cqS7vNb5Ip0yl1Z8rdwloGjZ7RAE1kSFrFA0SSMD5RT06CHRd8PAw0Ykoj+G3G7zmcQzqMhk=; 7:tGua5uKs3RShCrwVESK1HO6kMFT0fNSKmMIELvWJb8DUSHGj/mIqnROyZPA+EqNGwDiBieMmGasz1gKBfheDScGL8iodVzsNYy3Mzuig29uj/RdBHoTpyF3+q9bA1CNBmjNXFJdo4cdR/RYIpWrLRDUkouvtF5SFEcFxugNhbr4utr15ySGx5MMjT3s+gSiP/AaWlXartejdlgEqGYn+CkqNK8+MZKr8RmX7qgs+S5VgaPvN+UtG+2xUUFDgMsMP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 01:06:14.0601 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bfa7f225-3e27-48ad-7842-08d5f8142544 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2034 Subject: [dpdk-dev] [PATCH 2/2] net/mlx5: preserve allmulti 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 01:06:16 -0000 mlx5_dev_ops_isolate doesn't have APIs for enabling/disabling allmulti mode as it can't be enabled in flow isolation mode. If the function pointers are null, librte APIs such as rte_eth_allmulticast_enable/disable() fail to set the flag (dev->data->all_multicast). Also, there's need to preserve allmulti mode setting when toggling flow isolation mode. Allmulti mode, if enabled, should be disabled when switching to flow isolation mode and vice versa. Fixes: 0887aa7f27f3 ("net/mlx5: add new operations for isolated mode") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5.c | 2 ++ drivers/net/mlx5/mlx5_flow.c | 6 ++++++ drivers/net/mlx5/mlx5_rxmode.c | 8 ++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 83b82f11ab..ec63bc6e22 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -401,6 +401,8 @@ const struct eth_dev_ops mlx5_dev_ops_isolate = { .dev_close = mlx5_dev_close, .promiscuous_enable = mlx5_promiscuous_enable, .promiscuous_disable = mlx5_promiscuous_disable, + .allmulticast_enable = mlx5_allmulticast_enable, + .allmulticast_disable = mlx5_allmulticast_disable, .link_update = mlx5_link_update, .stats_get = mlx5_stats_get, .stats_reset = mlx5_stats_reset, diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 268d1f056c..fcaa7ddfc3 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3345,11 +3345,17 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, mlx5_promiscuous_disable(dev); dev->data->promiscuous = 1; } + if (dev->data->all_multicast) { + mlx5_allmulticast_disable(dev); + dev->data->all_multicast = 1; + } } else { dev->dev_ops = &mlx5_dev_ops; /* Take back disabled features if needed. */ if (dev->data->promiscuous) mlx5_promiscuous_enable(dev); + if (dev->data->all_multicast) + mlx5_allmulticast_enable(dev); } return 0; } diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c index 0ed4c1a174..5b73f3eb8b 100644 --- a/drivers/net/mlx5/mlx5_rxmode.c +++ b/drivers/net/mlx5/mlx5_rxmode.c @@ -76,10 +76,13 @@ mlx5_promiscuous_disable(struct rte_eth_dev *dev) void mlx5_allmulticast_enable(struct rte_eth_dev *dev) { + struct priv *priv = dev->data->dev_private; int ret; dev->data->all_multicast = 1; - if (((struct priv *)dev->data->dev_private)->config.vf) + if (priv->isolated) + return; + if (priv->config.vf) mlx5_nl_allmulti(dev, 1); ret = mlx5_traffic_restart(dev); if (ret) @@ -96,10 +99,11 @@ mlx5_allmulticast_enable(struct rte_eth_dev *dev) void mlx5_allmulticast_disable(struct rte_eth_dev *dev) { + struct priv *priv = dev->data->dev_private; int ret; dev->data->all_multicast = 0; - if (((struct priv *)dev->data->dev_private)->config.vf) + if (priv->config.vf) mlx5_nl_allmulti(dev, 0); ret = mlx5_traffic_restart(dev); if (ret) -- 2.11.0