From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id F08FD2E81 for ; Tue, 31 May 2016 16:55:28 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 31 May 2016 07:55:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,395,1459839600"; d="scan'208";a="965851799" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga001.jf.intel.com with ESMTP; 31 May 2016 07:55:23 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 31 May 2016 15:55:08 +0100 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.193]) by irsmsx155.ger.corp.intel.com ([169.254.14.34]) with mapi id 14.03.0248.002; Tue, 31 May 2016 15:55:08 +0100 From: "Pattan, Reshma" To: "Ananyev, Konstantin" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 5/9] lib/librte_pdump: add new library for packet capturing support Thread-Index: AQHRuB0rl7xRZQvngkqqk9oqlli5EJ/M18hA////OwCABlFBEA== Date: Tue, 31 May 2016 14:55:07 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F010454A0@IRSMSX109.ger.corp.intel.com> References: <1463503030-10318-1-git-send-email-reshma.pattan@intel.com> <1464039512-2683-1-git-send-email-reshma.pattan@intel.com> <1464039512-2683-6-git-send-email-reshma.pattan@intel.com> <2601191342CEEE43887BDE71AB97725836B67FBC@irsmsx105.ger.corp.intel.com> <3AEA2BF9852C6F48A459DA490692831F01044D7E@IRSMSX109.ger.corp.intel.com> <2601191342CEEE43887BDE71AB97725836B68132@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB97725836B68132@irsmsx105.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGY1OTkwMDEtMmRjZi00MzkxLTg3ZDUtMWNiYTdmOTQ3YmE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InhpeWc0dGMrVEh2YTl4WWFHdTVSc3ZrRG9vT2JRbTFaK1lweWU3andtazg9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 5/9] lib/librte_pdump: add new library for packet capturing support 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: Tue, 31 May 2016 14:55:29 -0000 > -----Original Message----- > From: Ananyev, Konstantin > Sent: Friday, May 27, 2016 4:26 PM > To: Pattan, Reshma ; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v4 5/9] lib/librte_pdump: add new library = for > packet capturing support >=20 >=20 >=20 > > -----Original Message----- > > From: Pattan, Reshma > > Sent: Friday, May 27, 2016 3:55 PM > > To: Ananyev, Konstantin; dev@dpdk.org > > Cc: Pattan, Reshma > > Subject: RE: [dpdk-dev] [PATCH v4 5/9] lib/librte_pdump: add new > > library for packet capturing support > > > > > > > > > -----Original Message----- > > > From: Ananyev, Konstantin > > > Sent: Friday, May 27, 2016 2:39 PM > > > To: Pattan, Reshma ; dev@dpdk.org > > > Cc: Pattan, Reshma > > > Subject: RE: [dpdk-dev] [PATCH v4 5/9] lib/librte_pdump: add new > > > library for packet capturing support > > > > > > Hi Reshma, > > > > > > +static int > > > > +pdump_regitser_callbacks(uint32_t dir, uint16_t end_q, > > > > + uint8_t port, uint16_t queue, > > > > + struct rte_ring *ring, struct rte_mempool *mp, > > > > + uint16_t operation) > > > > +{ > > > > + > > > > + uint16_t qid; > > > > + struct pdump_rxtx_cbs *cbs =3D NULL; > > > > + > > > > + qid =3D (queue =3D=3D RTE_PDUMP_ALL_QUEUES) ? 0 : queue; > > > > + for (; qid < end_q; qid++) { > > > > + if ((dir & RTE_PDUMP_FLAG_RX) !=3D 0) > > > > + cbs =3D &rx_cbs[port][qid]; > > > > + if ((dir & RTE_PDUMP_FLAG_TX) !=3D 0) > > > > + cbs =3D &tx_cbs[port][qid]; > > > > > > In case you have dir =3D=3D (RTE_PDUMP_FLAG_RX | RTE_PDUMP_FLAG_TX) > > > you'll overwrite your rx_cbs pointer with tx_cbs pointer. > > > I suppose you need 2 local vars: cbs_rx and cbs_tx here. > > > Again probably worth to have 2 helper functions: > > > pdump_regitser_rx_callback() and pdump_regitser_tx_callback() and > > > call them from that one. > > > Or you'll never invoke that function with dir =3D=3D(RTE_PDUMP_FLAG_R= X | > > > RTE_PDUMP_FLAG_TX)? > > > If so, it porbably worth to put it into comments, though if it would > > > be me, I still think it would be good to split it in a way I mentione= d above. > > > > > > > Yes, I never invoke the function with dir =3D=3D(RTE_PDUMP_FLAG_RX | > RTE_PDUMP_FLAG_TX). >=20 > Ok, then at least probably comment it somehow. > Though I still think 2 different variables (and might be functions) would= be > better. >=20 > > Ok, I will add a comment. Thanks, Reshma