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 BB078A034E; Mon, 14 Feb 2022 17:25:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4533D410FD; Mon, 14 Feb 2022 17:25:26 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id C15324067E for ; Mon, 14 Feb 2022 17:25:25 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 277A55C0256; Mon, 14 Feb 2022 11:25:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 14 Feb 2022 11:25:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; bh=doMpOVxZ5N2BB3 KlM4+rTl/g7+oDwkfJU0r8xy8bD1s=; b=sb+cEJS08TFJTSoQyss8ObLx9f8lpS +GSBqnYTU9o1cF2f6Cr99YuCUpExck0LF17kgbgeJ0FDcd+VcypqgjEVGIls82p3 DGs9dQnSxp6jb7Mm9N1ZV9S5oXM8xbDBgqAELMgzBue66PFAEui0/sib0t5+9dlM up9qbVxGVup98B4/O3pKuFe43wyFvz1OC5leHdniJUZONZWvh4RlBRIJDy0zGauw RWaVtLKTBT3AQO3I3NW99JD5OsSf0HE+Hb5HQbNXjDJIgSJkHJ6TzWpYdux4v7eX rEpQhr4KxSwSZFOgoN9PdGebLCo9fZr76u4oOZ8cjEBlFgjjJjFcgb9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=doMpOVxZ5N2BB3KlM4+rTl/g7+oDwkfJU0r8xy8bD 1s=; b=EbvylKT3BV+ldZEQ43kGHxqyYtSTWPqNL0ifI8c4NFmGWfuaw+3ZbrGyH aK+QH32C8HYJMsGx8Q4FkhOj7lP7EErNMe2suUVsdALfQ2TFUPAfQ2heMD1KlOA2 8VYT+morVfPkSuztPO5FKA+cN6WqxVOIv5AAih4VAX01chi08oxG1O3J5wWV+Iom Pwp6w8kTKSUptQN0K55IfB3IlKc+Podxz8M244GA1H+IP+d1DDc2VCnvVWu59iun MbCHaYs8fHqg9IxrtFpKTuZlVUH08iNgptnPM0KAGimb0XhRoadvImWR/SMMfqtA AZLT11hXVcArc0LRKpKSiUEJPS9nQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrjedvgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Feb 2022 11:25:22 -0500 (EST) From: Thomas Monjalon To: Ray Kinsella Cc: Ferruh Yigit , Kalesh A P , dev@dpdk.org, ajit.khaparde@broadcom.com, asafp@nvidia.com, David Marchand , Andrew Rybchenko Subject: Re: [dpdk-dev] [PATCH v7 1/4] ethdev: support device reset and recovery events Date: Mon, 14 Feb 2022 17:25:20 +0100 Message-ID: <3365765.som1txNFv6@thomas> In-Reply-To: <875yphigb6.fsf@mdr78.vserver.site> References: <20201009034832.10302-1-kalesh-anakkur.purayil@broadcom.com> <45691978.XUcTiDjVJD@thomas> <875yphigb6.fsf@mdr78.vserver.site> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 14/02/2022 17:06, Ray Kinsella: > Thomas Monjalon writes: > > 14/02/2022 11:16, Ray Kinsella: > >> Ray Kinsella writes: > >> > Thomas Monjalon writes: > >> >> 02/02/2022 12:44, Ray Kinsella: > >> >>> Ferruh Yigit writes: > >> >>> > On 1/28/2022 12:48 PM, Kalesh A P wrote: > >> >>> >> --- a/lib/ethdev/rte_ethdev.h > >> >>> >> +++ b/lib/ethdev/rte_ethdev.h > >> >>> >> @@ -3818,6 +3818,24 @@ enum rte_eth_event_type { > >> >>> >> RTE_ETH_EVENT_DESTROY, /**< port is released */ > >> >>> >> RTE_ETH_EVENT_IPSEC, /**< IPsec offload related event */ > >> >>> >> RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected */ > >> >>> >> + RTE_ETH_EVENT_ERR_RECOVERING, > >> >>> >> + /**< port recovering from an error > >> >>> >> + * > >> >>> >> + * PMD detected a FW reset or error condition. > >> >>> >> + * PMD will try to recover from the error. > >> >>> >> + * Data path may be quiesced and Control path operations > >> >>> >> + * may fail at this time. > >> >>> >> + */ > >> >>> >> + RTE_ETH_EVENT_RECOVERED, > >> >>> >> + /**< port recovered from an error > >> >>> >> + * > >> >>> >> + * PMD has recovered from the error condition. > >> >>> >> + * Control path and Data path are up now. > >> >>> >> + * PMD re-configures the port to the state prior to the error. > >> >>> >> + * Since the device has undergone a reset, flow rules > >> >>> >> + * offloaded prior to reset may be lost and > >> >>> >> + * the application should recreate the rules again. > >> >>> >> + */ > >> >>> >> RTE_ETH_EVENT_MAX /**< max value of this enum */ > >> >>> > > >> >>> > > >> >>> > Also ABI check complains about 'RTE_ETH_EVENT_MAX' value check, cc'ed more people > >> >>> > to evaluate if it is a false positive: > >> >>> > > >> >>> > > >> >>> > 1 function with some indirect sub-type change: > >> >>> > [C] 'function int rte_eth_dev_callback_register(uint16_t, rte_eth_event_type, rte_eth_dev_cb_fn, void*)' at rte_ethdev.c:4637:1 has some indirect sub-type changes: > >> >>> > parameter 3 of type 'typedef rte_eth_dev_cb_fn' has sub-type changes: > >> >>> > underlying type 'int (typedef uint16_t, enum rte_eth_event_type, void*, void*)*' changed: > >> >>> > in pointed to type 'function type int (typedef uint16_t, enum rte_eth_event_type, void*, void*)': > >> >>> > parameter 2 of type 'enum rte_eth_event_type' has sub-type changes: > >> >>> > type size hasn't changed > >> >>> > 2 enumerator insertions: > >> >>> > 'rte_eth_event_type::RTE_ETH_EVENT_ERR_RECOVERING' value '11' > >> >>> > 'rte_eth_event_type::RTE_ETH_EVENT_RECOVERED' value '12' > >> >>> > 1 enumerator change: > >> >>> > 'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '11' to '13' at rte_ethdev.h:3807:1 > >> >>> > >> >>> I don't immediately see the problem that this would cause. > >> >>> There are no array sizes etc dependent on the value of MAX for instance. > >> >>> > >> >>> Looks safe? > >> >> > >> >> We never know how this enum will be used by the application. > >> >> The max value may be used for the size of an event array. > >> >> It looks a real ABI issue unfortunately. > >> > > >> > Right - but we only really care about it when an array size based on MAX > >> > is likely to be passed to DPDK, which doesn't apply in this case. > > > > I don't completely agree. > > A developer may assume an event will never exceed MAX value. > > However, after an upgrade of DPDK without app rebuild, > > a higher event value may be received in the app, > > breaking the assumption. > > Should we consider this case as an ABI breakage? > > Nope - I think we should explicitly exclude MAX values from any > ABI guarantee, as being able to change them is key to our be able to > evolve DPDK while maintaining ABI stability. Or we can simply remove the MAX values so there is no confusion. > Consider what it means applying the ABI policy to a MAX value, you are > in effect saying that that no value can be added to this enumeration > until the next ABI version, for me this is very restrictive without a > solid reason. I agree it is too much restrictive, that's why I am advocating for their removal. > >> > I noted that some Linux folks explicitly mark similar MAX values as not > >> > part of the ABI. > >> > > >> > /usr/include/linux/perf_event.h > >> > 37: PERF_TYPE_MAX, /* non-ABI */ > >> > 60: PERF_COUNT_HW_MAX, /* non-ABI */ > >> > 79: PERF_COUNT_HW_CACHE_MAX, /* non-ABI */ > >> > 87: PERF_COUNT_HW_CACHE_OP_MAX, /* non-ABI */ > >> > 94: PERF_COUNT_HW_CACHE_RESULT_MAX, /* non-ABI */ > >> > 116: PERF_COUNT_SW_MAX, /* non-ABI */ > >> > 149: PERF_SAMPLE_MAX = 1U << 24, /* non-ABI */ > >> > 151: __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* > >> > non-ABI; internal use */ > >> > 189: PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */ > >> > 267: PERF_TXN_MAX = (1 << 8), /* non-ABI */ > >> > 301: PERF_FORMAT_MAX = 1U << 4, /* non-ABI */ > >> > 1067: PERF_RECORD_MAX, /* non-ABI */ > >> > 1078: PERF_RECORD_KSYMBOL_TYPE_MAX /* non-ABI */ > >> > 1087: PERF_BPF_EVENT_MAX, /* non-ABI */ > >> > >> Any thoughts on similarly annotating all our _MAX enums in the same way? > >> We could also add a section in the ABI Policy to make it explicit _MAX > >> enum values are not part of the ABI - what do folks think? > > > > Interesting. I am not sure it is always ABI-safe though.