Re: [PATCH AUTOSEL 6.1 30/57] tipc: add tipc_bearer_min_mtu to calculate min mtu
From: Pavel Machek
Date: Fri Jun 16 2023 - 15:29:10 EST
Hi!
> From: Xin Long <lucien.xin@xxxxxxxxx>
>
> [ Upstream commit 3ae6d66b605be604644d4bb5708a7ffd9cf1abe8 ]
>
> As different media may requires different min mtu, and even the
> same media with different net family requires different min mtu,
> add tipc_bearer_min_mtu() to calculate min mtu accordingly.
>
> This API will be used to check the new mtu when doing the link
> mtu negotiation in the next patch.
Ok, but we don't have the next patch queued with the AUTOSEL, so do we
need this?
> +++ b/net/tipc/bearer.c
> @@ -541,6 +541,19 @@ int tipc_bearer_mtu(struct net *net, u32 bearer_id)
> return mtu;
> }
>
> +int tipc_bearer_min_mtu(struct net *net, u32 bearer_id)
> +{
> + int mtu = TIPC_MIN_BEARER_MTU;
> + struct tipc_bearer *b;
> +
> + rcu_read_lock();
> + b = bearer_get(net, bearer_id);
> + if (b)
> + mtu += b->encap_hlen;
> + rcu_read_unlock();
> + return mtu;
> +}
> +
AFAICT this function is unused.
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Attachment:
signature.asc
Description: PGP signature