From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by dpdk.org (Postfix) with ESMTP id 1FBE82BD5 for ; Tue, 7 May 2019 13:56:38 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 9432C40007 for ; Tue, 7 May 2019 13:56:37 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 7FE5340006; Tue, 7 May 2019 13:56:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.1 X-Spam-Score: -1.0 Received: from [192.168.1.59] (host-90-232-127-248.mobileonline.telia.com [90.232.127.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 9F9BD40005; Tue, 7 May 2019 13:56:36 +0200 (CEST) To: "Elo, Matias (Nokia - FI/Espoo)" , "dev@dpdk.org" References: <53AC5150-DBE2-4E46-9D93-99E01DCEC725@nokia.com> From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= Message-ID: <800ce1b4-a723-603a-3e5a-0837997e50e4@lysator.liu.se> Date: Tue, 7 May 2019 13:56:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <53AC5150-DBE2-4E46-9D93-99E01DCEC725@nokia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [dpdk-dev] eventdev: sw rx adapter enqueue caching X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 11:56:38 -0000 On 2019-05-07 11:52, Elo, Matias (Nokia - FI/Espoo) wrote: > Hi, > > The SW eventdev rx adapter has an internal enqueue buffer 'rx_adapter->event_enqueue_buffer', which stores packets received from the NIC until at least BATCH_SIZE (=32) packets have been received before enqueueing them to eventdev. For example in case of validation testing, where often a small number of specific test packets is sent to the NIC, this causes a lot of problems. One would always have to transmit at least BATCH_SIZE test packets before anything can be received from eventdev. Additionally, if the rx packet rate is slow this also adds a considerable amount of additional delay. > > Looking at the rx adapter API and sw implementation code there doesn’t seem to be a way to disable this internal caching. In my opinion this “functionality" makes testing sw rx adapter so cumbersome that either the implementation should be modified to enqueue the cached packets after a while (some performance penalty) or there should be some method to disable caching. Any opinions how this issue could be fixed? > The rx adaptor's service function will be called repeatedly, at a very high frequency (especially in near-idle situations). One potential scheme is to, by means of a counter, keeping track of the number of calls since the last packet was received from the NIC, and flush the buffers a number of idle (zero-NIC-dequeue) calls. In that case, you maintain good performance, while not introducing too much latency. The DSW Event Device takes this approach to flushing its internal buffers. Another way would be to use a timer. Either an adapter-internal TSC timestamp for buffer age, or a rte_timer timer. rdtsc is not for free, so I would lean toward the first option. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A35E6A0096 for ; Tue, 7 May 2019 13:56:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD935343C; Tue, 7 May 2019 13:56:39 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by dpdk.org (Postfix) with ESMTP id 1FBE82BD5 for ; Tue, 7 May 2019 13:56:38 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 9432C40007 for ; Tue, 7 May 2019 13:56:37 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 7FE5340006; Tue, 7 May 2019 13:56:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.1 X-Spam-Score: -1.0 Received: from [192.168.1.59] (host-90-232-127-248.mobileonline.telia.com [90.232.127.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 9F9BD40005; Tue, 7 May 2019 13:56:36 +0200 (CEST) To: "Elo, Matias (Nokia - FI/Espoo)" , "dev@dpdk.org" References: <53AC5150-DBE2-4E46-9D93-99E01DCEC725@nokia.com> From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= Message-ID: <800ce1b4-a723-603a-3e5a-0837997e50e4@lysator.liu.se> Date: Tue, 7 May 2019 13:56:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <53AC5150-DBE2-4E46-9D93-99E01DCEC725@nokia.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [dpdk-dev] eventdev: sw rx adapter enqueue caching X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190507115635.m0Ggrv5bX42jHt0n6eeGkFmgGKPT3uQ8YBsL8xxNK6g@z> On 2019-05-07 11:52, Elo, Matias (Nokia - FI/Espoo) wrote: > Hi, > > The SW eventdev rx adapter has an internal enqueue buffer 'rx_adapter->event_enqueue_buffer', which stores packets received from the NIC until at least BATCH_SIZE (=32) packets have been received before enqueueing them to eventdev. For example in case of validation testing, where often a small number of specific test packets is sent to the NIC, this causes a lot of problems. One would always have to transmit at least BATCH_SIZE test packets before anything can be received from eventdev. Additionally, if the rx packet rate is slow this also adds a considerable amount of additional delay. > > Looking at the rx adapter API and sw implementation code there doesn’t seem to be a way to disable this internal caching. In my opinion this “functionality" makes testing sw rx adapter so cumbersome that either the implementation should be modified to enqueue the cached packets after a while (some performance penalty) or there should be some method to disable caching. Any opinions how this issue could be fixed? > The rx adaptor's service function will be called repeatedly, at a very high frequency (especially in near-idle situations). One potential scheme is to, by means of a counter, keeping track of the number of calls since the last packet was received from the NIC, and flush the buffers a number of idle (zero-NIC-dequeue) calls. In that case, you maintain good performance, while not introducing too much latency. The DSW Event Device takes this approach to flushing its internal buffers. Another way would be to use a timer. Either an adapter-internal TSC timestamp for buffer age, or a rte_timer timer. rdtsc is not for free, so I would lean toward the first option.