From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10050.outbound.protection.outlook.com [40.107.1.50]) by dpdk.org (Postfix) with ESMTP id F24471B149 for ; Tue, 25 Sep 2018 01:18:06 +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=uNe7gB7oueC2l5uXZodrSyOLwNNXY099+l23GuJX8Pnxz6h69aeC3ieIaBmom+U2/SrKP5iHCkmMg6MeF7+uBMIQhl71DoLfuvouUgXwcdZc0nW5dEVV5IYGfEqDSPSSMoL0b396ZAvN+cx6+Z4wcW9yPh5f7mx/Yb+pNcEB3YQ= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3996.eurprd05.prod.outlook.com (52.134.65.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.25; Mon, 24 Sep 2018 23:17:51 +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 23:17:51 +0000 From: Yongseok Koh To: Thomas Monjalon , Shahaf Shuler CC: "dev@dpdk.org" , Ori Kam Thread-Topic: [PATCH v3 09/11] net/mlx5: add Direct Verbs driver to glue Thread-Index: AQHUVFzQIWLFjOo2okiZRAf5l0/6Fw== Date: Mon, 24 Sep 2018 23:17:51 +0000 Message-ID: <20180924231721.15799-10-yskoh@mellanox.com> References: <20180919072143.23211-1-yskoh@mellanox.com> <20180924231721.15799-1-yskoh@mellanox.com> In-Reply-To: <20180924231721.15799-1-yskoh@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR03CA0021.namprd03.prod.outlook.com (2603:10b6:404:23::31) 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; DB3PR0502MB3996; 6:Q6yjT6+q67wPmwieTEKkRxbg7fF0XbMpJlmIZrCfkh6oMWMnvT7M/Xkp7a70NUg09LW51Z5RMxv4waAnE0O9/CbcO/t2dcBXdufV4Y1Utk+fCt+OIB6CjZjXtSQeGg9/Qg3yd/MsnJ5460GqX+l/Ew9G4GtV/Eu9LtehrbKUzY1sS1XGKEayoLT4VbiLr+/IqRmy00UAHHazSEgmraNtFdC1mzatnXinoVTCEzkcM0JzUFGaHU8CxZVpFt9TVB2xt3+qtHMdJbTpuEhBoBxKaplDcg+wJt9/sICLTEnjffpqeZYc6QMI+YIsCIXrAAZ8kqGo1nRqwhfVAvuGuyG4ZkOU9dYHFGr8jpI0XRYaw1NC2EQyDeAGV4h2KPdWQWigbBTnBOWIy4iOejQCTEm7mKumYezah8bstVZ4lwVFGVL+NmrFjs8Ctb5+0zf9i2CYnFNNsDYnkZ8sjo4uBEKwNg==; 5:HIOWeiamiVxO9tiY7xKYCycIHsQWvHOauNOE65N0NrV2G3gOPp7Fv0g8p2+OSf6nfzgWE41gDIL2zEx3n3Q+vy4YP82SazUc3pP/ekEvV96jkwy3qJLm1eS0kT5O/nPextaH1BBloBDBUE8Yj0sloOm50yeasvxMC5PMUqF/eWc=; 7:yJ+yeOAfKSAnGMAx8nk0N/VXtdfop9bueoS954WeUEbVqGTF81SupsJ+a7qNo4BZIdUsu0rX8S4y0iWXSOvTxIZZl4tEQXbHMX6gc3PP6w8pQtnnOH+bnCR0mf6QL3D5qKrwt15LEPF11/wKy3DOD3OUt+QEfcW3mlRROEMUQ6kBwFF/8h5k2/OukI0R7T7aIq81Y+BR8GCjckdhFeLpgcDi1od5kzH0p7WCKx7nSLdHH4I9HoNQ8DYxZe6TnTkm x-ms-office365-filtering-correlation-id: 00d10f86-6a72-489d-42b9-08d62273f29e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB3996; x-ms-traffictypediagnostic: DB3PR0502MB3996: 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)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(6055026)(149066)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051); SRVR:DB3PR0502MB3996; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3996; x-forefront-prvs: 0805EC9467 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(1496009)(396003)(376002)(346002)(366004)(39860400002)(136003)(199004)(189003)(66066001)(2616005)(476003)(446003)(486006)(11346002)(6436002)(305945005)(7736002)(386003)(6506007)(6486002)(6512007)(186003)(102836004)(5250100002)(76176011)(25786009)(26005)(68736007)(6116002)(54906003)(110136005)(99286004)(1076002)(3846002)(71200400001)(52116002)(86362001)(53936002)(71190400001)(97736004)(8936002)(107886003)(256004)(4326008)(316002)(2900100001)(81156014)(8676002)(36756003)(81166006)(105586002)(2906002)(106356001)(6636002)(478600001)(5660300001)(14454004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3996; H:DB3PR0502MB3980.eurprd05.prod.outlook.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-antispam-message-info: 6BCQ9Dnfb8Y2mG++9M51C0ncf5N4vxPev/sF1H9hE2DYVy3opLgWAe/7e87jyYmFqz0Sj/wTz9r17gnvFhnG2dDmwpfBr6OfAqy5cW8liIr9seeKis8G7ykzjctVa0Cm0On+KmNGZW/wO743/eTAgGNxvPF0ILbYoqpQjds4gXEHko1ETA2UNTSBULznOL8nYtQunvdx8A6yRpfB0bfSqVp8rXtbgoardsDDZhJX5C7OeNi6w4RiFzGLzE+5W48mUn5sxoCQ4m5yqzW+bGtjO+8DYc4NwxgDagm8cVRwwDvntbD6xC9qG37pCMNfeUB66Y/5YwBbSjpRXiFSQPT58W/7B8y6pnVksfm1GE090ZM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00d10f86-6a72-489d-42b9-08d62273f29e X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2018 23:17:51.0295 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3996 Subject: [dpdk-dev] [PATCH v3 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: , X-List-Received-Date: Mon, 24 Sep 2018 23:18:07 -0000 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 =3D librte_pmd_mlx5.a LIB_GLUE =3D $(LIB_GLUE_BASE).$(LIB_GLUE_VERSION) LIB_GLUE_BASE =3D librte_pmd_mlx5_glue.so -LIB_GLUE_VERSION =3D 18.05.0 +LIB_GLUE_VERSION =3D 18.11.0 =20 # Sources. SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) +=3D 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 @@ =20 pmd_dlopen =3D get_option('enable_driver_mlx_glue') LIB_GLUE_BASE =3D 'librte_pmd_mlx5_glue.so' -LIB_GLUE_VERSION =3D '18.05.0' +LIB_GLUE_VERSION =3D '18.11.0' LIB_GLUE =3D 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 } =20 +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 =3D &(const struct mlx5_glue){ .version =3D MLX5_GLUE_VERSION, @@ -392,4 +434,7 @@ const struct mlx5_glue *mlx5_glue =3D &(const struct ml= x5_glue){ .dv_set_context_attr =3D mlx5_glue_dv_set_context_attr, .dv_init_obj =3D mlx5_glue_dv_init_obj, .dv_create_qp =3D mlx5_glue_dv_create_qp, + .dv_create_flow_matcher =3D mlx5_glue_dv_create_flow_matcher, + .dv_destroy_flow_matcher =3D mlx5_glue_dv_destroy_flow_matcher, + .dv_create_flow =3D 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 =20 +#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); }; =20 const struct mlx5_glue *mlx5_glue; --=20 2.11.0