[dpdk-dev] [PATCH] i40e: configure MTU

Julien Meunier julien.meunier at 6wind.com
Wed Apr 27 13:43:43 CEST 2016


Hello,

On 04/23/2016 01:26 PM, Beilei Xing wrote:
[...]
> +	/* mtu setting is forbidden if port is start */
> +	if (dev_data->dev_started) {
> +		PMD_DRV_LOG(ERR,
> +			    "port %d must be stopped before configuration\n",
> +			    dev_data->port_id);
> +		return -EBUSY;
> +	}

According to rte_ethdev.h, only 4 return codes are supported for
rte_eth_dev_set_mtu:

* - (0) if successful.
* - (-ENOTSUP) if operation is not supported.
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if *mtu* invalid.

EBUSY should not be returned.

> +	for (i = 0; i < dev_data->nb_rx_queues; i++) {
> +		rxq = dev_data->rx_queues[i];
> +		if (!rxq || !rxq->q_set)
> +			continue;
> +
> +		dev_data->dev_conf.rxmode.max_rx_pkt_len = frame_size;
> +		len = hw->func_caps.rx_buf_chain_len * rxq->rx_buf_len;
> +		rxq->max_pkt_len = RTE_MIN(len, frame_size);
> +	}
> +
> +	ret = i40e_dev_rx_init(pf);
> +
> +	return ret;
> +}
> 

Why do want to reconfigure rxq here ? All these operations are already
done when you call i40e_dev_rx_init.
i40e_dev_rx_init => i40e_rx_queue_init (for each queue) =>
i40e_rx_queue_config => redefine rxq->max_pkt_len

Moreover, you should move dev_data->dev_conf.rxmode.max_rx_pkt_len out
of the loop. frame_size is the same for all rx_queues.

-- 
Julien MEUNIER
6WIND


More information about the dev mailing list