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 E81C4960B for ; Tue, 14 Jun 2016 23:43:59 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 14 Jun 2016 14:43:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,472,1459839600"; d="scan'208";a="828118821" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga003.jf.intel.com with ESMTP; 14 Jun 2016 14:43:58 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.193]) by IRSMSX102.ger.corp.intel.com ([169.254.2.10]) with mapi id 14.03.0248.002; Tue, 14 Jun 2016 22:43:55 +0100 From: "Pattan, Reshma" To: Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v9 2/8] ethdev: add new api to add Rx callback as head of the list Thread-Index: AQHRxiCHY4DpvF2MXU+4xzKbtXJh2J/pUiYAgAAnlwA= Date: Tue, 14 Jun 2016 21:43:54 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F0104DF7C@IRSMSX109.ger.corp.intel.com> References: <1465575534-23605-1-git-send-email-reshma.pattan@intel.com> <1465897108-26548-1-git-send-email-reshma.pattan@intel.com> <1465897108-26548-3-git-send-email-reshma.pattan@intel.com> <5708967.CQrqTqxUyg@xps13> In-Reply-To: <5708967.CQrqTqxUyg@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmQzNmY3YTctMDJjMy00ZjRmLTkyYWItNjAzZDYzZGM3MWNhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InZsejFuNjNNWDlZVDVReW1tMzFXaXVhbXJHMFRjRUhSQUFwVkRUam8xaVE9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v9 2/8] ethdev: add new api to add Rx callback as head of the list 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, 14 Jun 2016 21:44:00 -0000 Hi, > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Tuesday, June 14, 2016 9:02 PM > To: Pattan, Reshma > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v9 2/8] ethdev: add new api to add Rx call= back > as head of the list >=20 > 2016-06-14 10:38, Reshma Pattan: > > Added new public api rte_eth_add_first_rx_callback to add given > > callback as head of the list. > > > > Signed-off-by: Reshma Pattan > > --- > > +/* > > +* Add a callback that must be called first on packet RX on a given > > +port > > +* and queue. > > +* > > +* This API configures a first function to be called for each burst of > > +* packets received on a given NIC port queue. The return value is a > > +pointer > > +* that can be used to later remove the callback using > > +* rte_eth_remove_rx_callback(). > > +* > > +* Multiple functions are called in the order that they are added. > > +* > > +* @param port_id > > +* The port identifier of the Ethernet device. > > +* @param queue_id > > +* The queue on the Ethernet device on which the callback is to be ad= ded. > > +* @param fn > > +* The callback function > > +* @param user_param > > +* A generic pointer parameter which will be passed to each invocatio= n of > the > > +* callback function on this port and queue. > > +* > > +* @return > > +* NULL on error. > > +* On success, a pointer value which can later be used to remove the > callback. > > +*/ > > +void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id= , > > + rte_rx_callback_fn fn, void *user_param); >=20 > Sorry I fail to understand why this function is needed. > What cannot be done in rte_eth_add_rx_callback? Packet capturing framework should display Rx packets of NIC even before the= y are being processed by other callbacks of the=20 application (because other callback s of application may change the packet = data as part of the processing). So packet capturing framework should register a callback at the head of th= e Rx callback list so that callback always gets=20 called first before any other callbacks of the applications. Hence this A= PI is introduced.=20 Thanks, Reshma