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 D9978A0523; Tue, 30 Jun 2020 17:25:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AB6B91C033; Tue, 30 Jun 2020 17:25:06 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40084.outbound.protection.outlook.com [40.107.4.84]) by dpdk.org (Postfix) with ESMTP id 0D4DD1BFC1 for ; Tue, 30 Jun 2020 17:25:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AyNzFpsMuWjbjEWMIzZYKumatT7avLN8D+Q6af/iwi5SXsUC6jR4D138Cw0fPpclobnwegXfBBIhliLJrNa7XNr+WtcJiT76/4Z9v72QVl9od9xPLCosKq7M2KDxqV0oDKgeWuAzZkptjAiItOyaQgFOT0MV4ntgcAp+SmTDsk6UqLWhr6Car9xV1LdXVD9BRhnP+YYehQ5Esgzkned0HqHJEzoK7muRdl3pMuRa0hqiCaK1cr+ZMJ/ThTgPvEJmTPhTZH3YcJ2T15K39BGmiv7h7r3l4FwwwmXGEDqR7aVeeeFu2h03ayKSfgrrQhDFnwLwQFfC2lKLq9qxWZtW6w== 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=9d4BE6soyFBcf7iB7E/O+/PR81ZGP93tm4TZSaWuoqU=; b=WgZwSghoW+RoWggK4j2lc+Z+DbG1tsATThalvR1+RXOoP5VYQT/00jDykbH9wmhHALKx2VPMW3Mlyramrd4YC7IWaRyhXTI3GrnY/AyvSvqmLgzaL13ENa65wDo+uvo/GhoTBgQ9Ur6Olu6WGdfnFZOXj0WvM5IzHflhQ+IuM6tpTLG++zyEkuQTX2hEF+LtPNd/SDDsheu7gmXO25Hx/LtLigZzv+qu1HNfJ+vKj+08M1oVtE856tqplaYxQkyh8Fe1QbdR+qOCEFg2MZH28J1vNiWD/ya/xhexSh33aw3X1fYVMwQwP7hgwLioizIMLAPUFG3O1A+kE9L1RZ0djg== 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=9d4BE6soyFBcf7iB7E/O+/PR81ZGP93tm4TZSaWuoqU=; b=SeHHWPQbQeQz5Mm13gW3zL2maVHkwvK6fiCrICWwc9wGXQN2/jmt/Y8ydPSzXNAWTX1yhr27CskCdSbyuF3WtrtWrWvrQh3hMwYI3RNIp0ui1yRFS1QPJPHXKmZPO6fFO28f/ipEAGEF4/FazZD6snarwpcd4sF5QAkYW6HE8rg= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (2603:10a6:20b:63::30) by AM6PR05MB5222.eurprd05.prod.outlook.com (2603:10a6:20b:3e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.23; Tue, 30 Jun 2020 15:25:04 +0000 Received: from AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::9024:accb:4d6b:805f]) by AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::9024:accb:4d6b:805f%3]) with mapi id 15.20.3131.027; Tue, 30 Jun 2020 15:25:04 +0000 From: Ori Kam To: "Jiawei(Jonny) Wang" , Slava Ovsiienko , Matan Azrad CC: "dev@dpdk.org" , Thomas Monjalon , Raslan Darawsheh , "ian.stokes@intel.com" , "fbl@redhat.com" , "Jiawei(Jonny) Wang" Thread-Topic: [PATCH 2/8] common/mlx5: glue for default miss and sample action Thread-Index: AQHWSxDCEprtkZwbLk2tjR2Sgzf3iajxS+Jw Date: Tue, 30 Jun 2020 15:25:04 +0000 Message-ID: References: <1593102379-400132-1-git-send-email-jiaweiw@mellanox.com> <1593102379-400132-3-git-send-email-jiaweiw@mellanox.com> In-Reply-To: <1593102379-400132-3-git-send-email-jiaweiw@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [147.236.152.129] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: f5294742-624e-4134-7336-08d81d09c398 x-ms-traffictypediagnostic: AM6PR05MB5222: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 0450A714CB x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bfoU73KLFTcu5dsRLtwSNnNloMcTayPIlyy0Rznj0r0+wz0WhiY2T8mVX92F8uNAR1a+MDuwwDTcP2Ke7oOUkE/sNkYBrQSdJV8oIwMKNewis7A14VqIaRCyYoTF1I23qI5+CXniuKATo0gJvvWuI3Bd0YLVzAx4HyU3HZFMvqD3v4GG4jx3I6LzMSGjAh5oibLj9LDryN5S/ixTH072CncBlgDGiDY6kbSQkVxi6ZF0hCLK2jBuklELstT05rQg5/I7GxdZUp150rEvl8Z6aRrH6xLBMFYYCZqxDKDrmITBk7VoqAXryP/tj0UVwh616GnIRa8GbMccHuQ3FtL9fg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR05MB5176.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(366004)(346002)(136003)(396003)(376002)(6506007)(26005)(53546011)(7696005)(2906002)(110136005)(54906003)(8676002)(478600001)(6636002)(8936002)(71200400001)(186003)(83380400001)(5660300002)(55016002)(86362001)(66556008)(64756008)(66446008)(66476007)(66946007)(76116006)(4326008)(33656002)(52536014)(9686003)(316002)(107886003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: K3j50sgETMwEnQ8i0dvUbrbbm5LMX4du3DHZwScNrJr5htHEaqYhvxE0Bgld1mwqfONrSmlUkDQvHZwaCGxiS82NTkGYRkqamYJtZWZ3ZVg6NKVo+h7uMF7TZDnbUxRDRUvdiqN+kZBZ326fPWe4B0ToBik4d1cE7aRox+BcQiCcGsGHBH0vabO5YlDnSrXWxWq7mdgoYRtYiARN+V+NQ1bKlJqdQUmsB5DZqqn3b6njvP5wwGrg5pNpBniSiJdVCe+Txt6xmh9OI7z43kKymhztGFbsL47Sy03Q7ddaZU08JcqAZR1+BNpbgkOxf25pHdLOwDprEzSmfqRRlaNI+03Ppw34CzycPwElyfdwUQXgjk+DKhgSkDm7MQ2OYshBVy4heEUNKqKKl+Vew9M6v7l9S/+bzOVCz8mzI3pY2XPi3iHPEheCbLADWMPyHdvPPDRPWJdAHWSm8TB3WwfWxbqvq1qOSDtvXKvFFI4HcmI6dWkcQKpCbYVWnY1+MU7X Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM6PR05MB5176.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5294742-624e-4134-7336-08d81d09c398 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jun 2020 15:25:04.5175 (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: SweKUIAqR9NsR8G7zwE/l2YszIH40pJ1NPRDz6ICZVGni++kzfo3MnaZtgR7bRfDs5smivLw0UMKA4xOGxi9xw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5222 Subject: Re: [dpdk-dev] [PATCH 2/8] common/mlx5: glue for default miss and sample 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" > -----Original Message----- > From: Jiawei Wang > Sent: Thursday, June 25, 2020 7:26 PM > To: Ori Kam ; Slava Ovsiienko > ; Matan Azrad > Cc: dev@dpdk.org; Thomas Monjalon ; Raslan > Darawsheh ; ian.stokes@intel.com; fbl@redhat.com; > Jiawei(Jonny) Wang > Subject: [PATCH 2/8] common/mlx5: glue for default miss and sample action >=20 > rdma-core introduce two new DR action: default miss and sample > action. >=20 > Add the rdma-core commands in glue to create these two actions. >=20 > Default miss action is used for the sampled packet on FDB domain, > it steering packet to eswitch manager vport. >=20 > Sample action is used for creating the sample object to implement > the sampling/mirroring function. >=20 > Signed-off-by: Jiawei Wang > --- > drivers/common/mlx5/Makefile | 10 ++++++++++ > drivers/common/mlx5/linux/meson.build | 4 ++++ > drivers/common/mlx5/linux/mlx5_glue.c | 28 > ++++++++++++++++++++++++++++ > drivers/common/mlx5/linux/mlx5_glue.h | 13 +++++++++++++ > 4 files changed, 55 insertions(+) >=20 > diff --git a/drivers/common/mlx5/Makefile b/drivers/common/mlx5/Makefile > index 622bde4..8db0604 100644 > --- a/drivers/common/mlx5/Makefile > +++ b/drivers/common/mlx5/Makefile > @@ -187,6 +187,16 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto- > config-h.sh > func mlx5dv_dump_dr_domain \ > $(AUTOCONF_OUTPUT) > $Q sh -- '$<' '$@' \ > + HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS \ > + infiniband/mlx5dv.h \ > + func mlx5dv_dr_action_create_default_miss \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_MLX5_DR_CREATE_ACTION_FLOW_SAMPLE \ > + infiniband/mlx5dv.h \ > + func mlx5dv_dr_action_create_flow_sampler \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > HAVE_MLX5DV_MMAP_GET_NC_PAGES_CMD \ > infiniband/mlx5dv.h \ > enum MLX5_MMAP_GET_NC_PAGES_CMD \ > diff --git a/drivers/common/mlx5/linux/meson.build > b/drivers/common/mlx5/linux/meson.build > index 638bb2b..95f3204 100644 > --- a/drivers/common/mlx5/linux/meson.build > +++ b/drivers/common/mlx5/linux/meson.build > @@ -160,6 +160,10 @@ has_sym_args =3D [ > 'RDMA_NLDEV_ATTR_NDEV_INDEX' ], > [ 'HAVE_MLX5_DR_FLOW_DUMP', 'infiniband/mlx5dv.h', > 'mlx5dv_dump_dr_domain'], > + [ 'HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS', > 'infiniband/mlx5dv.h', > + 'mlx5dv_dr_action_create_default_miss'], > + [ 'HAVE_MLX5_DR_CREATE_ACTION_FLOW_SAMPLE', > 'infiniband/mlx5dv.h', > + 'mlx5dv_dr_action_create_flow_sampler'], > [ 'HAVE_MLX5DV_DR_MEM_RECLAIM', 'infiniband/mlx5dv.h', > 'mlx5dv_dr_domain_set_reclaim_device_memory'], > [ 'HAVE_DEVLINK', 'linux/devlink.h', 'DEVLINK_GENL_NAME' ], > diff --git a/drivers/common/mlx5/linux/mlx5_glue.c > b/drivers/common/mlx5/linux/mlx5_glue.c > index c91ee33..ea366e2 100644 > --- a/drivers/common/mlx5/linux/mlx5_glue.c > +++ b/drivers/common/mlx5/linux/mlx5_glue.c > @@ -1047,6 +1047,30 @@ > #endif > } >=20 > +static void * > +mlx5_glue_dr_create_flow_action_default_miss(void) > +{ > +#ifdef HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS > + return mlx5dv_dr_action_create_default_miss(); > +#else > + errno =3D ENOTSUP; > + return NULL; > +#endif > +} > + > +static void * > +mlx5_glue_dr_create_flow_action_sampler( > + struct mlx5dv_dr_flow_sampler_attr *attr) > +{ > +#ifdef HAVE_MLX5_DR_CREATE_ACTION_FLOW_SAMPLE > + return mlx5dv_dr_action_create_flow_sampler(attr); > +#else > + (void)attr; > + errno =3D ENOTSUP; > + return NULL; > +#endif > +} > + > static int > mlx5_glue_devx_query_eqn(struct ibv_context *ctx, uint32_t cpus, > uint32_t *eqn) > @@ -1294,6 +1318,10 @@ > .devx_port_query =3D mlx5_glue_devx_port_query, > .dr_dump_domain =3D mlx5_glue_dr_dump_domain, > .dr_reclaim_domain_memory =3D > mlx5_glue_dr_reclaim_domain_memory, > + .dr_create_flow_action_default_miss =3D > + mlx5_glue_dr_create_flow_action_default_miss, > + .dr_create_flow_action_sampler =3D > + mlx5_glue_dr_create_flow_action_sampler, > .devx_query_eqn =3D mlx5_glue_devx_query_eqn, > .devx_create_event_channel =3D mlx5_glue_devx_create_event_channel, > .devx_destroy_event_channel =3D > mlx5_glue_devx_destroy_event_channel, > diff --git a/drivers/common/mlx5/linux/mlx5_glue.h > b/drivers/common/mlx5/linux/mlx5_glue.h > index 5d238a4..9b1487d 100644 > --- a/drivers/common/mlx5/linux/mlx5_glue.h > +++ b/drivers/common/mlx5/linux/mlx5_glue.h > @@ -77,6 +77,7 @@ > #ifndef HAVE_MLX5DV_DR > enum mlx5dv_dr_domain_type { unused, }; > struct mlx5dv_dr_domain; > +struct mlx5dv_dr_action; > #endif >=20 > #ifndef HAVE_MLX5DV_DR_DEVX_PORT > @@ -87,6 +88,15 @@ > struct mlx5dv_dr_flow_meter_attr; > #endif >=20 > +#ifndef HAVE_MLX5_DR_CREATE_ACTION_FLOW_SAMPLE > +struct mlx5dv_dr_flow_sampler_attr { > + uint32_t sample_ratio; > + void *default_next_table; > + size_t num_sample_actions; > + struct mlx5dv_dr_action **sample_actions; > +}; > +#endif > + > #ifndef HAVE_IBV_DEVX_EVENT > struct mlx5dv_devx_event_channel { int fd; }; > struct mlx5dv_devx_async_event_hdr; > @@ -303,6 +313,9 @@ struct mlx5_glue { > struct mlx5dv_devx_async_event_hdr *event_data, > size_t event_resp_len); > void (*dr_reclaim_domain_memory)(void *domain, uint32_t enable); > + void *(*dr_create_flow_action_default_miss)(void); > + void *(*dr_create_flow_action_sampler) > + (struct mlx5dv_dr_flow_sampler_attr *attr); > }; >=20 > extern const struct mlx5_glue *mlx5_glue; > -- > 1.8.3.1 Acked-by: Ori Kam Thanks, Ori