[dpdk-dev] [PATCH v4 1/2] testpmd: add forwarding mode to simulate a noisy neighbour

Maxime Coquelin maxime.coquelin at redhat.com
Fri Jun 29 16:23:20 CEST 2018


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


More information about the dev mailing list