From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 8F75C559A for ; Mon, 5 Nov 2018 08:30:34 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 20B9722766; Mon, 5 Nov 2018 02:30:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 05 Nov 2018 02:30:34 -0500 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=mesmtp; bh=JUJE8C/wtTKiviRN7tVbZFXZspeOGYLoL+tqjzYHP74=; b=WW+muql9Nb/5 WpVoLIZ4tbGpqJ+hPCGxjq/92aJinXJ6r9dvo4ZeXHBq96ngoXeMlFpFSNxYNNdj cwTSzLuBOzebxfEHIRvB8UEddnf6yFXKk1qDG35q7qYiaDiOCrKJiIeLPkxl00Q3 sS7QWMh0taHmxWmXB4kepFGN3NFOcm0= 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=fm1; bh=JUJE8C/wtTKiviRN7tVbZFXZspeOGYLoL+tqjzYHP 74=; b=hIgIHYqSsQQIvYPd7eRc5V8vo2DHD49AvEF+G3xGIU78grf5AVNETT1AA dahzswRMi+n74o2atR69sBfhXhx0GJvKgPSHgCbxM3Gu8Y9udvOhMcAMPiE4uIxY /IvnyyaWafloomXHGQpKVSM0jGgLapEX15lZJhtVNu3yaXuenQzyKOTZUyHURQjF iU/0nHIlr96Vg3DE8VQBkBzfqZgWRBEuaRPIeTc/CI06NXjON/5IDdr6ndq/zzzE 7kkd2HUBNcMmTiamo+pyCLUP5BCpgNbPr5ebqAkreh5Pqfj1ApMcpmnoTQyxDIwV K8NsRAutZagHw0X8fcUs1ZQ4/sdMg== X-ME-Sender: 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 3C6AAE48B9; Mon, 5 Nov 2018 02:30:33 -0500 (EST) From: Thomas Monjalon To: Darek Stojaczyk Cc: dev@dpdk.org Date: Mon, 05 Nov 2018 08:30:31 +0100 Message-ID: <4545148.O9CyC7tLm6@xps> In-Reply-To: <20181105070447.67700-2-dariusz.stojaczyk@intel.com> References: <20181105070447.67700-1-dariusz.stojaczyk@intel.com> <20181105070447.67700-2-dariusz.stojaczyk@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 2/3] devargs: delay freeing previous devargs when overriding them 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: , X-List-Received-Date: Mon, 05 Nov 2018 07:30:34 -0000 Hi, 05/11/2018 08:04, Darek Stojaczyk: > -int __rte_experimental > -rte_devargs_insert(struct rte_devargs *da) > +void __rte_experimental > +rte_devargs_insert(struct rte_devargs *da, struct rte_devargs **prev_da) You should update the API section of the release notes. > { > - int ret; > + struct rte_devargs *d; > + void *tmp; > + > + *prev_da = NULL; > + TAILQ_FOREACH_SAFE(d, &devargs_list, next, tmp) { > + if (strcmp(d->bus->name, da->bus->name) == 0 && > + strcmp(d->name, da->name) == 0) { > + TAILQ_REMOVE(&devargs_list, d, next); > + *prev_da = d; > + break; > + } > + } > > - ret = rte_devargs_remove(da); > - if (ret < 0) > - return ret; Why not updating rte_devargs_remove instead of duplicating its code?