> -----Original Message-----
> From: Ferruh Yigit <[email protected]>
> Sent: Wednesday, October 19, 2022 21:48
> To: Guo, Junfeng <[email protected]>; Zhang, Qi Z
> <[email protected]>; Wu, Jingjing <[email protected]>
> Cc: [email protected]; [email protected]; Li, Xiaoyun
> <[email protected]>; [email protected]; Richardson, Bruce
> <[email protected]>; Lin, Xueqin <[email protected]>
> Subject: Re: [PATCH v5 5/8] net/gve: add support for MTU setting
> 
> On 10/10/2022 11:17 AM, Junfeng Guo wrote:
> 
> >
> > Support dev_ops mtu_set.
> >
> > Signed-off-by: Xiaoyun Li <[email protected]>
> > Signed-off-by: Junfeng Guo <[email protected]>
> 
> <...>
> 
> >
> > +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;
> > +       }
> > +
> > +       dev->data->dev_conf.rxmode.mtu = mtu + RTE_ETHER_HDR_LEN;
> 
> it is 'dev->data->mtu' that holds latest MTU value.
> 
> 'dev_conf.rxmode.mtu' is the config requested from user, no need to
> update that.
> 
> And since 'dev->data->mtu' already updated by 'rte_eth_dev_set_mtu()',
> can drop above line.

Will fix this, thanks!

Reply via email to