From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id BADD4C31C for ; Wed, 15 Jun 2016 10:19:09 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id m124so23912829wme.1 for ; Wed, 15 Jun 2016 01:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=/c29HZMcvGAlEvNagwGyYiGJw39aHWzZq1Ix71BJkXQ=; b=jxVx0DktOagIFmkTDS285wG9LVSowQZFBqLZjIe/u8Vln8S+X5ITq58Ont1c4kPAFu bRKDu1c9lcvo5Dtvo9AebYTVupTqPA8MNBk4lDmdkHvKMqQaH+oWkLKmdKHrGZCCySPR G+g1g2R8GUzeGKEhWKtGZZOeko+tR/HupnouMKvj20Ot1K2VRdIziRN2HnL9nlAtqf46 IBmf+i9RVm6Y9HnNJ/jDd4qXaDa2HBIpWADNTrIkZzCv5OILKBwvfZ1L4uzsbFTGtzde ZS8KTKngJ6dho7pMe9R798ipaLtmxhsnS6qD/kXSAGFcuToo6zqxEz64iErceEKKeI79 HzKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=/c29HZMcvGAlEvNagwGyYiGJw39aHWzZq1Ix71BJkXQ=; b=A/rMcTEV8HzNnaiVwhxNrnAsBjIVEYC385mRjYpwFfFzFspdVzDs1VQOOBm5UiIEDj AU2rnqYlyLMCMcEregkMRbMZ1M+smxw4NNSxJuJTOGox9cDvccjGNPgO+Ry2AzcCYLzB 4x/ZR0QSedmb/LVxTu8DA1Bz3y8pPZ3ens+GugogoGr+Uw90wAZRdFfhkgsdagkybdcc PiPk3bk8/bvvtmi82X3iEz7nsQRYXBxt2zOKM1P/x1itao8m02nzUODArVdKU+ZQR8s3 nd6tz7LMR+MKd+Gy//dQCDjtCfX3yC19QuvOjG33tkdDOso5qqmvkateyMUGIQ6lQ2yZ TyGA== X-Gm-Message-State: ALyK8tII6p3KoN+OVnneW67jm7wfLrluATj3FMPFcjPDroylrt+iBvRryWq8y+/jZTPSkIRn X-Received: by 10.194.133.161 with SMTP id pd1mr10215599wjb.16.1465978749499; Wed, 15 Jun 2016 01:19:09 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id g10sm15227435wjl.25.2016.06.15.01.19.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2016 01:19:08 -0700 (PDT) From: Thomas Monjalon To: "Pattan, Reshma" Cc: dev@dpdk.org, "Ananyev, Konstantin" Date: Wed, 15 Jun 2016 10:19:07 +0200 Message-ID: <10886152.VH5xYhdqG2@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <3AEA2BF9852C6F48A459DA490692831F0104E1EE@IRSMSX109.ger.corp.intel.com> References: <1465575534-23605-1-git-send-email-reshma.pattan@intel.com> <12886124.K2biJ8F8kE@xps13> <3AEA2BF9852C6F48A459DA490692831F0104E1EE@IRSMSX109.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v9 1/8] ethdev: use locks to protect Rx/Tx callback lists X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 08:19:09 -0000 2016-06-15 05:30, Pattan, Reshma: > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > 2016-06-14 10:38, Reshma Pattan: > > > Added spinlocks around add/remove logic of Rx and Tx callbacks to > > > avoid corruption of callback lists in multithreaded context. > > > > > > Signed-off-by: Reshma Pattan > > > > Why cb->next is not locked in burst functions? > It is safe to do "read access" here and doesn't require any locking as rx/tx burst is initiated by only local user(control plane) thread. > > > Just protecting add/remove but not its usage seems useless. > Here locks were required around add/remove to protect "write access" because write to callback list is now done from 2 threads > i.e. one from local user thread(control plane) and another from pdump control thread(initiated by remote pdump request). So read and write can be done by different threads. I think the read access would need locking but we do not want it in fast path. Are you sure there is no issue in this design?