From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 6259D1B4CD for ; Fri, 29 Jun 2018 16:23:27 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A4C0E401C978; Fri, 29 Jun 2018 14:23:26 +0000 (UTC) Received: from [10.36.112.15] (unknown [10.36.112.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C127F1C739; Fri, 29 Jun 2018 14:23:21 +0000 (UTC) To: Shahaf Shuler , "bernard.iremonger@intel.com" , "dev@dpdk.org" Cc: "ailan@redhat.com" , "jan.scheurich@ericsson.com" , "vkaplans@redhat.com" , "bruce.richardson@intel.com" , Thomas Monjalon , "konstantin.ananyev@intel.com" , "ferruh.yigit@intel.com" , Jens Freimann References: <20180623080840.315-1-maxime.coquelin@redhat.com> <20180623080840.315-2-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <94e0a21b-e071-8ace-f80b-e0e3c3557fb0@redhat.com> Date: Fri, 29 Jun 2018 16:23:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 29 Jun 2018 14:23:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 29 Jun 2018 14:23:26 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH v4 1/2] testpmd: add forwarding mode to simulate a noisy neighbour 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: Fri, 29 Jun 2018 14:23:27 -0000 Hi Sharaf, On 06/26/2018 02:17 PM, Shahaf Shuler wrote: >> +/* >> + * Forwarding of packets in I/O mode. >> + * Forward packets "as-is". >> + * This is the fastest possible forwarding operation, as it does not >> +access >> + * to packets data. >> + */ >> +static void >> +pkt_burst_noisy_vnf(struct fwd_stream *fs) { >> + struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; >> + uint16_t nb_rx; >> + uint16_t nb_tx = 0; >> + uint32_t retry; >> + const uint64_t freq_khz = rte_get_timer_hz() / 1000; >> + struct noisy_config *ncf = &noisy_cfg[fs->tx_queue]; >> + struct rte_mbuf *tmp_pkts[MAX_PKT_BURST]; >> + uint16_t nb_enqd; >> + uint16_t nb_deqd = 0; >> + uint64_t delta_ms; >> + uint64_t now; >> + >> + /* >> + * Receive a burst of packets and forward them. >> + */ >> + nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, >> + pkts_burst, nb_pkt_per_burst); >> + if (unlikely(nb_rx == 0)) >> + return; >> + fs->rx_packets += nb_rx; >> + >> + if (noisy_bsize_before_send > 0) { >> + if (rte_ring_free_count(ncf->f) >= nb_rx) { >> + /* enqueue into fifo */ >> + nb_enqd = fifo_put(ncf->f, pkts_burst, nb_rx); >> + if (nb_enqd < nb_rx) >> + nb_rx = nb_enqd; > Am not sure I understand this part. > The simulation of the memory lookups should happen for every packet **before** deciding on the output queue. Isn't it more realistic to simulate the memory access after the rx_burst? > The idea with the series is to simulate the noise caused by other VNFs running on the same cores (it is not simulating memory accesses on the burst of packets being handled). Maxime