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 1A68AA04A2 for ; Thu, 21 May 2020 17:37:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CF7DD1D707; Thu, 21 May 2020 17:37:56 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id 2FD551D6F7; Thu, 21 May 2020 17:37:54 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id D2085ECF; Thu, 21 May 2020 11:37:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 21 May 2020 11:37:53 -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= bGzs1dyQm5R3D3pMPywuTh/bF7DGzp5aejK8mj0xC14=; b=TM3kGCzDfB/asHml pkBmtl2iyE3l3z+QbFoF0QkIFlkDyQwAgMWIxloohVOEukfSgPY3iE+rHnzj4xJK l3JkDru4PO7t+9lRJdjOuR7ahgu6+J2b4sWtVCIGFVwmkx19AVgYfgqlkFWHL2xp 1q7d7f1uPzj9YwaG2Y1HXcXAQ8T7Zj7vgTaUOBjE52ZoeN4nahH2o6fGltAioTWg Kkx4DxTr8L8CmnrLEj6KoZBiTijwODPL9fTHj5XtMRsYuCl0FU6Sfu8PE90f+qFq weoiuUZVzWckxZ8LWLy1rEa0ntG9nrKO3vcZCJfjbsWx+WyXLeNc/8cIJJmdrklF VejMWA== 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=bGzs1dyQm5R3D3pMPywuTh/bF7DGzp5aejK8mj0xC 14=; b=mdkpjJEOFC+Ufn9oD67gpX1Xzpu5OS5Pi/xo3Q0//cWzlWscUzwgi1hZw daNSpKOqSDNDYwUB+a5nUiamRT1nzInlQs6NKyfVAr0fsZpSz1tP9zWkwtlYQLIK 9Y0tNslHUsZ7WIfGTmJpkiXsF/9BG2zqMUCfUOiH7L6MlAXpzzRPu5zJMtSw9kbc xVinGcTE53NUc0JFDBVFEO84PFparHO/MpDgH0als3G4/+fd/q8BZbHSQu+qj/C+ RZT1qt+23i1YE7hW3wUNSEOBntZlCcKMQLrZyAz2LAi+5Jk3ANqjnBCrnqc0Im1V UrPp/xSp6E+ujoD0NMNFoOzyRJXRg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudduuddgkeekucetufdoteggodetrfdotf 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 7C66D3066495; Thu, 21 May 2020 11:37:51 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: Rasesh Mody , dev@dpdk.org, stable@dpdk.org, Xi Zhang Date: Thu, 21 May 2020 17:37:50 +0200 Message-ID: <2135471.CWJG7g5NFy@thomas> In-Reply-To: <20200521151042.3730374-1-ferruh.yigit@intel.com> References: <20200521151042.3730374-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/kni: fix crash during MTU set X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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?