From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id EAE56B3A8 for ; Fri, 11 Jul 2014 17:44:41 +0200 (CEST) Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1X5d0V-0003iT-Sj; Fri, 11 Jul 2014 11:45:07 -0400 Received: from linville-x1.hq.tuxdriver.com (localhost.localdomain [127.0.0.1]) by linville-x1.hq.tuxdriver.com (8.14.8/8.14.6) with ESMTP id s6BFXAdH028213; Fri, 11 Jul 2014 11:33:11 -0400 Received: (from linville@localhost) by linville-x1.hq.tuxdriver.com (8.14.8/8.14.8/Submit) id s6BFXAoj028212; Fri, 11 Jul 2014 11:33:10 -0400 Date: Fri, 11 Jul 2014 11:33:10 -0400 From: "John W. Linville" To: "Venkatesan, Venky" Message-ID: <20140711153309.GD25478@tuxdriver.com> References: <1405024369-30058-1-git-send-email-linville@tuxdriver.com> <20140711061147.06c12136@samsung-9> <20140711144912.GA25478@tuxdriver.com> <59AF69C657FD0841A61C55336867B5B0343ACD8B@IRSMSX103.ger.corp.intel.com> <1FD9B82B8BF2CF418D9A1000154491D974124465@ORSMSX102.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1FD9B82B8BF2CF418D9A1000154491D974124465@ORSMSX102.amr.corp.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] librte_pmd_packet: add PMD for AF_PACKET-based virtual devices 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: Fri, 11 Jul 2014 15:44:42 -0000 On Fri, Jul 11, 2014 at 03:29:17PM +0000, Venkatesan, Venky wrote: > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of John W. Linville > > Sent: Friday, July 11, 2014 7:49 AM > > To: Stephen Hemminger > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] librte_pmd_packet: add PMD for > > AF_PACKET- based virtual devices > > > > On Fri, Jul 11, 2014 at 06:11:47AM -0700, Stephen Hemminger wrote: > > > On Thu, 10 Jul 2014 16:32:49 -0400 > > > "John W. Linville" wrote: > > > > > > > This is a Linux-specific virtual PMD driver backed by an AF_PACKET > > > > +struct pkt_rx_queue { > > > > + int sockfd; > > > > + > > > > + struct iovec *rd; > > > > + uint8_t *map; > > > > + unsigned int framecount; > > > > + unsigned int framenum; > > > > + > > > > + struct rte_mempool *mb_pool; > > > > + > > > > + volatile unsigned long rx_pkts; > > > > + volatile unsigned long err_pkts; > > > > > > Use of volatile will generate slow code, don't think it is > > > necessary, especially when only one CPU can use a queue at a time. > > > > That is a good point, worth checking out. FWIW, those lines are > > boilerplate originally copied from the pcap PMD. :-) > > > > > Yes, I agree it's worth checking out if there is a performance impact, but if we assume that the stats for RX/TX are possibly going to be read by another core, they really should be volatile for correctness > > Accessing the rx_queue structure directly for stats is unlikely to happen from a second core; we should probably change the PCAP PMD as well (thanks for pointing that out John). "Unlikely" doesn't sound completely safe... :-) -- John W. Linville Someday the world will need a hero, and you linville@tuxdriver.com might be all we have. Be ready.