From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 1F06CB4BD for ; Wed, 18 Feb 2015 19:20:38 +0100 (CET) Received: by mail-wg0-f50.google.com with SMTP id l2so2760625wgh.9 for ; Wed, 18 Feb 2015 10:20:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=GRdu0R5vmvuRdJrjteh1gHRGAm220S6kmXETSCdJTiI=; b=LRS2SyVElOlJpooueX1B3HsZ7ZhJ52g7b/IC/wMKOKoaoKtZSRY5O5QxVkYr5ghqjc tP8a34TvZKdjCUlrboiWph4fwgqqHN3264InSXDHZ0llHG4nEqsFtwX2aroQgw41AwLN kRnx71kB6zwjRWbANvkWs4jPhTUJH1A9DUp/DLi4RhuepfrPGm9BssiLgbLeZBE+PqwY L2p4qFhWl+xJMMwq2NQv+g6Jir6q+ATu3bGRA9V0aj1T9z5XoZCQTRD75jC9X15AVcc7 VeLiySTQIh2foOAEXo7lwFsIxU/Voqzm97Aojxuuvoh2YSesMtgM0apH+XrrpDjDRNuI rQeA== X-Gm-Message-State: ALoCoQkQcvuiwxUU6JG359V6BcBJCWQTX4UiiJ9r0I9qULJDSGqxQNYfkk5/pTIN5+UqpXUXnlRP X-Received: by 10.194.88.131 with SMTP id bg3mr806218wjb.119.1424283637985; Wed, 18 Feb 2015 10:20:37 -0800 (PST) Received: from xps13.localnet (178.16.90.92.rev.sfr.net. [92.90.16.178]) by mx.google.com with ESMTPSA id nb14sm916173wic.18.2015.02.18.10.20.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 10:20:37 -0800 (PST) From: Thomas Monjalon To: John McNamara , bruce.richardson@intel.com Date: Wed, 18 Feb 2015 19:19:56 +0100 Message-ID: <1752572.3jiM2I5nLp@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <1424281343-2994-3-git-send-email-john.mcnamara@intel.com> References: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> <1424281343-2994-1-git-send-email-john.mcnamara@intel.com> <1424281343-2994-3-git-send-email-john.mcnamara@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3 2/3] ethdev: Add rxtx callback 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: Wed, 18 Feb 2015 18:20:38 -0000 2015-02-18 17:42, John McNamara: > From: Richardson, Bruce > > Add in support for inline processing of packets inside the RX or > TX call. For an RX callback, what happens is that we get a set of > packets from the NIC and then pass them to a callback function, if > configured, to allow additional processing to be done on them, e.g. > filling in more mbuf fields, before passing back to the application. > On TX, the packets are similarly post-processed before being handed > to the NIC for transmission. > > Signed-off-by: Bruce Richardson > Signed-off-by: John McNamara [...] > @@ -2393,7 +2447,18 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, > struct rte_eth_dev *dev; > > dev = &rte_eth_devices[port_id]; > - return (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], rx_pkts, nb_pkts); > + nb_pkts = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], rx_pkts, > + nb_pkts); > + struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id]; > + > + if (unlikely(cb != NULL)) { > + do { > + nb_pkts = cb->fn(port_id, queue_id, rx_pkts, nb_pkts, > + cb->param); > + cb = cb->next; > + } while (cb != NULL); > + } Excuse me, it wasn't very clear for me but I thought from the following email that the consensus was to use a compile-time option: http://dpdk.org/ml/archives/dev/2015-February/013450.html