[PATCH v7 5/8] net/gve: add support for MTU setting

Ferruh Yigit ferruh.yigit at amd.com
Mon Oct 24 12:47:52 CEST 2022


On 10/24/2022 6:04 AM, Guo, Junfeng wrote:
> 
> 
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit at amd.com>
>> Sent: Friday, October 21, 2022 17:50
>> To: Guo, Junfeng <junfeng.guo at intel.com>; Zhang, Qi Z
>> <qi.z.zhang at intel.com>; Wu, Jingjing <jingjing.wu at intel.com>; Xing,
>> Beilei <beilei.xing at intel.com>
>> Cc: dev at dpdk.org; Li, Xiaoyun <xiaoyun.li at intel.com>;
>> awogbemila at google.com; Richardson, Bruce
>> <bruce.richardson at intel.com>; hemant.agrawal at nxp.com;
>> stephen at networkplumber.org; Xia, Chenbo <chenbo.xia at intel.com>;
>> Zhang, Helin <helin.zhang at intel.com>
>> Subject: Re: [PATCH v7 5/8] net/gve: add support for MTU setting
>>
>> On 10/21/2022 10:19 AM, Junfeng Guo wrote:
>>
>>>
>>> Support dev_ops mtu_set.
>>>
>>> Signed-off-by: Xiaoyun Li <xiaoyun.li at intel.com>
>>> Signed-off-by: Junfeng Guo <junfeng.guo at intel.com>
>>
>> <...>
>>
>>> +static int
>>> +gve_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
>>> +{
>>> +       struct gve_priv *priv = dev->data->dev_private;
>>> +       int err;
>>> +
>>> +       if (mtu < RTE_ETHER_MIN_MTU || mtu > priv->max_mtu) {
>>> +               PMD_DRV_LOG(ERR, "MIN MTU is %u, MAX MTU is %u",
>>> +                           RTE_ETHER_MIN_MTU, priv->max_mtu);
>>> +               return -EINVAL;
>>> +       }
>>> +
>>> +       /* mtu setting is forbidden if port is start */
>>> +       if (dev->data->dev_started) {
>>> +               PMD_DRV_LOG(ERR, "Port must be stopped before
>> configuration");
>>> +               return -EBUSY;
>>> +       }
>>> +
>>> +       err = gve_adminq_set_mtu(priv, mtu);
>>> +       if (err) {
>>> +               PMD_DRV_LOG(ERR, "Failed to set mtu as %u err = %d", mtu,
>> err);
>>> +               return err;
>>> +       }
>>> +
>>> +       return 0;
>>> +}
>>> +
>>
>> [copy/paste from previous version]
>>
>> configure() (gve_dev_configure()) also get 'mtu' as user config
>> ('eth_conf->rxmode.mtu') which is ignored right now,
>>
>> since there is 'gve_adminq_set_mtu()' command already what do you
>> think
>> to use it within 'gve_dev_configure()'?
> 
> There may be issues to set mtu with ('eth_conf->rxmode.mtu').
> So better to keep this ignored at this stage.
> 

What do you mean by issues?

'eth_conf->rxmode.mtu' is user provided config parameter, so user may 
prefer to provide this value and not call 'rte_eth_dev_set_mtu()' at all 
and still can expect correct MTU value.


More information about the dev mailing list