[dpdk-dev] [RFC] eventdev: event tx adapter APIs

Jerin Jacob jerin.jacob at caviumnetworks.com
Wed May 30 09:26:37 CEST 2018


-----Original Message-----
> Date: Fri, 25 May 2018 20:38:44 +0530
> From: Nikhil Rao <nikhil.rao at intel.com>
> To: jerin.jacob at caviumnetworks.com, hemant.agrawal at nxp.com
> CC: dev at dpdk.org, narender.vangati at intel.com, abhinandan.gujjar at intel.com,
>  gage.eads at intel.com, Nikhil Rao <nikhil.rao at intel.com>
> Subject: [RFC] eventdev: event tx adapter APIs
> X-Mailer: git-send-email 1.8.3.1
> 
> The patch below introduces the event tx adapter APIs that encapsulate common
> code for the tx stage of a packet processing pipeline. These APIs allow
> the application to configure a rte_service function that reads mbuf events
> from an event queue and sends mbufs on the transmit queue and ethernet
> port specified in the mbuf private area.
> 

Hi Nikhil,

I think, it is reasonable to have Tx adapter.

Some top level comments to starts with,

1) Slow path API looks fine. The only comment is, How about changing
rte_event_eth_tx_adapter_queue_add() instead of rte_event_eth_tx_adapter_queue_start()
to get align  with Rx adapter?

2) This my understanding of fastpath

a) Common code will have a extra port(given through adapter create)
where all workers invoke rte_event_enqueue_burst() to that port and then common code 
dequeue from that port and send packet
using rte_eth_tx_burst() and/or using tx buffering APIs

b) If the source queue or sched_type is ORDERED, When it enqueue to the extra port it
will change to atomic/direct to maintain the the ingress order if need.

Couple of issues and a minor change in RFC to fix the issues as a proposal.

Issue 1) I think, Using mbuf private data for such purpose will be a problem as
exiting application already may using for it own needs and there will be additional cache
miss etc on fastpath to get private data.

Issue 2) At least on Cavium, We can do so optimization by introducing
the same RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT schematics of Rx
adapter. i.e we don't need extra port to converge all traffic from
different workers and transmit.


Considering above two issues2, We would like propose an fastpath API,
which semantics is almost same rte_ethdev_tx_burst().
a) It will get ride of mbuf metadata need
b) New fastpath API gives driver enough possibilities of optimization if
possible.(address the issue (2))

The API can be like,

uint16_t rte_event_eth_tx_adapter_enqueue(uint16_t eth_port_id, uint16_t
eth_queue_id, uint8_t event_port_id, const struct rte_event ev[], uint16_t nb_events);

This API would land in driver as function pointer if device has
RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT capability.

If device does not have !RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT then 
common code can choose to ignore event_port_id in
rte_event_eth_tx_adapter_enqueue() and select the port given in adapter
create in common code.

So from the top-level, each worker lcore will look like

while(1)
{
	rte_event_dequeue_burst(..,worker[port],..);
	(process the packets)
	rte_event_eth_tx_adapter_enqueue(... worker[port],...);
}

Thoughts?


More information about the dev mailing list