From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ED844A0524; Tue, 13 Apr 2021 18:44:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B618D16111F; Tue, 13 Apr 2021 18:44:36 +0200 (CEST) Received: from mail-108-mta165.mxroute.com (mail-108-mta165.mxroute.com [136.175.108.165]) by mails.dpdk.org (Postfix) with ESMTP id C5F611610EB for ; Tue, 13 Apr 2021 18:44:34 +0200 (CEST) Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta165.mxroute.com (ZoneMTA) with ESMTPSA id 178cc1ebbdb0004964.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Tue, 13 Apr 2021 16:44:29 +0000 X-Zone-Loop: f67addfa6971e30f0d02400c8c023dc175ad66897bda X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=x2sRmcg5nmik/pGG4bYyMjzupoVG3OCiQ0JVrRMJrzY=; b=QSulQrXuOOgxqGRRP4hEn7Y+Ac xQbQPaueKkqn74FOtd2YfWPrk8g+pHHZK5Jat5u6bysg5qTLPyQd+c9an6QY83wXZbS/LE60JdZT3 n46Y9ul0KXWQyIhEXyyzY6xXHZUyDqydb0xNBvhYzCx+5REPlh3i52wWpM8zoXc21eHCtSNOASFpJ oNECbbQcGNHoe6SBFa/i4Zwd11dsUH+ejqGR7WNg7XGxABevlS0P9LAjiy0154JVDdCdDpbhrqANn 5JevVGNtbFsI7gEWQJ/5Pit/U5hawXwXy108Y0jdesTa2GPXNwUiqz2L3T7kcBoWYzwNCz/WTE8eZ Qtb4IgFQ==; To: Haifei Luo , dev@dpdk.org Cc: orika@nvidia.com, viacheslavo@nvidia.com, rasland@nvidia.com, xuemingl@nvidia.com, Matan Azrad , Shahaf Shuler , Neil Horman , David Marchand References: <1615277716-64404-1-git-send-email-haifeil@nvidia.com> <1617775762-171898-1-git-send-email-haifeil@nvidia.com> <1617775762-171898-4-git-send-email-haifeil@nvidia.com> From: "Kinsella, Ray" Message-ID: <4b4fff72-1f94-830f-71d5-adf60697a57d@ashroe.eu> Date: Tue, 13 Apr 2021 17:44:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <1617775762-171898-4-git-send-email-haifeil@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu Subject: Re: [dpdk-dev] [PATCH v2 3/5] common/mlx5: add mlx5 APIs for single flow dump feature X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 07/04/2021 07:09, Haifei Luo wrote: > add mlx5 APIs for single flow dump feature > > Signed-off-by: Haifei Luo > --- > drivers/common/mlx5/linux/meson.build | 2 ++ > drivers/common/mlx5/linux/mlx5_glue.c | 13 +++++++++++++ > drivers/common/mlx5/linux/mlx5_glue.h | 1 + > drivers/common/mlx5/mlx5_devx_cmds.c | 14 ++++++++++++++ > drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ > drivers/common/mlx5/rte_common_mlx5_exports.def | 1 + Perhaps check with David Marchand on this, I suspect amendments to the exports file will soon be redundant. > drivers/common/mlx5/version.map | 1 + > 7 files changed, 34 insertions(+) > > diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build > index 220de35..3f42163 100644 > --- a/drivers/common/mlx5/linux/meson.build > +++ b/drivers/common/mlx5/linux/meson.build > @@ -186,6 +186,8 @@ has_sym_args = [ > 'mlx5dv_dr_action_create_aso' ], > [ 'HAVE_INFINIBAND_VERBS_H', 'infiniband/verbs.h', > 'INFINIBAND_VERBS_H' ], > + [ 'HAVE_MLX5_DR_FLOW_DUMP_RULE', 'infiniband/mlx5dv.h', > + 'mlx5dv_dump_dr_rule' ], > ] > config = configuration_data() > foreach arg:has_sym_args > diff --git a/drivers/common/mlx5/linux/mlx5_glue.c b/drivers/common/mlx5/linux/mlx5_glue.c > index 964f7e7..d3bd645 100644 > --- a/drivers/common/mlx5/linux/mlx5_glue.c > +++ b/drivers/common/mlx5/linux/mlx5_glue.c > @@ -1101,6 +1101,18 @@ > } > > static int > +mlx5_glue_dr_dump_single_rule(FILE *file, void *rule) > +{ > +#ifdef HAVE_MLX5_DR_FLOW_DUMP_RULE > + return mlx5dv_dump_dr_rule(file, rule); > +#else > + RTE_SET_USED(file); > + RTE_SET_USED(rule); > + return -ENOTSUP; > +#endif > +} > + > +static int > mlx5_glue_dr_dump_domain(FILE *file, void *domain) > { > #ifdef HAVE_MLX5_DR_FLOW_DUMP > @@ -1423,6 +1435,7 @@ > .devx_wq_query = mlx5_glue_devx_wq_query, > .devx_port_query = mlx5_glue_devx_port_query, > .dr_dump_domain = mlx5_glue_dr_dump_domain, > + .dr_dump_rule = mlx5_glue_dr_dump_single_rule, > .dr_reclaim_domain_memory = mlx5_glue_dr_reclaim_domain_memory, > .dr_create_flow_action_sampler = > mlx5_glue_dr_create_flow_action_sampler, > diff --git a/drivers/common/mlx5/linux/mlx5_glue.h b/drivers/common/mlx5/linux/mlx5_glue.h > index 9e385be..97462e9 100644 > --- a/drivers/common/mlx5/linux/mlx5_glue.h > +++ b/drivers/common/mlx5/linux/mlx5_glue.h > @@ -313,6 +313,7 @@ struct mlx5_glue { > uint32_t port_num, > struct mlx5dv_devx_port *mlx5_devx_port); > int (*dr_dump_domain)(FILE *file, void *domain); > + int (*dr_dump_rule)(FILE *file, void *rule); > int (*devx_query_eqn)(struct ibv_context *context, uint32_t cpus, > uint32_t *eqn); > struct mlx5dv_devx_event_channel *(*devx_create_event_channel) > diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c > index c90e020..c0b6fdb 100644 > --- a/drivers/common/mlx5/mlx5_devx_cmds.c > +++ b/drivers/common/mlx5/mlx5_devx_cmds.c > @@ -1579,6 +1579,20 @@ struct mlx5_devx_obj * > return -ret; > } > > +int > +mlx5_devx_cmd_flow_single_dump(void *rule_info __rte_unused, > + FILE *file __rte_unused) > +{ > + int ret = 0; > +#ifdef HAVE_MLX5_DR_FLOW_DUMP_RULE > + if (rule_info) > + ret = mlx5_glue->dr_dump_rule(file, rule_info); > +#else > + ret = ENOTSUP; > +#endif > + return -ret; > +} > + > /* > * Create CQ using DevX API. > * > diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h > index 2826c0b..f587d0c 100644 > --- a/drivers/common/mlx5/mlx5_devx_cmds.h > +++ b/drivers/common/mlx5/mlx5_devx_cmds.h > @@ -474,6 +474,8 @@ struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(void *ctx, > int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain, > FILE *file); > __rte_internal > +int mlx5_devx_cmd_flow_single_dump(void *rule, FILE *file); > +__rte_internal > struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(void *ctx, > struct mlx5_devx_cq_attr *attr); > __rte_internal > diff --git a/drivers/common/mlx5/rte_common_mlx5_exports.def b/drivers/common/mlx5/rte_common_mlx5_exports.def > index fd62b80..0e6d6d3 100644 > --- a/drivers/common/mlx5/rte_common_mlx5_exports.def > +++ b/drivers/common/mlx5/rte_common_mlx5_exports.def > @@ -20,6 +20,7 @@ EXPORTS > mlx5_devx_cmd_flow_counter_alloc > mlx5_devx_cmd_flow_counter_query > mlx5_devx_cmd_flow_dump > + mlx5_devx_cmd_flow_single_dump > mlx5_devx_cmd_mkey_create > mlx5_devx_cmd_modify_qp_state > mlx5_devx_cmd_modify_rq > diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map > index 91f3fa5..4d49011 100644 > --- a/drivers/common/mlx5/version.map > +++ b/drivers/common/mlx5/version.map > @@ -28,6 +28,7 @@ INTERNAL { > mlx5_devx_cmd_flow_counter_alloc; > mlx5_devx_cmd_flow_counter_query; > mlx5_devx_cmd_flow_dump; > + mlx5_devx_cmd_flow_single_dump; > mlx5_devx_cmd_mkey_create; > mlx5_devx_cmd_modify_qp_state; > mlx5_devx_cmd_modify_rq; >