Skip to content

Commit df13c59

Browse files
pjvuurendavem330
authored andcommitted
nfp: flower: remove headroom from max MTU calculation
Since commit 29a5dca ("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: 29a5dca ("nfp: flower: offload phys port MTU change") Signed-off-by: Pieter Jansen van Vuuren <[email protected]> Reviewed-by: John Hurley <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 680a284 commit df13c59

File tree

1 file changed

+0
-19
lines changed
  • drivers/net/ethernet/netronome/nfp/flower

1 file changed

+0
-19
lines changed

drivers/net/ethernet/netronome/nfp/flower/main.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252

5353
#define NFP_FLOWER_ALLOWED_VER 0x0001000000010000UL
5454

55-
#define NFP_FLOWER_FRAME_HEADROOM 158
56-
5755
static const char *nfp_flower_extra_cap(struct nfp_app *app, struct nfp_net *nn)
5856
{
5957
return "FLOWER";
@@ -559,22 +557,6 @@ static void nfp_flower_clean(struct nfp_app *app)
559557
app->priv = NULL;
560558
}
561559

562-
static int
563-
nfp_flower_check_mtu(struct nfp_app *app, struct net_device *netdev,
564-
int new_mtu)
565-
{
566-
/* The flower fw reserves NFP_FLOWER_FRAME_HEADROOM bytes of the
567-
* supported max MTU to allow for appending tunnel headers. To prevent
568-
* unexpected behaviour this needs to be accounted for.
569-
*/
570-
if (new_mtu > netdev->max_mtu - NFP_FLOWER_FRAME_HEADROOM) {
571-
nfp_err(app->cpp, "New MTU (%d) is not valid\n", new_mtu);
572-
return -EINVAL;
573-
}
574-
575-
return 0;
576-
}
577-
578560
static bool nfp_flower_check_ack(struct nfp_flower_priv *app_priv)
579561
{
580562
bool ret;
@@ -656,7 +638,6 @@ const struct nfp_app_type app_flower = {
656638
.init = nfp_flower_init,
657639
.clean = nfp_flower_clean,
658640

659-
.check_mtu = nfp_flower_check_mtu,
660641
.repr_change_mtu = nfp_flower_repr_change_mtu,
661642

662643
.vnic_alloc = nfp_flower_vnic_alloc,

0 commit comments

Comments
 (0)