From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id CDD0810A3 for ; Tue, 17 Jul 2018 17:00:26 +0200 (CEST) Received: from mail-oi0-f71.google.com ([209.85.218.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ffRSk-0005rp-Dj for dev@dpdk.org; Tue, 17 Jul 2018 15:00:26 +0000 Received: by mail-oi0-f71.google.com with SMTP id c23-v6so1165637oiy.3 for ; Tue, 17 Jul 2018 08:00:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U1RzMkSN+UFxDptFeEEy+tBlUlCkXOqKl7Gh+GfJCLw=; b=IHZuL+/uZtVaDyWnEi2hQiNLmvu0yY4+cMWtx7fsjE6m+p2jyni2l64CxLgj5l3zyY /gCuI89PZp4+S6ZfpdcMF8UemeNJ6ko0tE4pe/ATBcWL6jUsfT+uakWwHBgWH3ObvbPF CgIlfoaNLG0xjBejA0RVDilTW5BSZARHqGTXwsRkRsZIknXbnUR88FcLhhZZ6JGyrgY2 HXN4ftj/jLrXWNEJ9U0pNgLwXnUB8FvpxaZCpnIyIneUw7gJ2L1PyF4Bdzvfj8QeZPiL f8RPwHncRiPyLSsDtYq2L4x8hNJcRz4uojuOvSRk465AdLOpICx7Qq+h+nAe3t4/1Gjg UScA== X-Gm-Message-State: AOUpUlHe4sS+E47zqnuCI8m8Fi10WrLe3xEPKs7sRUVpLA4sMZLku+Zs Uub7zwDogpFyrKFQnByONCDWLfmxcl6b80i5JE6n4AddGGbwmtr9fAnVJXLt+9jj4i2uStzgVN8 wC6AZ7BJGgfkgJVpwWyegdb765ajkj3KZAj5z X-Received: by 2002:aca:df55:: with SMTP id w82-v6mr1840927oig.355.1531839625324; Tue, 17 Jul 2018 08:00:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeOskE2OZqhtZUBbfHq/QceCXGPdzVhJr3RcMJW4ggVl474EK8trgkKNXaWLsftWQopb3kg04yv7SlHW6QwCtc= X-Received: by 2002:aca:df55:: with SMTP id w82-v6mr1840902oig.355.1531839625061; Tue, 17 Jul 2018 08:00:25 -0700 (PDT) MIME-Version: 1.0 References: <20180712065653.29801-1-shahafs@mellanox.com> In-Reply-To: From: Christian Ehrhardt Date: Tue, 17 Jul 2018 16:59:59 +0200 Message-ID: To: Shahaf Shuler , Luca Boccassi Cc: orika@mellanox.com, yskoh@mellanox.com, dev , Ferruh Yigit , Stephen Hemminger , stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] net/mlx5: fix compilation for rdma-core v19 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: Tue, 17 Jul 2018 15:00:27 -0000 On Thu, Jul 12, 2018 at 12:57 PM Shahaf Shuler wrote= : > Thursday, July 12, 2018 1:54 PM, Ori Kam: > > Subject: RE: [PATCH] net/mlx5: fix compilation for rdma-core v19 > > > > > > The flow counter support introduced by commit 9a761de8ea14 ("net/mlx5= : > > > flow counter support") was intend to work only with MLNX_OFED_4.3 as > > > the upstream rdma-core libraries were lack such support. > > > > > > On rdma-core v19 the support for the flow counters was added but with > > > different user APIs, hence causing compilation issues on the PMD. > > > > > > This patch fix the compilation errors by forcing the flow counters to > > > be enabled only with MLNX_OFED APIs. > > > Once MLNX_OFED and rdma-core APIs will be aligned, a proper patch to > > > support the new API will be submitted. > > > > > > Fixes: 9a761de8ea14 ("net/mlx5: flow counter support") > > > Cc: stable@dpdk.org In regard to the stable submission of this I wanted to mention that there are issues with this. It correctly fixes the detection with rdma-core v19 and does no more set HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT Due to that the following code triggers: #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT struct ibv_counter_set_init_attr { int dummy; }; struct ibv_flow_spec_counter_action { int dummy; }; But that makes compilation run into: drivers/net/mlx5/mlx5_flow.c /<>/drivers/net/mlx5/mlx5_flow.c:69:8: error: redefinition of =E2=80=98struct ibv_flow_spec_counter_action=E2=80=99 struct ibv_flow_spec_counter_action { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /<>/drivers/net/mlx5/mlx5_flow.c:42:0: /usr/include/infiniband/verbs.h:1563:8: note: originally defined here struct ibv_flow_spec_counter_action { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is due to the series starting with b42c000e3 "net/mlx5: remove flow support" not being in the current stable releases. For now I appended something like this to the Makefile + HAVE_IBV_FLOW_SPEC_COUNTER_ACTION \ + infiniband/verbs.h \ + type 'struct ibv_flow_spec_counter_action' \ + $(AUTOCONF_OUTPUT) And this to the type definition: --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -66,9 +66,15 @@ struct ibv_counter_set_init_attr { int dummy; }; +/* rdma-core v19 has no ibv_counter_set_init_attr, but it has + * ibv_flow_spec_counter_action which would conflict. + * Newer DPDK, doesn't have the issue due to the series starting with + * "net/mlx5: remove flow support" */ +#ifndef HAVE_IBV_FLOW_SPEC_COUNTER_ACTION struct ibv_flow_spec_counter_action { int dummy; }; +#endif struct ibv_counter_set { int dummy; }; That makes it build, but I wanted to make you aware that this will let all stable maintainers into issues as the fix applies, but then later breaks compilation (only if mlx is enabled). It would be great if you could submit a v2 to stable@ which solves it the way you'd prefer it to be done. Kind Regards, Christian > > Cc: orika@mellanox.com > > > > > > Reported-by:Stephen Hemminger > > > Reported-by: Ferruh Yigit > > > Signed-off-by: Shahaf Shuler > > > --- > > > drivers/net/mlx5/Makefile | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile > > > index 9e274964b4..d86c6bbab9 100644 > > > --- a/drivers/net/mlx5/Makefile > > > +++ b/drivers/net/mlx5/Makefile > > > @@ -150,7 +150,7 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto- > > > config-h.sh > > > $Q sh -- '$<' '$@' \ > > > HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT \ > > > infiniband/verbs.h \ > > > - enum IBV_FLOW_SPEC_ACTION_COUNT \ > > > + type 'struct ibv_counter_set_init_attr' \ > > > $(AUTOCONF_OUTPUT) > > > $Q sh -- '$<' '$@' \ > > > HAVE_RDMA_NL_NLDEV \ > > > -- > > > 2.12.0 > > > > > > Acked-by: Ori Kam > > Applied to next-net-mlx, thanks. > > --=20 Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd