From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ACC72A0093; Thu, 21 May 2020 22:29:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C1861D728; Thu, 21 May 2020 22:29:08 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 6586A1D722; Thu, 21 May 2020 22:29:07 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id D7C2A5C007E; Thu, 21 May 2020 16:29:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 21 May 2020 16:29:06 -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=fm1; bh= guz66+M2wl40yYOtpYsMOyjsoPkr5KONCPz7+pj39UI=; b=N6UWWL22GSonSMRc NlS6oalk7Cc4EpZAK9cwRIpX9qcs2VyVSsfssKTXpZ5rbYUAogFg7oZudDHUTiwi Jlp60Pp7LqW0b9f5q4L55LEZ1nB9Dz5UJieCy/Q5Z86laksdprPaGYaNK6l8VIoY IYAKg30F/SRvKCmsqwAlKBhIQHlxtAPBCxf+MSEzepL8BStmAc/dS7aAzqHxXKU2 0nvB6oO0an0hQ0SDSAC6DWALSPu3qevQSs49YPyVMByfoy/tfX6howq9JTtKzQNR NnQosjkTviUvrrTAMVUH/qOGBzBoQbMCR30OQYpKhJO2W+yAKmyL2XFpRI83WTgG AxBq3Q== 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=guz66+M2wl40yYOtpYsMOyjsoPkr5KONCPz7+pj39 UI=; b=XgF7+nbU8A57ZNz9u0EnPmnkWZQ8aBPalw9UQf8KryJI3XbGTzh8hrW9G /Jei5fBGle81SnIsq8YuB9o3Eg25u7+KwNbM1AgGbF/yC7zaGB9EiXZdPxymwEb7 I85NxHDwEF2Nw2Nei01LZjV5a69WowHbvbuCNZ9BRrY4JWQhCecYg2VDdIy05lFM VSlTdNltqJ5PyOFnav0RWqZNshPsIstGigLsvOsV1V79r++3LDIwWoYWkqVzSEHl Pw3fVbzEpA0OoQVzfgXIOeYdmbVGkXIB6Y2DU+2JJw6klQdG026jrbj2+EtqbHIN 0KXdO6Xk3m8h8Jk7StwWb3Wclc7NA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudduuddgudegtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth 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 C8411328005D; Thu, 21 May 2020 16:29:05 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: Rasesh Mody , dev@dpdk.org, stable@dpdk.org, Xi Zhang Date: Thu, 21 May 2020 22:29:04 +0200 Message-ID: <5373077.J0j3NrKs1C@thomas> In-Reply-To: References: <20200521151042.3730374-1-ferruh.yigit@intel.com> <2135471.CWJG7g5NFy@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] examples/kni: fix crash during MTU set 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 21/05/2020 17:46, Ferruh Yigit: > On 5/21/2020 4:37 PM, Thomas Monjalon wrote: > > 21/05/2020 17:10, Ferruh Yigit: > >> During MTU set (kni_change_mtu) sample application setup queues, which > >> can free and re-allocate queues. > >> Meanwhile sample application keeps continues in Rx/Tx burst calls in > >> different threads, which may cause crash during queue setup. > >> > >> Pausing application Rx/Tx calls before MTU set and starts it back > >> afterwards. > >> > >> Bugzilla ID: 482 > >> Fixes: a26b116749a3 ("examples/kni: fix MTU change to setup Tx queue") > >> Cc: stable@dpdk.org > >> > >> Signed-off-by: Ferruh Yigit > >> --- > >> -/* Callback for request of changing MTU */ > >> static int > >> -kni_change_mtu(uint16_t port_id, unsigned int new_mtu) > >> +kni_change_mtu_(uint16_t port_id, unsigned int new_mtu) > > [...] > >> +/* Callback for request of changing MTU */ > >> +static int > >> +kni_change_mtu(uint16_t port_id, unsigned int new_mtu) > >> +{ > >> + int ret; > >> + > >> + rte_atomic32_inc(&kni_pause); > >> + ret = kni_change_mtu_(port_id, new_mtu); > >> + rte_atomic32_dec(&kni_pause); > >> + > >> + return ret; > >> +} > > > > Why creating a new function which is called only once? > > > > Just wrapping the existing one with stop/start the forwarding. > > These can be added into the existing function but there are many exit points in > the function, so it will create more clutter and it is more error prone. I think > this way more simple and clear. OK to go on the safe side at this stage of the release :-)