[ovs-dev] [PATCH v2 2/5] netdev-dpdk: Set current timestamp when flushing TX queue.
Daniele Di Proietto
ddiproietto at vmware.com
Mon Jun 30 18:17:17 UTC 2014
On Jun 30, 2014, at 11:08 AM, Pravin Shelar <pshelar at nicira.com> wrote:
> On Mon, Jun 30, 2014 at 9:56 AM, Daniele Di Proietto
> <ddiproietto at vmware.com> wrote:
>> I was happier with the previous approach, i.e. setting the timestamp on the first queued packet.
>> Maybe there are issues I don’t see, can you elaborate a little?
>>
>
> tsc is set conditionally when count is one, but the count might not
> set to one in a loop due to batched packets. So I think this fixes a
> bug. I pushed this patch.
> But I think we can further improve this flush time-stamp.
>
You’re right, thanks for clarifying this.
Of course, we can this improve later
Thanks,
Daniele
>
>> Thanks,
>>
>> Daniele
>>
>> On Jun 26, 2014, at 6:16 PM, Ryan Wilson <wryan at nicira.com> wrote:
>>
>>> The current timestamp should be set every time the queue is flushed.
>>> Thus, if DRAIN_TSC timer cycles have passed since the last timestamp,
>>> the send queue should be flushed again.
>>>
>>> Signed-off-by: Ryan Wilson <wryan at nicira.com>
>>> ---
>>> lib/netdev-dpdk.c | 8 ++------
>>> 1 file changed, 2 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
>>> index 084e8cd..6e1d293 100644
>>> --- a/lib/netdev-dpdk.c
>>> +++ b/lib/netdev-dpdk.c
>>> @@ -581,6 +581,7 @@ dpdk_queue_flush__(struct netdev_dpdk *dev, int qid)
>>> (txq->count - nb_tx));
>>> }
>>> txq->count = 0;
>>> + txq->tsc = rte_get_timer_cycles();
>>> }
>>>
>>> static void
>>> @@ -626,7 +627,6 @@ dpdk_queue_pkts(struct netdev_dpdk *dev, int qid,
>>> {
>>> struct dpdk_tx_queue *txq = &dev->tx_q[qid];
>>> uint64_t diff_tsc;
>>> - uint64_t cur_tsc;
>>>
>>> int i = 0;
>>>
>>> @@ -644,11 +644,7 @@ dpdk_queue_pkts(struct netdev_dpdk *dev, int qid,
>>> if (txq->count == MAX_TX_QUEUE_LEN) {
>>> dpdk_queue_flush__(dev, qid);
>>> }
>>> - cur_tsc = rte_get_timer_cycles();
>>> - if (txq->count == 1) {
>>> - txq->tsc = cur_tsc;
>>> - }
>>> - diff_tsc = cur_tsc - txq->tsc;
>>> + diff_tsc = rte_get_timer_cycles() - txq->tsc;
>>> if (diff_tsc >= DRAIN_TSC) {
>>> dpdk_queue_flush__(dev, qid);
>>> }
>>> --
>>> 1.7.9.5
>>>
>>> _______________________________________________
>>> dev mailing list
>>> dev at openvswitch.org
>>> https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=MV9BdLjtFIdhBDBaw5z%2BU6SSA2gAfY4L%2F1HCy3VjlKU%3D%0A&m=CtFeOvayf%2FFdGR8E3K%2Bq8k57QZOfY3azsWO1qjDWcTE%3D%0A&s=253d27d2e4572741659f572d3ed31b1e8b5bd9fad9bbc54cab525d6df48ed413
>>
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=MV9BdLjtFIdhBDBaw5z%2BU6SSA2gAfY4L%2F1HCy3VjlKU%3D%0A&m=ooIVBrpCwxPNI%2BlZ1KT8%2FDRSv5KKtb1s3Fz73FX5X5c%3D%0A&s=11c7c3cc84a098e0aa95e7c6b3bb256f2d5d6fce376e45fa765bbb8988d4457a
More information about the dev
mailing list