On 12/9/2019 9:46 PM, Alfredo Cardigliano wrote: > Add support for port start/stop and handle basic features > including mtu and link up/down. > > Signed-off-by: Alfredo Cardigliano <cardigli...@ntop.org> > Reviewed-by: Shannon Nelson <snel...@pensando.io>
<...> > +static int > +ionic_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) > +{ > + struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev); > + int err; > + > + IONIC_PRINT_CALL(); > + > + /* > + * Max frame size is MTU + Ethernet header + VLAN + QinQ > + * (plus ETHER_CRC_LEN if the adapter is able to keep CRC) > + * uint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + 4 + 4; > + */ 'max_rx_pkt_len' is a user provided configuration value, you may need to check if provide MTU value is bigger than it and fail if scattered Rx is not supported. > + > + /* Check that mtu is within the allowed range */ > + if (mtu < IONIC_MIN_MTU || mtu > IONIC_MAX_MTU) > + return -EINVAL; This check is now redundant and can be removed, since 'dev_info->min_mtu' & 'dev_info->max_mtu' are provided.