Skip to content

Commit

Permalink
dpif-netdev: Rename rxq_interval.
Browse files Browse the repository at this point in the history
rxq_interval was added before there was other #defines
and code related to rxq intervals.

Rename to rxq_next_cycles_store in order to make it more intuitive.

Requested-by: Ilya Maximets <[email protected]>
Signed-off-by: Kevin Traynor <[email protected]>
Acked-by: Antonio Fischetti <[email protected]>
Signed-off-by: Ian Stokes <[email protected]>
  • Loading branch information
kevintraynor authored and istokes committed Nov 16, 2017
1 parent daf22bf commit 64bf452
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/dpif-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ struct dp_netdev_pmd_thread {
long long int next_optimization;
/* End of the next time interval for which processing cycles
are stored for each polled rxq. */
long long int rxq_interval;
long long int rxq_next_cycle_store;

/* Cycles counters */
struct dp_netdev_pmd_cycles cycles;
Expand Down Expand Up @@ -4536,7 +4536,7 @@ dp_netdev_configure_pmd(struct dp_netdev_pmd_thread *pmd, struct dp_netdev *dp,
cmap_init(&pmd->flow_table);
cmap_init(&pmd->classifiers);
pmd->next_optimization = time_msec() + DPCLS_OPTIMIZATION_INTERVAL;
pmd->rxq_interval = time_msec() + PMD_RXQ_INTERVAL_LEN;
pmd->rxq_next_cycle_store = time_msec() + PMD_RXQ_INTERVAL_LEN;
hmap_init(&pmd->poll_list);
hmap_init(&pmd->tx_ports);
hmap_init(&pmd->tnl_port_cache);
Expand Down Expand Up @@ -6003,7 +6003,7 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd,
struct dpcls *cls;
long long int now = time_msec();

if (now > pmd->rxq_interval) {
if (now > pmd->rxq_next_cycle_store) {
/* Get the cycles that were used to process each queue and store. */
for (unsigned i = 0; i < poll_cnt; i++) {
uint64_t rxq_cyc_curr = dp_netdev_rxq_get_cycles(poll_list[i].rxq,
Expand All @@ -6013,7 +6013,7 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd,
0);
}
/* Start new measuring interval */
pmd->rxq_interval = now + PMD_RXQ_INTERVAL_LEN;
pmd->rxq_next_cycle_store = now + PMD_RXQ_INTERVAL_LEN;
}

if (now > pmd->next_optimization) {
Expand Down

0 comments on commit 64bf452

Please sign in to comment.