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 919D242572; Mon, 11 Sep 2023 21:11:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FD1C402D6; Mon, 11 Sep 2023 21:11:46 +0200 (CEST) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by mails.dpdk.org (Postfix) with ESMTP id 6E6EA402CE for ; Mon, 11 Sep 2023 21:11:44 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 6D5DA3200920; Mon, 11 Sep 2023 15:11:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 11 Sep 2023 15:11:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type: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=fm1; t= 1694459499; x=1694545899; bh=ef8jQzm9a54g+GsspZTE0ZLHQROo5Z83MKt PYNHU0+U=; b=OiQZ4xYGevf+dd1LEMJm8RHHcDt4u1cHKdd8iv1mXBAIACJxmxR YDLCdXlLA1M63N+8JcyBHVztzd+qErAqEH7D+ZRdx7XqdaGAHA0n8glpCQG8aZNZ 03AVta26euaci9QCUEMaJ5bD6F3Yrd0/JT/IwClp1Q/EJo28pBIQ0DL9qbwInAWD /GLLa+5Fo+4nGBmRJup4j40QM1fgdsht/2vC8GOu6tZ9usoHZ73kKC4BpKYVu6cQ ZYIyzwUruqNoG2CEISkKbDnMWLuz62mzGVQCiyevmETtwfZ9EtwpmWe2tZujZPXg 3n4vDOGUq9UQlZ02ZwrlyBW97sm+S/kkkog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :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=fm1; t= 1694459499; x=1694545899; bh=ef8jQzm9a54g+GsspZTE0ZLHQROo5Z83MKt PYNHU0+U=; b=yoxNiPBe7EgHJ8LvVcUhcxHmSFxAta5IQdcafNvsLSksVJUGW3U ax7chk1h8X5TniYDUDaYfm4hq34CL5gC8O7myRxy/q93kLYYNQaBe4C8KNhmzbv/ 4lgj7Siiac3LlkJlOmWpWNcf6iILPXMbRFhjAeTP2r6nLRMTWRcFT42Yw5aXOtUW Y916Tt9SpV7rviB8cfOPXqOKIRAh9RkXmSoIRuZlVvKUybd+CsVp6GM9E+El9k+y Rqq/5P0TmCFe9lizvAUBib0PRKbTym5GHOzS1URTvJjY8pQj8x5TYw4SEnS44lL2 t/WmyJ4Ft7QZ5Kf/Ewql5UKhjaQFlcqlKow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeigedgudefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkfgjfhgggfgtsehtqhertddttdejnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnhepgedttdeljeejgeffkeekkedtjeevtdehvedtkeeivdeuuedv ieduvdelveejueejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Sep 2023 15:11:37 -0400 (EDT) From: Thomas Monjalon To: David Marchand , dev@dpdk.org, Morten =?ISO-8859-1?Q?Br=F8rup?= Cc: Tyler Retzlaff , Ferruh Yigit Subject: Re: [PATCH 05/11] eal: force prefix for internal threads Date: Mon, 11 Sep 2023 18:26:11 +0200 Message-ID: <3082546.U3zVgo479M@thomas> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87B83@smartserver.smartshare.dk> References: <20230906162226.1618088-1-thomas@monjalon.net> <98CBD80474FA8B44BF855DF32C47DC35D87B83@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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 07/09/2023 13:10, Morten Br=C3=B8rup: > > From: David Marchand [mailto:david.marchand@redhat.com] > > Sent: Thursday, 7 September 2023 10.55 > >=20 > > On Thu, Sep 7, 2023 at 10:53=E2=80=AFAM David Marchand > > wrote: > > > > > > On Thu, Sep 7, 2023 at 10:50=E2=80=AFAM Morten Br=C3=B8rup > > wrote: > > > > > This 10 value in the comment is easy to miss if some change with = the > > > > > prefix is done. > > > > > Mentionning RTE_THREAD_INTERNAL_NAME_SIZE is enough. > > > > > > > > I disagree with David's comment to this. > > > > > > > > The function documentation is easier to read if the actual number i= s also > > mentioned. > > > > > > > > For the best of both worlds, you can add something like this nearby: > > > > > > > > _Static_assert(sizeof(RTE_THREAD_NAME_PREFIX) =3D=3D sizeof("dpdk-"= ), > > > > "Length of RTE_THREAD_NAME_PREFIX has changed; " > > > > "the documentation needs updating."); > > > > > > And how will it catch the comment about 10 characters ? > >=20 > > I mean you still have to re-read the whole documentation and look for > > some reference somewhere about 10 characters. >=20 > The trick is to put the _Static_assert close to where the expectation occ= urs. That makes it easier to find where changes are necessary. >=20 > And the _Static_assert can be added at all the locations where changes wo= uld be necessary. (Generally, we should add a lot more _Static_assert to th= e code where it makes assumptions about e.g. the ordering of fields in a st= ruct, such as the vector optimized code.) >=20 > Also, the failure message could be improved to include help about what to= look for. >=20 > PS: The reference to RTE_THREAD_INTERNAL_NAME_SIZE should remain in the d= ocumentation, so perhaps look for "RTE_THREAD_INTERNAL_NAME_SIZE". I agree with David, it is easier to maintain if not mentioning the exact value in the doc, and having a mention to RTE_THREAD_INTERNAL_NAME_SIZE is enough if it defined as "11". Then we need only one static assert (or RTE_BUILD_BUG_ON) below the definition to make sure the number is still valid.