From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77EFCA04EF; Tue, 2 Jun 2020 11:39:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1818E1BFB1; Tue, 2 Jun 2020 11:38:56 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70054.outbound.protection.outlook.com [40.107.7.54]) by dpdk.org (Postfix) with ESMTP id 8DEC41BFA6 for ; Tue, 2 Jun 2020 11:38:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fSjTHdxHUdSriL8VvMwZ7m13gFrt6Tr7glqKrAw4nrdD9IVn8F4Q85XRhdQEpcgwq/AKN1PmA13z4CB9W7QNkKAdq6NSxquIYQ9jpR+Sr0nq1xGUH0isEAysAD50VXqqGgQ8Bfd5bJbq8PHEVNvBZp41CyGvT1GHNB5GPgWy7io1K1a3i3f+ZSMh+q9vI1vfZLRcYiIVfakp16V3x+1OKUPCprziRJo5ZNsKwKor2dCXsh1Yf632dRaAoEM4ziwmL5WxipnTX9M3ida5b2AjWrn4okAyXIvJAWBvRWp/+pVuWnhxAjShZL+4tF2N3gdrBsuxLokn4QedUD5w/e+L1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=achJtZcsO+vS0q86AvlpI0Zkw0Iw+Jaj9K0+0d67mwA=; b=LClBRhOfyfuYs0vgVS1G5VNktvENHbxvPuHC2hYB3bQyu7kpA1IhvfQcYP7TkwN+w03pgJPuTJom2aHcoMbojCuIy1y9TnJq/QcdD0qUvDeWJNDdDBpDu7bgnAty+sTghrLCJE7AQpAGSIdRQwM3VayCRwH9UW12EVatuZDJxt/hVyN5E0+NRpBg2NyAXeZ6U3q5Zu85Uk5wtFWzASLYDJVlMpgIei3dO4S2m3COBQginXBcX+6h+DNvU4ZrWDwvUnVQGdqZNcjG8jWWcHJfnn6zLa2s5t53QPb2wRszHaRGydzs4ZLmpmcfida79PdgpY0fJiRB+TPHiLw14iOCrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=achJtZcsO+vS0q86AvlpI0Zkw0Iw+Jaj9K0+0d67mwA=; b=kbEBKx3Tmt6vaBV5XxC4zmIZBBwW7OGCm1WK1FrDwcvNlG2uy1ZuXtdDXJ4WIoXFG+zd/gmhdqfS4kp1sF0s3JppPTVJvb47ZHyuZL2vmfabgxtvSvgdPspf+4vTMFMsFLmK5KehJTZiMzytc22pgU8RQnnbetu+Gw70oQA2syw= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR0502MB3874.eurprd05.prod.outlook.com (2603:10a6:208:1a::29) by AM0PR0502MB3650.eurprd05.prod.outlook.com (2603:10a6:208:1c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.22; Tue, 2 Jun 2020 09:38:54 +0000 Received: from AM0PR0502MB3874.eurprd05.prod.outlook.com ([fe80::2cea:8f0a:cb2f:2a85]) by AM0PR0502MB3874.eurprd05.prod.outlook.com ([fe80::2cea:8f0a:cb2f:2a85%6]) with mapi id 15.20.3045.022; Tue, 2 Jun 2020 09:38:54 +0000 From: Shiri Kuzin To: dev@dpdk.org Cc: matan@mellanox.com, rasland@mellanox.com, viacheslavo@mellanox.com Date: Tue, 2 Jun 2020 12:38:11 +0300 Message-Id: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: Content-Type: text/plain X-ClientProxiedBy: AM0PR02CA0098.eurprd02.prod.outlook.com (2603:10a6:208:154::39) To AM0PR0502MB3874.eurprd05.prod.outlook.com (2603:10a6:208:1a::29) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (94.188.199.18) by AM0PR02CA0098.eurprd02.prod.outlook.com (2603:10a6:208:154::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18 via Frontend Transport; Tue, 2 Jun 2020 09:38:53 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [94.188.199.18] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d6cee145-0445-4c77-7432-08d806d8c3b1 X-MS-TrafficTypeDiagnostic: AM0PR0502MB3650: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 0422860ED4 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YthwSsqzlq+5f7w+PINrdmERwY4L/H5rY0NC7Ts6SWE8+vx38SroOQnhE28ZyV3T0HIx1FLXiQ4SJpejicZCiPS/+ZPOrTrTJbqxrhc8KL8IJMmveoZU5CWR+d1FCUICJl7H0IOKlah0LoJr95YFqtuPwRMxCDMyhuVU5mueUO8NfiFLH0ND572kg0waMUu64PQ4GGjbI5yMO+MzEuComww1fiEHd6kqdxS+FpDfrvNlj8a+jxm8BSadkhMNwloCjUKZmu9n7Rw6GXwt3RtbvLfqV57jR2VsVObVD3nmLb6g9MiDnuY1tOKn0NiUq1dT3j272Wqa6Z4HKmVKmBW6psfIVMXty7NfYkm0kOpr+HDllON+A9Ve155YIHk53fEv X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR0502MB3874.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39860400002)(136003)(346002)(376002)(366004)(83380400001)(55016002)(66476007)(66946007)(66556008)(8676002)(956004)(2616005)(6916009)(2906002)(26005)(186003)(16526019)(8886007)(316002)(86362001)(52116002)(36756003)(6666004)(4326008)(8936002)(107886003)(5660300002)(478600001)(7696005)(309714004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: IGeOjCwjfjMola3EYqk2M7w0zwWM34ZSUHuQ/3InKb+wzrxhZMvDD8BdROaJpPDZb05g/V4gZYrmT8QVAlMcJ6oeGNy9fvSjMe0/1TOftxYPmimLJpvVDOCvnyvXfDofIWg4s1JPNhd84lAW/qeLWltzbKeonMZTSq8A3pejWPZ2VOjHb9VzvmUx7TJRX7mljZwBj51GvNZ6ugngfPLD84YfgbE+iwJaSNX57rTqXP6k3AoV0WHiFYUt3j3AViTN5w3R2ROGNnSG2AaHB0ZMCxR64wrUh7oeSKSsZ8Q0gKDU0PW4dbd45xR/SXi/h5i1lMv+XlZRzfRaGBReN1J4sZ9B22UmVpgQF06fBgc80kqvc/wOqwqdV97K10QMKiLg4O1rd+bRXRBHtBmFqo0JFL6c5Nbz2oLUJvoAsI860h+g+/Z4mQK4qsI/Y+heSl8umhjHc+Wdxy3HQa72DAhn16zbBoqWSSrl6w7Yq/ShMjc= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6cee145-0445-4c77-7432-08d806d8c3b1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2020 09:38:54.1912 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rUViiNjjnKenQR2u4KPEXrVrXzJ6MzdlWlBLqFz7HZuKq2VOb7bRAnHTThdXLScCVYazFEm/gafO9ckojH9NuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3650 Subject: [dpdk-dev] [RFC 3/3] net/mlx5: add new devarg dv_lacp_by_user 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The new devarg will control the steering of the lacp traffic. when setting dv_lacp_by_user = 0 the lacp traffic will be steered to kernel and managed there. When setting dv_lacp_by_user = 1 the lacp traffic will not be steered and the user will need to manage it. Signed-off-by: Shiri Kuzin --- drivers/net/mlx5/mlx5.c | 6 ++++++ drivers/net/mlx5/mlx5.h | 2 ++ drivers/net/mlx5/mlx5_trigger.c | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 469ff73..f015050 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -140,6 +140,9 @@ /* Enable extensive flow metadata support. */ #define MLX5_DV_XMETA_EN "dv_xmeta_en" +/* Device parameter to let the user manage the lacp traffic of bonded device */ +#define MLX5_DV_LACP_BY_USER "dv_lacp_by_user" + /* Activate Netlink support in VF mode. */ #define MLX5_VF_NL_EN "vf_nl_en" @@ -1852,6 +1855,8 @@ struct mlx5_flow_id_pool * return -rte_errno; } config->dv_xmeta_en = tmp; + } else if (strcmp(MLX5_DV_LACP_BY_USER, key) == 0) { + config->dv_lacp_by_user = !!tmp; } else if (strcmp(MLX5_MR_EXT_MEMSEG_EN, key) == 0) { config->mr_ext_memseg_en = !!tmp; } else if (strcmp(MLX5_MAX_DUMP_FILES_NUM, key) == 0) { @@ -1910,6 +1915,7 @@ struct mlx5_flow_id_pool * MLX5_DV_ESW_EN, MLX5_DV_FLOW_EN, MLX5_DV_XMETA_EN, + MLX5_DV_LACP_BY_USER, MLX5_MR_EXT_MEMSEG_EN, MLX5_REPRESENTOR, MLX5_MAX_DUMP_FILES_NUM, diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index bc57fb5..ff6bd83 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -157,6 +157,8 @@ struct mlx5_dev_config { unsigned int dv_esw_en:1; /* Enable E-Switch DV flow. */ unsigned int dv_flow_en:1; /* Enable DV flow. */ unsigned int dv_xmeta_en:2; /* Enable extensive flow metadata. */ + unsigned int dv_lacp_by_user:1; + /* Enable user to manage LACP traffic. */ unsigned int swp:1; /* Tx generic tunnel checksum and TSO offload. */ unsigned int devx:1; /* Whether devx interface is available or not. */ unsigned int dest_tir:1; /* Whether advanced DR API is available. */ diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index f123193..ef5c8f2 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -434,6 +434,10 @@ const struct rte_ether_addr cmp = { .addr_bytes = "\x00\x00\x00\x00\x00\x00", }; + struct rte_flow_item_eth lacp_spec = { + .type = 0x8809, + .dst.addr_bytes = "\x01\x80\xc2\x00\x00\x02", + }; unsigned int i; unsigned int j; int ret; @@ -464,6 +468,11 @@ " configured - only Eswitch group 0 flows are" " supported.", dev->data->port_id); } + if (!priv->config.dv_lacp_by_user && priv->pf_bond) { + ret = mlx5_flow_default_miss(dev,&lacp_spec); + if (ret) + goto error; + } if (priv->isolated) return 0; if (dev->data->promiscuous) { -- 1.8.3.1