If a maximum receive unit (MRU) size is specified, use it for RX
buffers allocation instead of the MTU.
Signed-off-by: Loic Poulain <redacted>
---
drivers/net/mhi/mhi.h | 1 +
drivers/net/mhi/net.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
MBIM protocol makes the interface asymmetric, ingress data received
from MHI is MBIM protocol, that can contain multiple aggregated IP
packets, while egress data received from network stack is IP protocol.
Set a default MTU to 1500 (usual network MTU for WWAN), and MRU to 32K
which is the default size of MBIM-over-MHI packets.
Signed-off-by: Loic Poulain <redacted>
---
drivers/net/mhi/proto_mbim.c | 5 +++++
1 file changed, 5 insertions(+)
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-03-24 21:47:14
On Tue, 23 Mar 2021 15:45:07 +0100 Loic Poulain wrote:
quoted hunk
MBIM protocol makes the interface asymmetric, ingress data received
from MHI is MBIM protocol, that can contain multiple aggregated IP
packets, while egress data received from network stack is IP protocol.
Set a default MTU to 1500 (usual network MTU for WWAN), and MRU to 32K
which is the default size of MBIM-over-MHI packets.
Signed-off-by: Loic Poulain <redacted>
---
drivers/net/mhi/proto_mbim.c | 5 +++++
1 file changed, 5 insertions(+)
@@ -282,6 +285,8 @@ static int mbim_init(struct mhi_net_dev *mhi_netdev)return-ENOMEM;ndev->needed_headroom=sizeof(structmbim_tx_hdr);+ndev->mtu=MHI_MBIM_DEFAULT_MTU;+mhi_netdev->mru=MHI_MBIM_DEFAULT_MRU;return0;}
32k + skb overhead will result in rather large contiguous allocation.
Using ~3.5k buffers (basically a page - paddings and skb_shinfo) should
be much more resilient, and still very efficient.
This sort of 32k buffer thing is common for USB, but I thought MHI is
over PCI so there should be no bus considerations once we're above 1k.