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 038ABA04A3; Mon, 15 Jun 2020 21:55:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED3C64C7A; Mon, 15 Jun 2020 21:55:27 +0200 (CEST) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by dpdk.org (Postfix) with ESMTP id F42322B87 for ; Mon, 15 Jun 2020 21:55:26 +0200 (CEST) Received: from u256.net (lfbn-idf2-1-566-132.w86-246.abo.wanadoo.fr [86.246.31.132]) (Authenticated sender: grive@u256.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 79F20240006; Mon, 15 Jun 2020 19:55:25 +0000 (UTC) Date: Mon, 15 Jun 2020 21:55:20 +0200 From: =?utf-8?Q?Ga=C3=ABtan?= Rivet To: Parav Pandit Cc: dev@dpdk.org, ferruh.yigit@intel.com, thomasm@mellanox.com, orika@mellanox.com, matan@mellanox.com Message-ID: <20200615195520.ecvwfuqfjeqckcaj@u256.net> References: <20200610171728.89-1-parav@mellanox.com> <20200610171728.89-4-parav@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200610171728.89-4-parav@mellanox.com> Subject: Re: [dpdk-dev] [RFC PATCH 3/6] common/mlx5: change mlx5 class enum values as bits 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" On 10/06/20 17:17 +0000, Parav Pandit wrote: > mlx5 PCI Device supports multiple classes of devices such as net, vdpa, > and/or regex. > To support these multiple classes, change mlx5_class to a > bitmap values so that if users asks to enable multiple of them, all > supported classes can be returned by mlx5_class_supported(). > > Signed-off-by: Parav Pandit > --- > drivers/common/mlx5/mlx5_common.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h > index 1d59873c8..9fdbd341d 100644 > --- a/drivers/common/mlx5/mlx5_common.h > +++ b/drivers/common/mlx5/mlx5_common.h > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > > #include "mlx5_prm.h" > > @@ -203,8 +204,8 @@ int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr); > > enum mlx5_class { > MLX5_CLASS_INVALID, > - MLX5_CLASS_NET, > - MLX5_CLASS_VDPA, > + MLX5_CLASS_NET = RTE_BIT(0), > + MLX5_CLASS_VDPA = RTE_BIT(1), > }; > > __rte_internal > -- > 2.25.4 > Well, I should have read further after all :) You should merge this commit with the previous one, accompanying the class getter API change. I am not sure if an enum width is fixed however. I think it is implementation defined. If so, using a define would be better. -- Gaƫtan