From: Francois Romieu <romieu@fr.zoreil.com>
To: Haiyang Zhang <haiyangz@microsoft.com>
Cc: "linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"netdev@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" <olaf@aepfle.de>,
"vkuznets@redhat.com" <vkuznets@redhat.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"leon@kernel.org" <leon@kernel.org>,
Long Li <longli@microsoft.com>,
"ssengar@linux.microsoft.com" <ssengar@linux.microsoft.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: mana: Add support for jumbo frame
Date: Mon, 20 Mar 2023 12:33:17 +0100 [thread overview]
Message-ID: <20230320113317.GA290683@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <PH7PR21MB31162F5F9E5C8C146760AF10CA809@PH7PR21MB3116.namprd21.prod.outlook.com>
Haiyang Zhang <haiyangz@microsoft.com> :
> > From: Francois Romieu <romieu@fr.zoreil.com>
[...]
> > I do not see where the driver could depend on the MTU. Even if it fails,
> > a single call to mana_change_mtu should thus never wreck the old working
> > state/configuration.
> >
> > Stated differently, the detach/attach implementation is simple but
> > it makes the driver less reliable than it could be.
> >
> > No ?
>
> No, it doesn't make the driver less reliable. To safely remove and reallocate
> DMA buffers with different size, we have to stop the traffic. So, mana_detach()
> is called. We also call mana_detach() in mana_close(). So the process in
> mana_change_mtu() is no more risky than ifdown/ifup of the NIC.
>
> In some rare cases, if the system memory is running really low, the bigger
> buffer allocation may fail, so we re-try with the previous MTU. I don't expect
> it to fail again. But we still check & log the error code for completeness and
> debugging.
In a ideal world, I would expect change_mtu() to allocate the new resources,
bail out if some allocation fails, stop the traffic, swap the old and new
resources, then restart the traffic and release the old resources.
This way the device is never left in a failed state.
--
Ueimor
next prev parent reply other threads:[~2023-03-20 11:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-19 21:27 Haiyang Zhang
2023-03-19 22:46 ` Francois Romieu
2023-03-20 1:47 ` Haiyang Zhang
2023-03-20 11:33 ` Francois Romieu [this message]
2023-03-20 15:13 ` Haiyang Zhang
2023-03-20 7:42 ` Leon Romanovsky
2023-03-20 15:14 ` Haiyang Zhang
2023-03-20 9:42 ` Yunsheng Lin
2023-03-20 15:21 ` Haiyang Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230320113317.GA290683@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=haiyangz@microsoft.com \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=leon@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=pabeni@redhat.com \
--cc=paulros@microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=vkuznets@redhat.com \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®