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 F03871B503; 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=6n7Dq5lmSgwudkLjklFXgE87hGbsaCXQpBasjj49H1o=; b=fQ3kFOn9H3hozcCaIie7q40u+4EDvWvQWc4SlrjACx6hFm8dx4OAKY6MMkd/O2uKQgADe5Yc9j+yzlR0wK8j2wavodHstUh9HD6AbNXVids6gpDHYCJL6fMSHp2ut7qRIAF/XQpo0EbFPoM7p067l5HD1+6q545M3mFOBVoOdB0= 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:49 +0000 From: Yongseok Koh To: shahafs@mellanox.com Cc: dev@dpdk.org, Yongseok Koh , stable@dpdk.org Date: Thu, 2 Aug 2018 14:06:32 -0700 Message-Id: <20180802210632.11006-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180802210632.11006-1-yskoh@mellanox.com> References: <20180802010557.16648-1-yskoh@mellanox.com> <20180802210632.11006-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: 0fe476e1-7862-4826-7e09-08d5f8bbdd9f 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:wM8jA1Tn+B08m1lAsPo4M62Swu6V3rlvOKjqXk0LFU9enUJPXQMnq/5f7IeT5KwfmQFcQLR1wp3IS08RK5Tz8nYqw0AXbflhKuVyJSff3hpeOBjdQVAavliPkDiw7MBnGbeR0ws79haDwYH71ozOcIXL1gRUsLHVO6wfZkWT/9mOI7xupZqGwmAHvTt0R8ZKas/Da9Ak/g+uFFEnkPCyuqAlbCSXE1gea1jWChqvYuTXUt1SONNHJv4Xa8oXKgWw; 25:xNxvfwDkE7ORLiZrWax6XSc7U0h33msWJ7RWKPdJgv5W59zavFBiGu7xqk0fnqxJio+y0JhqfnwL/fmKIuwSaTLT/BEBXRYDXv/fJUwIacqvRIfz3PDrONW8LcoV1YrxpgLdJz10svGKbbNAmde3rO/uWNzML2LwgbrGiucz1Y2HIctWueAaj0E6lSpi33CSq24oqPNusw91v8c9E1NeKTTwDRLTwO2t08OnYHkNnEw7YIR6g+NQrFG8saWh/FVnKkOSrShkIgKhLE4EOaRT5MdoOqJVcfMn6UdaC7ACEBcNce7/nKBtHw3vdHjy7K0V3Vxm0EGfsRuaqPBYNH33zA==; 31:dpp6ngmaffbcV6z0rXq9FBHzVjNtwZloaezZaRhEAvweazbQI4PCdU1aIg/I5XtMP/IctzsoZ57Ypt9qyS/yhJeFjT6SPnvfmkqxMf0jxCtOhL9IKLFEE+B9nj1C/5QNF4LOcNuWznsF9OO8qwcTma9QgI0AKck14TcTTA/RCJJRTeDNFf2bhwixHZD5Hu1bBnCKmDYwRkNK/vn6G+6QgvlHowKH8cW6+eexP4AgCe8= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2041: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2041; 20:NLd0grd4Jr1x8FP2EJjmD/MtySfNfygjv21RrXXzuhSjlQJ1m24DytcBuMywAjrvmEYSY9W3qEd9Dlrg4KS4tdvSJAoRwoxFI5O86aNSHptLLVJrojn+4toQFheXJSHKfHFCk3FAmuSFRKaRfkDJSW6GbLq8X4wv2P8erLsMo0Biks09Gkfx9GTuzNF0w1VpCei/ChvvRWb/DV8n+UgJwHNBj83MHY3p3gVm6OH69ukgJXqTPiWHFJWnkqAXZ0HQrhlueeI0Y/LUH3jrZkzqRQZVMy/A71rWa6QlIbi5osqWMLutHIaohkxBYHLOhu6q/EOmx/eYSGE9hlt/X+qyJoGZgZvZ4MEJkMJFLcjT6w4ljakUtF53NMhEcHxzI7JVjAl574Ks+fRjI53ouLLQDJDEZxfbpfEHODkff6faHGcEubXlr0XPFJGilzOW+lIcbNH7HkCTNUjzsWdh5LDkVpiFvrI0SCx+m7DnTgymb0ZSOFDMfUdp95c+vh7FDjJd; 4:e5bOLTjrP6ZUwIOglL+wUlzH5oE4RN2Fm+8vgI8/C3gLLf/LnHnNEBaKFZZuPAhCOhl0D5yWC9sp3mMCqNep7L56NO7pF3XFMKt4O23rDV9iVPjxSyXilaROT/p/H58xQVhJQkKuVFYHakFHvxLJxEXM/G6xuoJ7AV+H2eh62EpAYBT5xQnNhX8Eg2qqVmtgZ1DHMLmGS7IPmBLxkv89uiI8pJkkGvOzxZw/dGeoMnBSlGfMhFIWu3YsnVqo26JqFs5StH0szUMn4EIDTj5//w== 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)(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); 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:sJdHHDwE+lK0SYPIVMWnwP1GSWHxzmMcbLo3DV5?= =?us-ascii?Q?Nvb6H3TRxEXV68+5PFyyxriUJgmuwYsZtMslCZP9KYVdcK6LrPOcbXFd7NFk?= =?us-ascii?Q?xVG/HewPoGsrnzDBlhO3GPk3F2DoPc89hXKeoJYXyMw1lpLUqMn3UCsD3Gpu?= =?us-ascii?Q?MDtYZPqcnmVjWwXY6rIcIrRCIOQ7gBwUsS6sbi3MS6U9ox0zoffwvAhCggUk?= =?us-ascii?Q?VGPM4IBSk6HGMwR6+Aj5yeBXOrb7LmKihzoJmpGrWou+f6dXoXFv95fkMOPC?= =?us-ascii?Q?u2EdC8GKdijDpFT+FmPoD3Z35poAYfTfqU5GtrquQvCM8qYUwSxmtM5amwOK?= =?us-ascii?Q?LVk5mEwMbuXPluPhsG6DM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KK0CeMqCrtO9My/FIFWQwTi9mAYFHdUN+HPpX2BTMLyZcsyrF2yb/Bc5/7jBHT72WPBeIYBoBxvCswBNI6YYL8r5GuqlU4VNFg8D0wu39C3cs=; 7:h9OZr69E9kYqTEmGyRIXg5ml9hhZGZRBxi01cN5Fp39oBoe3EoGoPY5JZP+YrsAUO1FbK8LO7Cunzz4GIjNuyiMSXcbyuftANNs2W6tXgtKM/YV6TG9oVziJ02QzU0A+VRNfzzzy1kiQcvcWCSyf5S8CuDKRrn2iwrVBpcL45/4+9YdC5UXeKPs8NdjqI5R3bMlmz+K3QO6D68VSmGdCEW4iP6XocSPv7MEjEwV3/8HZm8z4iQKK0cAPjXht1PGo SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 21:06:49.2693 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fe476e1-7862-4826-7e09-08d5f8bbdd9f 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 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 21:06:52 -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