提交 df13c59b 编写于 作者: P Pieter Jansen van Vuuren 提交者: David S. Miller

nfp: flower: remove headroom from max MTU calculation

Since commit 29a5dcae ("nfp: flower: offload phys port MTU change") we
take encapsulation headroom into account when calculating the max allowed
MTU.  This is unnecessary as the max MTU advertised by firmware should have
already accounted for encap headroom.

Subtracting headroom twice brings the max MTU below what's necessary for
some deployments.

Fixes: 29a5dcae ("nfp: flower: offload phys port MTU change")
Signed-off-by: NPieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Reviewed-by: NJohn Hurley <john.hurley@netronome.com>
Reviewed-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 680a2846
......@@ -52,8 +52,6 @@
#define NFP_FLOWER_ALLOWED_VER 0x0001000000010000UL
#define NFP_FLOWER_FRAME_HEADROOM 158
static const char *nfp_flower_extra_cap(struct nfp_app *app, struct nfp_net *nn)
{
return "FLOWER";
......@@ -559,22 +557,6 @@ static void nfp_flower_clean(struct nfp_app *app)
app->priv = NULL;
}
static int
nfp_flower_check_mtu(struct nfp_app *app, struct net_device *netdev,
int new_mtu)
{
/* The flower fw reserves NFP_FLOWER_FRAME_HEADROOM bytes of the
* supported max MTU to allow for appending tunnel headers. To prevent
* unexpected behaviour this needs to be accounted for.
*/
if (new_mtu > netdev->max_mtu - NFP_FLOWER_FRAME_HEADROOM) {
nfp_err(app->cpp, "New MTU (%d) is not valid\n", new_mtu);
return -EINVAL;
}
return 0;
}
static bool nfp_flower_check_ack(struct nfp_flower_priv *app_priv)
{
bool ret;
......@@ -656,7 +638,6 @@ const struct nfp_app_type app_flower = {
.init = nfp_flower_init,
.clean = nfp_flower_clean,
.check_mtu = nfp_flower_check_mtu,
.repr_change_mtu = nfp_flower_repr_change_mtu,
.vnic_alloc = nfp_flower_vnic_alloc,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册