From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80052.outbound.protection.outlook.com [40.107.8.52]) by dpdk.org (Postfix) with ESMTP id 9ED591B503; Thu, 2 Aug 2018 22:58:58 +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=6n7Dq5lmSgwudkLjklFXgE87hGbsaCXQpBasjj49H1o=; b=k7p4tsUQL7Jxq9wjTgsFpa+6Z4AKCPItNFAp42S1VBQx7ApGaQZT13UC4io03TP3tVYZigAsS3QeVNdy8KeAmwaWWCGdTp6H7kV9+ogZCpZKwqNb3zgnCwLT1w0i7fLU0UwH5GalB+FoRVMsVLO7zdFCLj3lHbmZO7ZqgeHQnAc= 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:56 +0000 From: Yongseok Koh To: shahafs@mellanox.com Cc: dev@dpdk.org, Yongseok Koh , stable@dpdk.org Date: Thu, 2 Aug 2018 13:58:34 -0700 Message-Id: <20180802205834.10491-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180802205834.10491-1-yskoh@mellanox.com> References: <20180802205834.10491-1-yskoh@mellanox.com> 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: 270047a8-a4b4-4ce3-6766-08d5f8bac3bd 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:GRoblLS0bb1Zh98x0EIzW8qww0LQs/EM3Lb5ptiPXTt4GhvfBx5URm/HK4OrkPblRKh0ff16ggNMWFC7xobQdC8mIcWIpr4G/ITQMkPwwhlZrhVlysTJMRM6coyqF1hpONmWx2LQLFAl81bttlxFs5hf3wonBWmeI7EeRsPKIOlYHjlK+sCSUZBnQ84AaA8byoVNlRdECYK9yY5cSouBD3jsIQWBYlYxLg5w7SOrt8Jl4cBUR7U1kY5YeTkR+EYz; 25:2NvD4UukoxV6tP3Tm9+Wjuys+1YQCGb3PWPpiWtFtDC4LeMWq9V2vB6g3Prme9Bistsg70qsbHfquVEpvOQGeC6JffktCm7k4dHIlHvbDoswna0qK71bLxh9WS2cQZ2LGjhDiUCQFUsGxcIAMBIFafOZUGkgxrbECasl4boiBIp/ossJ5+hibd73KYXMy8oC/dwqg6lH9Eqz9eZJ1ceqWCjfyPYv1F/mQ8CfLPFc00ppFuDvs0yy+nfWb6XUX8GtUWjff3J7T9BOWD16Xl3Fl0hpd4Ns/odXFMBR48MSVl9Px/ioGBk9x6sRnE5XXLbX9RnL5N8G4nJto89zvfjeCw==; 31:L74JRqb2SBfy8UUmLV1XK6DLlCKbtZlyCMAxaUfrg2l3o6YBK11OaE/DwJSbDjlvyHlcNS5eGFRRXMWxInrpMiBBajEwSxy9fHgAiEm7ffqN0Vvpu/FHSng93ZnGZMxjLLsCY9JFpkFXkiCbSUiog2nskN6K6QqeFsiRNW9qA4ETwB3Wv4bTBccQdLM8IUomcY1yoQcbRpCr8WXP8wp2KX8PvDIon23/+qoPfV5ZmXQ= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2045: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 20:iy53EtCqEuhJQNdKLx9/qW7/dpxyNIaKO+MV6azfFpwuLQUjhG8LSmGviUn5Rw7mDGtW2NSeypMPcd6QOYzKzEd7wsQiyg5QruVZYn8Pqsrs8cH8jK41IHDqR94hJD/SNAqwdbMVMnailY+D1+QFkt6djnDzRnRJV/RYFGonfZMvTyIsmynDc/g/I5GSd8AvVK5xnkjxGTezdBHLYTW5rtwxI5CtZf0DoURig90K7L75bgoyY9NS2/RednX+X9bpJozr3aNOYqktBuW/Fi4vwwEDacKPiYmd05d5emBji0tjm+biHSi8YCufQNWCPzbKrNFDlvlIZJ8uAGBOGp+tW2wFy50i93uFZLSP4dTvONu8ISS9FgGziLFRrB/vYYuWwZh41iU22J6x3tZG3b3zwxCtJGAJQXKJIvSgynYUZTv5JOJ6KSaf84xSx/2Iob9zXRNUDTj1b4Um5NfkF1snMiIuhBr3dJVG+VCDmZy6zvnjFfP1U+g/yDP9mjDU6mQi; 4:sa4yyaHI/Yda5AApskEfWDSADZa5a3FWq5ROgr6VW/orkhKjuPA2Z60kMlgeo8WhQ7EJ8e6bFBRi4AVcIpqDPQAeKZg5yMPwe7XPEJ7MHfYGckWy3T4yLan9W0iucRWwe/88LdL43FFoC8yvTsEIoh90U8uqtM86V69KReP9hAk8YL75BUkmPvYMIkqtjkuKhPNvmn9iJ1FtrobG68AUgsAlkejRu+7xyIv9tPJw+coD1l3L5T1NKi1JbxBJDWPsue+gj5pJAlmqdgtkXa5YBg== 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)(76176011)(25786009)(6636002)(106356001)(2361001)(7696005)(52116002)(86362001)(6666003)(50226002)(5660300001)(8936002)(305945005)(47776003)(81166006)(446003)(11346002)(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:AXZoA64lbNqNiY98nb+2Uyjc2nkBa9+bozCj3Nf?= =?us-ascii?Q?PbTGUYCHCVWYrAy1LzY1UgNlbbC2wqXAgdH1AiOwa2rOHoLQKPfVfhI4Ovx4?= =?us-ascii?Q?ikHYg7ucuDLtk3rksMmNIEAy0G5MpX/GN7y7xN75gJzK4mA8F+SQ49Am9KJU?= =?us-ascii?Q?7+nNu3+kDLWXGU28eV587671QlNiLjMGQyN+6SZA9ZP+YLUPUvQu4yt5CV8G?= =?us-ascii?Q?4FH4A2Kl+ODZKZwHkkAPLQf72wlT917haaNNas0YGhMIkB/3PgePvTpnA536?= =?us-ascii?Q?0XdREiEJiYgmcHFaNEDaNRnUbQVD0epysO8IMZ31WuRYwP8P+JOL53pKpNLT?= =?us-ascii?Q?HvyQNPUtFN/hqQlZWKfN9Blg5rgYTvNgm2npPQNIppJAfZbW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HZUmDEGrG1DhCWFZL+rkg9iCNp4ytSh8YKoBee3lWTlckCqTBQCUkYXNo1xp59hMG3Pxc/vAQS/hG3HWW0ow=; 7:f3fPvJodwm04ASU/jTNnyZ+VXof2X2f2V0APctHxx2zkIToFZFtpxoDPZxqHCezNHBc3sLcTuPI+gCJVAhD+Orevcty07dySiDKA/Q13PQe2sY1MDHjHN+l/vsM1ef/O5hmjMLBg1FvLSA/tE8ZJkJGslP8f75jC9y+rm+OYE2Eikit53n0BUOUmLPtJS9za9s39G5tk37YmHHsM2norBpw1LEm/SmP4794p0l5jW3wbu+QhPWMrpxQ6OBBUslcM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:58:56.4110 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 270047a8-a4b4-4ce3-6766-08d5f8bac3bd 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 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 20:58:59 -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). The flag is used when starting traffic by mlx5_traffic_enable(). When switching out of flow isolation mode, allmulti 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 allmulti mode when switching flow isolation mode * add warning message when attempting to enable allmulti 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 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_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c index 3c0373bb4d..e74fdef8b9 100644 --- a/drivers/net/mlx5/mlx5_rxmode.c +++ b/drivers/net/mlx5/mlx5_rxmode.c @@ -81,10 +81,18 @@ 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) { + DRV_LOG(WARNING, + "port %u cannot enable allmulticast mode" + " in flow isolation mode", + dev->data->port_id); + return; + } + if (priv->config.vf) mlx5_nl_allmulti(dev, 1); ret = mlx5_traffic_restart(dev); if (ret) @@ -101,10 +109,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