From patchwork Mon Sep 24 19:50:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongseok Koh X-Patchwork-Id: 45235 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 96CC71B160; Mon, 24 Sep 2018 21:50:35 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0041.outbound.protection.outlook.com [104.47.0.41]) by dpdk.org (Postfix) with ESMTP id 518FA1B130 for ; Mon, 24 Sep 2018 21:50:24 +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=XE/0Ns7ObnsDqQT/FBSxOGy/gUZ1ofcP17OU06ZzR54=; b=M9qk+pnm0oCKWpD5hJub/QSlbJvRHb12l7cTCZKx7sMfHoe+EkNFejhiXvzYW62SIyy4K0sxRkTwzfJUVxBsEbgnBlAaudUg1hn7r4zAoFX/flW+vSiV7GQnWbBJO0g2DgViLUnXpTWIGwuIK7H3FepI1va+ktpiWikuA/k4mLw= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3963.eurprd05.prod.outlook.com (52.134.72.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.20; Mon, 24 Sep 2018 19:50:23 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045%2]) with mapi id 15.20.1164.017; Mon, 24 Sep 2018 19:50:23 +0000 From: Yongseok Koh To: Thomas Monjalon , Shahaf Shuler CC: "dev@dpdk.org" , Ori Kam Thread-Topic: [PATCH v2 09/11] net/mlx5: add Direct Verbs driver to glue Thread-Index: AQHUVD/UZac1Lxd6wkW4ydzmlG2LAQ== Date: Mon, 24 Sep 2018 19:50:23 +0000 Message-ID: <20180924194951.18650-10-yskoh@mellanox.com> References: <20180919064814.21645-1-yskoh@mellanox.com> <20180924194951.18650-1-yskoh@mellanox.com> In-Reply-To: <20180924194951.18650-1-yskoh@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR2001CA0039.namprd20.prod.outlook.com (2603:10b6:405:16::25) To DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB3963; 6:HMQ0+thtVbDf7U8iMBk/Ggu9A1Ypj4xYaYFXLrcJNfFz+wzOcfQyFjbpXo4UkP2A4k6V+TzWtzAP0jGSoPx4x9eFWIb2TupTMdceaw1ZFB27SdSdtyljWlVh8n2Vl2B8nmHGPh9BDCsaQ7w8P84nfkCzJGaXTl/UBVFXvsP+TrHjCNR4gumuAWcgi0g0b4ZYGpm4iozCgQaj3HUOOm1K5N/+xUodV0+w4Cd8ED29sbrOox4EaZosW+RMh3GT1F8aT3WCnC/cDk5sW+QMYkl/+UWOZGvFxEbGvzXshb/iIr6vRyWp1w13wpIlf/kPs+eRA6UDeYqd+qYE8xSDafhPyWZkCRcp7/zQpbMRNeIk2gbfrKVhDvPqiRa6A+muFEjCZyDR9AfvQOHbG5fNKLI1aBsIrJIACnXLlheHeUa6z9Ok3uObuu0w8WFHWSCXi4pERueqVyNr8G896y1D1WgX2Q==; 5:lqZUOfeHxMyYut0eNLI4RCxuJYyPDKTnqgTHLKFzYgBwvT9Xp2VJXvti9ECIGhj+lSxE/EF3+13G4hPuA+gSPxYTgqaLyyu0K3G//AVGNYmzio8xpFWYP6X8SBno0KawaXiJHqInofgmx8wNP5lAEkcDQF1gbhg81q3lGlBy1yw=; 7:qz7TjL5BL8AD/KiAUVpYrzI5DBAL9PxP/DkG7dM74GxYxQ+tTnhlNLiKl5lvvI3E90REX5DWdhSpcN0jaVHyoEurn6zPOKF8wrjhHUra0PSavAscburs4TUBoDBZnS7tLONrGk8W7eb+Q7sftv2Iph9GXIayUUz+S9XcssSXFG3iZD2Q8wQCCOeUV5tmmuMamnIYkRaajAYpTcazyCyOl/FKMbNcJs7xMR2koB+fpm/rCrpW3aHKQVLxEcsXNeG9 x-ms-office365-filtering-correlation-id: 15dd9abf-48bf-4033-a259-08d62256f711 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB3963; x-ms-traffictypediagnostic: DB3PR0502MB3963: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr 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)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699051); SRVR:DB3PR0502MB3963; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3963; x-forefront-prvs: 0805EC9467 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(1496009)(39860400002)(376002)(346002)(136003)(396003)(366004)(189003)(199004)(71190400001)(71200400001)(2906002)(97736004)(6486002)(107886003)(105586002)(8676002)(81156014)(8936002)(6636002)(81166006)(106356001)(53936002)(6512007)(6436002)(68736007)(2900100001)(5660300001)(66066001)(52116002)(478600001)(5250100002)(316002)(76176011)(386003)(6506007)(1076002)(14454004)(6116002)(54906003)(110136005)(99286004)(3846002)(26005)(7736002)(256004)(476003)(446003)(36756003)(86362001)(102836004)(2616005)(305945005)(186003)(25786009)(486006)(11346002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3963; H:DB3PR0502MB3980.eurprd05.prod.outlook.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-antispam-message-info: WmyyJuHngegvKiIRhYKAL712Ra6n/oyzyqkxARTXni4VPGXFUDUSJ6PiQCOiwRcwpjVsMJq48rrsIpCdB8JhcUS2TvjDgq7crD9WEsYZESThueACg1baNfL9lwf6mt6GvwJL+u7hTUDsaKw67rjRORTwQIyAg9zNOsP0Z0rG1dZLiMmM59wwRQtdwKxHtp9FWiqq6plGJkEp03JvFuL6OKKMe85CSt5GP2fKGI4zDswCD3fvpCbn/rZ2rNt5oCW7zNPII+O5KFO5TzHImdP3T8TBHPMdp2B3joLHJytRLdwPIa5IVSyfoWi5pRzv1AYVSR65+WtkMoaf7WiJHyUFtghWHsPreifiFdp7Tn/0f3A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15dd9abf-48bf-4033-a259-08d62256f711 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2018 19:50:23.2007 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3963 Subject: [dpdk-dev] [PATCH v2 09/11] net/mlx5: add Direct Verbs driver to glue 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" From: Ori Kam This commit adds all Direct Verbs required functions to the glue lib. Signed-off-by: Ori Kam Acked-by: Yongseok Koh --- drivers/net/mlx5/Makefile | 2 +- drivers/net/mlx5/meson.build | 2 +- drivers/net/mlx5/mlx5_glue.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ drivers/net/mlx5/mlx5_glue.h | 15 +++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index d510a4275..4243b37ca 100644 --- a/drivers/net/mlx5/Makefile +++ b/drivers/net/mlx5/Makefile @@ -8,7 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_pmd_mlx5.a LIB_GLUE = $(LIB_GLUE_BASE).$(LIB_GLUE_VERSION) LIB_GLUE_BASE = librte_pmd_mlx5_glue.so -LIB_GLUE_VERSION = 18.05.0 +LIB_GLUE_VERSION = 18.11.0 # Sources. SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5.c diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index 8075496f7..3d09ece4f 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -4,7 +4,7 @@ pmd_dlopen = get_option('enable_driver_mlx_glue') LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so' -LIB_GLUE_VERSION = '18.05.0' +LIB_GLUE_VERSION = '18.11.0' LIB_GLUE = LIB_GLUE_BASE + '.' + LIB_GLUE_VERSION if pmd_dlopen dpdk_conf.set('RTE_LIBRTE_MLX5_DLOPEN_DEPS', 1) diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c index 84f9492a7..48590df5b 100644 --- a/drivers/net/mlx5/mlx5_glue.c +++ b/drivers/net/mlx5/mlx5_glue.c @@ -346,6 +346,48 @@ mlx5_glue_dv_create_qp(struct ibv_context *context, #endif } +static struct mlx5dv_flow_matcher * +mlx5_glue_dv_create_flow_matcher(struct ibv_context *context, + struct mlx5dv_flow_matcher_attr *matcher_attr) +{ +#ifdef HAVE_IBV_FLOW_DV_SUPPORT + return mlx5dv_create_flow_matcher(context, matcher_attr); +#else + (void)context; + (void)matcher_attr; + return NULL; +#endif +} + +static struct ibv_flow * +mlx5_glue_dv_create_flow(struct mlx5dv_flow_matcher *matcher, + struct mlx5dv_flow_match_parameters *match_value, + size_t num_actions, + struct mlx5dv_flow_action_attr *actions_attr) +{ +#ifdef HAVE_IBV_FLOW_DV_SUPPORT + return mlx5dv_create_flow(matcher, match_value, + num_actions, actions_attr); +#else + (void)matcher; + (void)match_value; + (void)num_actions; + (void)actions_attr; + return NULL; +#endif +} + +static int +mlx5_glue_dv_destroy_flow_matcher(struct mlx5dv_flow_matcher *matcher) +{ +#ifdef HAVE_IBV_FLOW_DV_SUPPORT + return mlx5dv_destroy_flow_matcher(matcher); +#else + (void)matcher; + return 0; +#endif +} + alignas(RTE_CACHE_LINE_SIZE) const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){ .version = MLX5_GLUE_VERSION, @@ -392,4 +434,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){ .dv_set_context_attr = mlx5_glue_dv_set_context_attr, .dv_init_obj = mlx5_glue_dv_init_obj, .dv_create_qp = mlx5_glue_dv_create_qp, + .dv_create_flow_matcher = mlx5_glue_dv_create_flow_matcher, + .dv_destroy_flow_matcher = mlx5_glue_dv_destroy_flow_matcher, + .dv_create_flow = mlx5_glue_dv_create_flow, }; diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h index e584d3679..f6e4e3842 100644 --- a/drivers/net/mlx5/mlx5_glue.h +++ b/drivers/net/mlx5/mlx5_glue.h @@ -39,6 +39,13 @@ struct mlx5dv_qp_init_attr; struct mlx5dv_wq_init_attr; #endif +#ifndef HAVE_IBV_FLOW_DV_SUPPORT +struct mlx5dv_flow_matcher; +struct mlx5dv_flow_matcher_attr; +struct mlx5dv_flow_action_attr; +struct mlx5dv_flow_match_parameters; +#endif + /* LIB_GLUE_VERSION must be updated every time this structure is modified. */ struct mlx5_glue { const char *version; @@ -122,6 +129,14 @@ struct mlx5_glue { (struct ibv_context *context, struct ibv_qp_init_attr_ex *qp_init_attr_ex, struct mlx5dv_qp_init_attr *dv_qp_init_attr); + struct mlx5dv_flow_matcher *(*dv_create_flow_matcher) + (struct ibv_context *context, + struct mlx5dv_flow_matcher_attr *matcher_attr); + int (*dv_destroy_flow_matcher)(struct mlx5dv_flow_matcher *matcher); + struct ibv_flow *(*dv_create_flow)(struct mlx5dv_flow_matcher *matcher, + struct mlx5dv_flow_match_parameters *match_value, + size_t num_actions, + struct mlx5dv_flow_action_attr *actions_attr); }; const struct mlx5_glue *mlx5_glue;