From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 7A039B3AB for ; Fri, 11 Jul 2014 18:29:15 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Jul 2014 09:23:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,644,1400050800"; d="scan'208";a="571802991" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga002.jf.intel.com with ESMTP; 11 Jul 2014 09:29:12 -0700 Received: from orsmsx102.amr.corp.intel.com ([169.254.1.246]) by ORSMSX108.amr.corp.intel.com ([169.254.4.79]) with mapi id 14.03.0123.003; Fri, 11 Jul 2014 09:29:12 -0700 From: "Venkatesan, Venky" To: "John W. Linville" Thread-Topic: [dpdk-dev] [PATCH] librte_pmd_packet: add PMD for AF_PACKET-based virtual devices Thread-Index: AQHPnR1re2NLAhzol0mLxm4RPYvdvZubDlSw Date: Fri, 11 Jul 2014 16:29:11 +0000 Message-ID: <1FD9B82B8BF2CF418D9A1000154491D974124768@ORSMSX102.amr.corp.intel.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> <20140711153309.GD25478@tuxdriver.com> In-Reply-To: <20140711153309.GD25478@tuxdriver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.138] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 16:29:15 -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.=20 > > 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 > >=20 > > 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"=20 > > > wrote: > > > > > > > This is a Linux-specific virtual PMD driver backed by an=20 > > > > 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=20 > > > necessary, especially when only one CPU can use a queue at a time. > >=20 > > That is a good point, worth checking out. FWIW, those lines are=20 > > boilerplate originally copied from the pcap PMD. :-) > >=20 >=20 > > Yes, I agree it's worth checking out if there is a performance=20 > > impact, but if we assume that the stats for RX/TX are possibly going=20 > > to be read by another core, they really should be volatile for=20 > > correctness >=20 > 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).=20 > "Unlikely" doesn't sound completely safe... :-) LOL. :-). This is an internal data structure and the DPDK docs specifically= mention that they are not multi-process safe/accessible. The unlikely was= for people that don't read the docs ... ;)