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 C087AA04EF; Tue, 2 Jun 2020 11:38:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 96EC91BF75; Tue, 2 Jun 2020 11:38:50 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80077.outbound.protection.outlook.com [40.107.8.77]) by dpdk.org (Postfix) with ESMTP id 7D435F72 for ; Tue, 2 Jun 2020 11:38:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fm6W18M+PRiN78yzDUUZJkYsW5fABT6SnyV9/Iy/wordHC1rOdEFhueV0xe51WBUwzNoyMafCck8YHzuVz6J+ABvf7d1+X0/YRvZpsfwyk+9fhJb7/R2annc8qjCZQT8sw7dSq74ozFrj1fvmUCXWn9OBnYV7j8UcrkksStl2fy20MkYarM5AtqGKQc681kgWiuM7WLoWuH22WdpIWZVMHyoJK9fsglbal4CuB30cbupjTPtJHwOoRz6zmXU31GofdiIj0CQ3x9ubV5z54BWZ8k6ZU8c/2y3OVyU2mW40cLhxyGnwbCCeZ3xOoqXpH6SiqPAxtzXaJv0hW21qo3QUQ== 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=RuNHybhM5MXxPXcFtGdOwcsTq09SdFEFHkRb+EU2i2w=; b=Q4ULZRm8bLdLoKtSmVLD9IPDZawf74JnIFqnLisbrmkUx+jGCPa1al8TdnPntY/zm8cUA2QYEe8vvnsb2NOgpLcKXIIze7PyKmHB0WKCgDZ/DMAOcFuhf/mVBW0g7dx7A41AfavW9p/l3DtFUz3NdQXagB5uKaL/hWDNRRx/+IbSvJIgm7mHcxLtTrFA9C6VRFwmXDgsTQUT9hQELkMx9ItKgN9TqGzWJFn8cmQLRU3BEhEBKnvfOf2P2WvHO2fBQkDpWZP7ZeDDmfrrn1Bj6jXZC3fiHiJyhKHviDGL+wOu5jZSBb8isM2KArUWZj1hdblB0LvnbngfHbCrs3UVUg== 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=RuNHybhM5MXxPXcFtGdOwcsTq09SdFEFHkRb+EU2i2w=; b=U2AzgZAKJ3d22su/ryj/gjHgSc3jyp0WfJWO6ZMLXCQJlWPKYqlmJh/SobzfKEpUU4aafVK/7a2DHDDBX+2HrkKFCrSKPMU9Phhf+HAuIlxab7c4WH0+1JR0OwxqQTAmid18BxFNvTAnNI9XSqTvAqUbJCTrwm31/SMxfFWz1J8= 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:47 +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:47 +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:09 +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:46 +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: 1078ac2e-b513-42e6-e416-08d806d8bfb8 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:4714; X-Forefront-PRVS: 0422860ED4 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QeebwpS4be0MfOjHKmw6OAzLb+Gf6Sb8QoSX0hrTa9LO12BBjFrWcU2BUZlHh/+uf1p8D6bQCROJQGn83SMLB012tgSUuCMFYZZyYdLwnHdBIeahBMGnS4a0erADxOPVxklzp+Su6QQvzop8sQfoH0HoYih1GEgNzFJv+vL+IY9aR9lncL6IEqczxENhcPAg+Kd5AxeRtV7GwS9+5c45Bas9KqZnK+BbPjE4/a8pjKKi3rwewhMyN8WiVvZZfzdFna/skK+oTh+766zfbLDlgMacLvb5tovUWj7Vv/mA1dz4Z5GfSqv6y46f8OY9w1D/ 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)(55016002)(66476007)(66946007)(66556008)(8676002)(956004)(2616005)(6916009)(2906002)(26005)(186003)(16526019)(8886007)(316002)(86362001)(52116002)(36756003)(6666004)(4326008)(8936002)(107886003)(5660300002)(478600001)(7696005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: waDmsrZW2uljFuWg8lG1quU1Ku4aolVhb9k3G/3QT+hLmE11v68TYj/m8IOvu2ehg09u3QeeyjfF49OVrNvxXh9n97A4v4pymjfSO4ELT8G3LHX1pTWfnUPsT0+Fzb5A/aFndQUM3HBw7P72MPUjBf8G0jyHimX5Auk4s5Kd9Z/+3VzLoUQ66YHhCaHxwTFxhPpPKtdl4u0GHi0HKYW8eFzNhlZkhTQpKjpDK4GA4Fd1OYs4ynTKE++QPVEJN33/yv+QAY1Kcn8T1hpmMH5G46kdiooVY6fWE7rApdwYSBXQyfQqCIKZzz/+L8hFnQ36EJszNuXc086IfymRww/9jpsmkI2exjeq1xAW75dIwV2Ae2q00Txpcq9cRLZ1Xkl3WHT88UgECc44m61V//LcX/il4a8yEPIa8k2PcV6+g1Wy71nGgeomFGhHGBYRc2EaFeNQEk3eWNpfe1CBqftcyZuPFgypdXzyFFDU44cBVsQ= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1078ac2e-b513-42e6-e416-08d806d8bfb8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2020 09:38:47.4181 (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: cYCUv8b1T90WOjVEuf2fUnx0WZivlhw/SI9ro+UxHNjaM95lHTNeVusMBJ6kGN+qRQO6hq2u4q7u2NuL+w3DwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3650 Subject: [dpdk-dev] [RFC 1/3] common/mlx5: add default miss action 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" Add dv_create_action_default_miss wrapper function for the action added to the rdma-core MLX5DV_FLOW_ACTION_DEFAULT_MISS. When a packet matches MLX5DV_FLOW_ACTION_DEFAULT_MISS action it is steered to the default miss of the verbs steering domain. Signed-off-by: Shiri Kuzin --- drivers/common/mlx5/Makefile | 5 +++++ drivers/common/mlx5/meson.build | 2 ++ drivers/common/mlx5/mlx5_glue.c | 13 +++++++++++++ drivers/common/mlx5/mlx5_glue.h | 1 + 4 files changed, 21 insertions(+) diff --git a/drivers/common/mlx5/Makefile b/drivers/common/mlx5/Makefile index 0d8cc1b..c5c979a 100644 --- a/drivers/common/mlx5/Makefile +++ b/drivers/common/mlx5/Makefile @@ -153,6 +153,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh enum MLX5DV_FLOW_ACTION_COUNTERS_DEVX \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ + HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS \ + infiniband/mlx5dv.h \ + enum MLX5DV_FLOW_ACTION_DEFAULT_MISS \ + $(AUTOCONF_OUTPUT) + $Q sh -- '$<' '$@' \ HAVE_IBV_DEVX_ASYNC \ infiniband/mlx5dv.h \ func mlx5dv_devx_obj_query_async \ diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index 5a802ba..9ba90b7 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -120,6 +120,8 @@ has_sym_args = [ 'mlx5dv_devx_obj_create' ], [ 'HAVE_IBV_FLOW_DEVX_COUNTERS', 'infiniband/mlx5dv.h', 'MLX5DV_FLOW_ACTION_COUNTERS_DEVX' ], + [ 'HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS', 'infiniband/mlx5dv.h', + 'MLX5DV_FLOW_ACTION_DEFAULT_MISS' ], [ 'HAVE_IBV_DEVX_ASYNC', 'infiniband/mlx5dv.h', 'mlx5dv_devx_obj_query_async' ], [ 'HAVE_IBV_DEVX_QP', 'infiniband/mlx5dv.h', diff --git a/drivers/common/mlx5/mlx5_glue.c b/drivers/common/mlx5/mlx5_glue.c index f270f67..62e15cb 100644 --- a/drivers/common/mlx5/mlx5_glue.c +++ b/drivers/common/mlx5/mlx5_glue.c @@ -795,6 +795,17 @@ #endif } +static void * +mlx5_glue_dr_create_flow_action_default_miss(void) +{ +#if defined(HAVE_MLXDV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS) + return mlx5dv_dr_action_create_default_miss(); +#else + errno = ENOTSUP; + return NULL; +#endif +} + static int mlx5_glue_dv_destroy_flow(void *flow_id) { @@ -1264,6 +1275,8 @@ .dv_create_flow_action_tag = mlx5_glue_dv_create_flow_action_tag, .dv_create_flow_action_meter = mlx5_glue_dv_create_flow_action_meter, .dv_modify_flow_action_meter = mlx5_glue_dv_modify_flow_action_meter, + .dr_create_flow_action_default_miss = + mlx5_glue_dr_create_flow_action_default_miss, .dv_destroy_flow = mlx5_glue_dv_destroy_flow, .dv_destroy_flow_matcher = mlx5_glue_dv_destroy_flow_matcher, .dv_open_device = mlx5_glue_dv_open_device, diff --git a/drivers/common/mlx5/mlx5_glue.h b/drivers/common/mlx5/mlx5_glue.h index 81d6a22..f5bec6a 100644 --- a/drivers/common/mlx5/mlx5_glue.h +++ b/drivers/common/mlx5/mlx5_glue.h @@ -237,6 +237,7 @@ struct mlx5_glue { (struct mlx5dv_dr_flow_meter_attr *attr); int (*dv_modify_flow_action_meter)(void *action, struct mlx5dv_dr_flow_meter_attr *attr, uint64_t modify_bits); + void *(*dr_create_flow_action_default_miss)(); int (*dv_destroy_flow)(void *flow); int (*dv_destroy_flow_matcher)(void *matcher); struct ibv_context *(*dv_open_device)(struct ibv_device *device); -- 1.8.3.1