lkml.org 
[lkml]   [2023]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH net-next] net: mana: Add support for jumbo frame
Date


> -----Original Message-----
> From: Leon Romanovsky <leon@kernel.org>
> Sent: Monday, March 20, 2023 3:42 AM
> To: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; Dexuan Cui
> <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Paul Rosswurm
> <paulros@microsoft.com>; olaf@aepfle.de; vkuznets@redhat.com;
> davem@davemloft.net; wei.liu@kernel.org; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com; Long Li <longli@microsoft.com>;
> ssengar@linux.microsoft.com; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net-next] net: mana: Add support for jumbo frame
>
> On Sun, Mar 19, 2023 at 02:27:44PM -0700, Haiyang Zhang wrote:
> > During probe, get the hardware allowed max MTU by querying the device
> > configuration. Users can select MTU up to the device limit. Also,
> > when XDP is in use, we currently limit the buffer size to one page.
> >
> > Updated RX data path to allocate and use RX queue DMA buffers with
> > proper size based on the MTU setting.
> >
> > Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> > ---
> > .../net/ethernet/microsoft/mana/mana_bpf.c | 22 +-
> > drivers/net/ethernet/microsoft/mana/mana_en.c | 229 ++++++++++++----
> --
> > include/net/mana/gdma.h | 4 +
> > include/net/mana/mana.h | 18 +-
> > 4 files changed, 183 insertions(+), 90 deletions(-)
>
> <...>
>
> > +static int mana_change_mtu(struct net_device *ndev, int new_mtu)
> > +{
> > + unsigned int old_mtu = ndev->mtu;
> > + int err, err2;
> > +
> > + err = mana_detach(ndev, false);
> > + if (err) {
> > + netdev_err(ndev, "mana_detach failed: %d\n", err);
> > + return err;
> > + }
> > +
> > + ndev->mtu = new_mtu;
> > +
> > + err = mana_attach(ndev);
> > + if (!err)
> > + return 0;
> > +
> > + netdev_err(ndev, "mana_attach failed: %d\n", err);
> > +
> > + /* Try to roll it back to the old configuration. */
> > + ndev->mtu = old_mtu;
> > + err2 = mana_attach(ndev);
>
> I second to Francois and agree with him that it is very questionable.
> If mana_attach() failed for first try, you should bail out and not
> retry with some hope that it will pass.
>

Will consider. Thanks.

\
 
 \ /
  Last update: 2023-03-27 01:09    [W:0.109 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site