From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id E3E325A92 for ; Fri, 13 Mar 2015 17:26:58 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 13 Mar 2015 09:26:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,395,1422950400"; d="scan'208";a="679748389" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga001.fm.intel.com with ESMTP; 13 Mar 2015 09:26:54 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.247]) by irsmsx105.ger.corp.intel.com ([169.254.7.117]) with mapi id 14.03.0195.001; Fri, 13 Mar 2015 16:26:53 +0000 From: "Mcnamara, John" To: Neil Horman , "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH] ethdev: additional parameter in RX callback Thread-Index: AQHQXOU9mNo7RPE6bEmXAywVhJMgMJ0ZOBAAgADx7YCAAEQVAIAAEhyAgAAFaACAAA6c0A== Date: Fri, 13 Mar 2015 16:26:52 +0000 Message-ID: References: <1426179268-22164-1-git-send-email-john.mcnamara@intel.com> <20150312191540.GB15260@hmsreliant.think-freely.org> <20150313094133.GA5056@bricha3-MOBL3> <20150313134514.GC28191@hmsreliant.think-freely.org> <20150313145002.GA11352@bricha3-MOBL3> <20150313150924.GF28191@hmsreliant.think-freely.org> In-Reply-To: <20150313150924.GF28191@hmsreliant.think-freely.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] 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] ethdev: additional parameter in RX callback 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, 13 Mar 2015 16:26:59 -0000 > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Friday, March 13, 2015 3:09 PM > To: Richardson, Bruce > Cc: Mcnamara, John; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] ethdev: additional parameter in RX > callback >=20 > Plese set asside the ABI issue for a moment. I get that you're trying to > get it in prior to needing to version it. Thats not the argument. The > argument is how best to codify the new information you want to express in > the callback. For this specific case, I think there are better ways to d= o > this than to just blindly add a new parameter. Hi Neil, I think that is good advice is the general case but this is a very specific= case. The modified callback is only used in rte_eth_rx_burst(). For contex= t here is the function in its entirety (without #defs). The substantive cha= nge (the addition of nb_pkts) is on the line with an asterisk: static inline uint16_t rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) { struct rte_eth_dev *dev; dev =3D &rte_eth_devices[port_id]; int16_t nb_rx =3D (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_i= d], rx_pkts, nb_pkts); struct rte_eth_rxtx_callback *cb =3D dev->post_rx_burst_cbs[queue_i= d]; if (unlikely(cb !=3D NULL)) { do { nb_rx =3D cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx, * nb_pkts, cb->param); cb =3D cb->next; } while (cb !=3D NULL); } return nb_rx; } > Encoding the array size > implicitly with a terminating marker lets you use this equally well with > the tx and rx callbacks (should you ever need it on the latter) Is encoding the information in the array really a better solution here? The= cb->param already exists for passing in user defined information to the ca= llback. The proposed patch merely transmits the parent function arguments t= o the enclosed callback. John