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 5E71EA0561; Thu, 18 Mar 2021 10:15:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49905140EFA; Thu, 18 Mar 2021 10:15:06 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 1AFB8140EE6 for ; Thu, 18 Mar 2021 10:15:05 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id ABB555C0050; Thu, 18 Mar 2021 05:15:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 18 Mar 2021 05:15:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= 8nnID3PtCPuOtWj0mCE9ITbZpV09To05J+m9MBC8Qp0=; b=OzICLJz4xSPsjwXB 2VDE4SkMcp7Mrz4KAU32CzaBwA6EOYVdYS7o1w0bJ1sUc4jG710UrRSo0LaMYmRX lFAX5RQUN9+h+gu6PoZ7iTvwk8PEhx81l8jbAxcaBex/pDvjEW0+GwbR3b7xTYXb kjWSM1/1GdMujaBpJgmjytVYKdQOTskR0bP9uCWCh0tOWxGhvVme5qvkS8IdLbnV f4EQz7GR0vvXLt79PdtrmAetxHmMjxrQ4DVA6c+GLJUvjfv9S5SbEecv3Y3i5eYI R+p0KPskpdN1m2toioh3sq/RxjziAVMnW9MHbqFZnhhF+xK+jW4NB3YhYsxBDO7X GJBbgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=8nnID3PtCPuOtWj0mCE9ITbZpV09To05J+m9MBC8Q p0=; b=klf/S4Fci7MLrHUQZfNHGxi2Jy3WC23hnkGf00TaCP9SmqHa7AnBohUNI OYmAemxgkIsfbTqFMpemCkkioKiSI/ck+lOlpm4df9h+v0/SMk5KsHXYdb4B3cgF D/leeerSFQEMKHENZ/s++9/NbUp9Qx9YShsOCCNjT0FGVJiys/ipay6P13OpcLpb FHfBGIteri8Rb9CVO75W92PEfF+uf7/EEhWIUsMR9ZzNB4qYFqP3viQ21jgYChdJ I7Prje4kGJsQmtUdKTOY4xE6+hYXaIjaPwu1zNLdsMhQJj/iY+stCxjDWCT0baeT hXh7P2XySuBx6vpARU8DAFpP4lnSA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefiedgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 02C3124005B; Thu, 18 Mar 2021 05:15:01 -0400 (EDT) From: Thomas Monjalon To: Xueming Li Cc: Ferruh Yigit , Andrew Rybchenko , Olivier Matz , dev@dpdk.org, Viacheslav Ovsiienko , Asaf Penso , david.marchand@redhat.com, bruce.richardson@intel.com Date: Thu, 18 Mar 2021 10:14:59 +0100 Message-ID: <3923565.UPiEKNcRdf@thomas> In-Reply-To: <1610983002-7630-3-git-send-email-xuemingl@nvidia.com> References: <1610983002-7630-1-git-send-email-xuemingl@nvidia.com> <1610983002-7630-3-git-send-email-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 2/5] devargs: refactor scratch buffer storage 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 Sender: "dev" 18/01/2021 16:16, Xueming Li: > In current design, legacy parser rte_devargs_parse() saved scratch > buffer to devargs.args while new parser rte_devargs_layers_parse() saved > to devargs.data. Code using devargs had to know the difference and > cleaned up memory accordingly - error prone. > > This patch unifies data the dedicate scratch buffer, introduces > rte_devargs_free() function to wrap the memory memory clean up. > > Signed-off-by: Xueming Li > --- > --- a/lib/librte_eal/include/rte_devargs.h > +++ b/lib/librte_eal/include/rte_devargs.h > @@ -60,16 +60,16 @@ struct rte_devargs { > /** Name of the device. */ > char name[RTE_DEV_NAME_MAX_LEN]; > RTE_STD_C11 > - union { > - /** Arguments string as given by user or "" for no argument. */ > - char *args; > + union { /**< driver-related part of device string. */ > + const char *args; /**< legacy name. */ > const char *drv_str; > }; > struct rte_bus *bus; /**< bus handle. */ > struct rte_class *cls; /**< class handle. */ > const char *bus_str; /**< bus-related part of device string. */ > const char *cls_str; /**< class-related part of device string. */ > - const char *data; /**< Device string storage. */ > + char *data; /**< Scratch buffer. */ > + const char *src; /**< Arguments given by user. */ Adding a field changes the size of the struct, which is an ABI break. We need to plan this change for DPDK 21.11. Let's think what can be done in the meantime.