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 95846A0093; Thu, 23 Jun 2022 18:13:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 305134067B; Thu, 23 Jun 2022 18:13:34 +0200 (CEST) Received: from mail-108-mta75.mxroute.com (mail-108-mta75.mxroute.com [136.175.108.75]) by mails.dpdk.org (Postfix) with ESMTP id 680E440146 for ; Thu, 23 Jun 2022 18:13:32 +0200 (CEST) Received: from filter006.mxroute.com ([140.82.40.27] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta75.mxroute.com (ZoneMTA) with ESMTPSA id 18191570b3600028a7.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Thu, 23 Jun 2022 16:13:29 +0000 X-Zone-Loop: 8ccdb1e4260e4b8bc75400c6f6a31d6d0e766b723102 X-Originating-IP: [140.82.40.27] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Type:MIME-Version:Message-ID:In-reply-to:Date:Subject:Cc:To: From:References:Sender:Reply-To:Content-Transfer-Encoding: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=lGE/k4sVM3QFYl+Q7unMom4SJJ4x83bybz+rPSBSJus=; b=NvqdntM8RCsyksbC5Vng1vJFOR AzdXII9VHjhYlpf1UP7LfahYbPdMGR8iRFLcQPjzilfJMC6UNLUwgEGztsS3APCnwJrTgZwQ1bdCb TaDxM45YXrDIY7WyvPv09YMs3U5XDyPs8cVUAq7DMxBhpReS+g6Pfiaiwd5jwHnSZBBHTLQQid011 K0rpu/pAnFLqX8AER0A7BsYqTKV+peZLmJWw8RI9fmZlnCLI2bh8wezOTtFaO8S4zoXxCEMOvc7ra m8rrcmRCTpsJtT1f8LoLtsp4FEEt6iRscpFXg+cyqkcxzqez7het16HJhPEbwPmukfPa6y7SO2/8U wMb6Bqfg==; References: <1655144675-14363-1-git-send-email-nicolas.chautru@intel.com> <1655144675-14363-2-git-send-email-nicolas.chautru@intel.com> <6579285.Sb9uPGUboI@thomas> User-agent: mu4e 1.6.10; emacs 27.1 From: Ray Kinsella To: Thomas Monjalon Cc: Nicolas Chautru , dev@dpdk.org, maxime.coquelin@redhat.com, trix@redhat.com, bruce.richardson@intel.com, hemant.agrawal@nxp.com, david.marchand@redhat.com, stephen@networkplumber.org, techboard@dpdk.org Subject: Re: [PATCH v1] bbdev: allow operation type enum for growth Date: Thu, 23 Jun 2022 17:09:20 +0100 In-reply-to: <6579285.Sb9uPGUboI@thomas> Message-ID: <871qvf4au1.fsf@mdr78.vserver.site> MIME-Version: 1.0 Content-Type: text/plain X-AuthUser: mdr@ashroe.eu 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 Thomas Monjalon writes: > This solution is what I proposed to the techboard some years ago, > but the preference was to completely remove the MAX values. I am mindful we don't have an explicit guidance in the documentation. I am including to add something to the abi_versioning document, that basically says 1. Try not to use _MAX values with enumerations. 2. If you have to use _MAX values with enumeration, consider giving yourself some headroom along with rigourous checking? > > > 13/06/2022 20:24, Nicolas Chautru: >> Updating the last enum for rte_bbdev_op_type >> to allow for enum insertion. > > Please explain that the reason is to keep ABI compatible, > and you want to keep the MAX value for array needs. > >> --- a/lib/bbdev/rte_bbdev.c >> +++ b/lib/bbdev/rte_bbdev.c >> @@ -1122,7 +1122,10 @@ struct rte_mempool * >> "RTE_BBDEV_OP_TURBO_DEC", >> "RTE_BBDEV_OP_TURBO_ENC", >> "RTE_BBDEV_OP_LDPC_DEC", >> - "RTE_BBDEV_OP_LDPC_ENC", >> + "RTE_BBDEV_OP_RESERVED_1", >> + "RTE_BBDEV_OP_RESERVED_2", >> + "RTE_BBDEV_OP_RESERVED_3", >> + "RTE_BBDEV_OP_RESERVED_4", > > As Stephen said, you should make sure that using these values > with the API functions will lead to a clear and expected error. > >> @@ -748,7 +748,7 @@ enum rte_bbdev_op_type { >> RTE_BBDEV_OP_TURBO_ENC, /**< Turbo encode */ >> RTE_BBDEV_OP_LDPC_DEC, /**< LDPC decode */ >> RTE_BBDEV_OP_LDPC_ENC, /**< LDPC encode */ >> - RTE_BBDEV_OP_TYPE_COUNT, /**< Count of different op types */ >> + RTE_BBDEV_OP_TYPE_COUNT = 8, /**< Count of different op types */ > > You must update the comment to explain there may be a padding, > it is not exactly the count. > Maybe "MAX" is a better fit than "COUNT" in this case. -- Regards, Ray K