From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v4 1/2] testpmd: add forwarding mode to simulate a noisy neighbour Date: Fri, 29 Jun 2018 16:23:20 +0200 Message-ID: <94e0a21b-e071-8ace-f80b-e0e3c3557fb0@redhat.com> References: <20180623080840.315-1-maxime.coquelin@redhat.com> <20180623080840.315-2-maxime.coquelin@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 To: Shahaf Shuler , "bernard.iremonger@intel.com" , "dev@dpdk.org" 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) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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