OCTEON PKO多队列优化发包效率

executive-config.h里面有两个宏

#define CVMX_HELPER_PKO_QUEUES_PER_PORT_INITERFACE0 1
#define CVMX_HELPER_PKO_QUEUES_PER_PORT_INITERFACE1 1

将这两个宏改成12。在发包前代码稍作修改如下:

   /*
   * Begin packet output by requesting a tag switch to atomic.
   * Writing to a packet output queue must be synchronized across cores.
   *
   */
   int queue = cvmx_pko_get_base_queue(port) + cvmx_get_core_num();
   cvmx_pko_send_packet_prepare(port, queue, CVMX_PKO_LOCK_NONE);//CVMX_PKO_LOCK_ATOMIC_TAG);

这样每一个核对应一个发包队列。


你可能感兴趣的:(优化,output)