From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 2/8] lib/librte_ether: defind RX/TX lock mode Date: Tue, 7 Jun 2016 19:15:53 -0700 Message-ID: <20160607191553.10993efe@xeon-e3> References: <1465191653-28408-1-git-send-email-wenzhuo.lu@intel.com> <1465191653-28408-3-git-send-email-wenzhuo.lu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Zhe Tao To: Wenzhuo Lu Return-path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 8C721AD93 for ; Wed, 8 Jun 2016 04:15:39 +0200 (CEST) Received: by mail-pa0-f43.google.com with SMTP id hl6so4176250pac.2 for ; Tue, 07 Jun 2016 19:15:39 -0700 (PDT) In-Reply-To: <1465191653-28408-3-git-send-email-wenzhuo.lu@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 6 Jun 2016 13:40:47 +0800 Wenzhuo Lu wrote: > Define lock mode for RX/TX queue. Because when resetting > the device we want the resetting thread to get the lock > of the RX/TX queue to make sure the RX/TX is stopped. > > Using next ABI macro for this ABI change as it has too > much impact. 7 APIs and 1 global variable are impacted. > > Signed-off-by: Wenzhuo Lu > Signed-off-by: Zhe Tao Why does this patch set make a different assumption the rest of the DPDK? The rest of the DPDK operates on the principle that the application is smart enough to stop the device before making changes. There is no equivalent to the Linux kernel RTNL mutex. The API assumes application threads are well behaved and will not try and sabotage each other. If you restrict the reset operation to only being available when RX/TX is stopped, then no lock is needed. The fact that it requires lots more locking inside each device driver implies to me this is not correct way to architect this.