diff options
author | Richard Laing <richard.laing@alliedtelesis.co.nz> | 2021-07-15 09:18:05 +1200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-15 10:14:44 -0700 |
commit | 5c2c85315948c42c6c0258cf9bad596acaa79043 (patch) | |
tree | 4e976ba1d8750f33abefcdb6a35fd827291858f5 /drivers/net/mhi/proto_mbim.c | |
parent | 8096acd7442e613fad0354fc8dfdb2003cceea0b (diff) | |
download | linux-5c2c85315948c42c6c0258cf9bad596acaa79043.tar.gz linux-5c2c85315948c42c6c0258cf9bad596acaa79043.tar.bz2 linux-5c2c85315948c42c6c0258cf9bad596acaa79043.zip |
bus: mhi: pci-generic: configurable network interface MRU
The MRU value used by the MHI MBIM network interface affects
the throughput performance of the interface. Different modem
models use different default MRU sizes based on their bandwidth
capabilities. Large values generally result in higher throughput
for larger packet sizes.
In addition if the MRU used by the MHI device is larger than that
specified in the MHI net device the data is fragmented and needs
to be re-assembled which generates a (single) warning message about
the fragmented packets. Setting the MRU on both ends avoids the
extra processing to re-assemble the packets.
This patch allows the documented MRU for a modem to be automatically
set as the MHI net device MRU avoiding fragmentation and improving
throughput performance.
Signed-off-by: Richard Laing <richard.laing@alliedtelesis.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mhi/proto_mbim.c')
-rw-r--r-- | drivers/net/mhi/proto_mbim.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/mhi/proto_mbim.c b/drivers/net/mhi/proto_mbim.c index bf1ad863237d..f1cc7f35bb85 100644 --- a/drivers/net/mhi/proto_mbim.c +++ b/drivers/net/mhi/proto_mbim.c @@ -292,7 +292,9 @@ static int mbim_init(struct mhi_net_dev *mhi_netdev) ndev->needed_headroom = sizeof(struct mbim_tx_hdr); ndev->mtu = MHI_MBIM_DEFAULT_MTU; - mhi_netdev->mru = MHI_MBIM_DEFAULT_MRU; + + if (!mhi_netdev->mru) + mhi_netdev->mru = MHI_MBIM_DEFAULT_MRU; return 0; } |