If an rxq is marked as 'prioritized' then keep reading from this queue until there are no packets available. Only then proceed to other queues.
Signed-off-by: Billy O'Mahony <billy.o.mah...@intel.com> --- lib/dpif-netdev.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 9ce3456..d9f014d 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -488,6 +488,7 @@ struct dp_netdev_pmd_cycles { struct polled_queue { struct netdev_rxq *rx; odp_port_t port_no; + uint8_t is_priority; }; /* Contained by struct dp_netdev_pmd_thread's 'poll_list' member. */ @@ -3801,6 +3802,8 @@ pmd_load_queues_and_ports(struct dp_netdev_pmd_thread *pmd, HMAP_FOR_EACH (poll, node, &pmd->poll_list) { poll_list[i].rx = poll->rxq->rx; poll_list[i].port_no = poll->rxq->port->port_no; + poll_list[i].is_priority = \ + (poll->rxq->rx->queue_id == poll->rxq->rx->netdev->priority_rxq); i++; } @@ -3849,15 +3852,24 @@ reload: lc = UINT_MAX; } + unsigned int log_cnt = 0; + int streak_len; + const unsigned int MAX_STREAK_LEN = 100; cycles_count_start(pmd); for (;;) { + log_cnt++; for (i = 0; i < poll_cnt; i++) { - process_packets = - dp_netdev_process_rxq_port(pmd, poll_list[i].rx, - poll_list[i].port_no); - cycles_count_intermediate(pmd, - process_packets ? PMD_CYCLES_PROCESSING - : PMD_CYCLES_IDLE); + streak_len = 0; + do { + process_packets = + dp_netdev_process_rxq_port(pmd, poll_list[i].rx, + poll_list[i].port_no); + cycles_count_intermediate(pmd, + process_packets ? PMD_CYCLES_PROCESSING + : PMD_CYCLES_IDLE); + streak_len++; + } while (process_packets && poll_list[i].is_priority && + streak_len < MAX_STREAK_LEN); } if (lc++ > 1024) { -- 2.7.4 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev