2015-02-18 17:42, John McNamara:
> From: Richardson, Bruce <bruce.richardson at intel.com>
> 
> 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 <bruce.richardson at intel.com>
> Signed-off-by: John McNamara <john.mcnamara at intel.com>
[...]
> @@ -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

Reply via email to