[dpdk-dev] [PATCH 07/19] net/ice: support MTU setting
Varghese, Vipin
vipin.varghese at intel.com
Fri Nov 23 10:58:09 CET 2018
HI Wenzhou,
Following is a thought but not an issue. Can you please let me know your thought?
<snipped>
> +static int
> +ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) {
> + struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> + struct rte_eth_dev_data *dev_data = pf->dev_data;
> + uint32_t frame_size = mtu + ETHER_HDR_LEN
> + + ETHER_CRC_LEN + ICE_VLAN_TAG_SIZE;
> +
> + if (rte_eal_process_type() == RTE_PROC_SECONDARY)
> + return -E_RTE_SECONDARY;
> +
> + /* check if mtu is within the allowed range */
> + if ((mtu < ETHER_MIN_MTU) || (frame_size > ICE_FRAME_SIZE_MAX))
> + return -EINVAL;
> +
Should we set MTU > 1500 (Jumbo frame) if device is not configured to run with jumbo frame? If no, should we check the jumbo config is enabled for the current device?
> + /* mtu setting is forbidden if port is start */
> + if (dev_data->dev_started) {
> + PMD_DRV_LOG(ERR,
> + "port %d must be stopped before configuration",
> + dev_data->port_id);
> + return -EBUSY;
> + }
> +
> + if (frame_size > ETHER_MAX_LEN)
> + dev_data->dev_conf.rxmode.offloads |=
> + DEV_RX_OFFLOAD_JUMBO_FRAME;
> + else
> + dev_data->dev_conf.rxmode.offloads &=
> + ~DEV_RX_OFFLOAD_JUMBO_FRAME;
> +
> + dev_data->dev_conf.rxmode.max_rx_pkt_len = frame_size;
> +
> + return 0;
> +}
> --
> 1.9.3
More information about the dev
mailing list