Hi Subash,

On Fri, 4 Dec 2020 at 22:56, <subas...@codeaurora.org> wrote:
>
> On 2020-12-03 10:40, Loic Poulain wrote:
> > A submitted qmap/rmnet packet size can not be larger than the linked
> > interface (real_dev) MTU. This patch ensures that the rmnet virtual
> > iface MTU is configured according real device capability.
> >
> > Signed-off-by: Loic Poulain <loic.poul...@linaro.org>
[...]
> > @@ -242,6 +247,9 @@ int rmnet_vnd_newlink(u8 id, struct net_device
> > *rmnet_dev,
> >
> >       priv->real_dev = real_dev;
> >
> > +     /* Align default MTU with real_dev MTU */
> > +     rmnet_vnd_change_mtu(rmnet_dev, real_dev->mtu -
> > RMNET_NEEDED_HEADROOM);
> > +
> >       rc = register_netdevice(rmnet_dev);
> >       if (!rc) {
> >               ep->egress_dev = rmnet_dev;
>
> This would need similar checks in the NETDEV_PRECHANGEMTU
> netdev notifier.

What about just returning an error on NETDEV_PRECHANGEMTU notification
to prevent real device MTU change while virtual rmnet devices are
linked? Not sure there is a more proper and thread safe way to manager
that otherwise.

Regards,
Loic

Reply via email to