net: mhi-net: Add re-aggregation of fragmented packets
authorLoic Poulain <loic.poulain@linaro.org>
Thu, 4 Feb 2021 08:40:00 +0000 (09:40 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Feb 2021 19:28:45 +0000 (11:28 -0800)
commitc1fcda2bdfd04179dbc81320a24baa539b476281
treeccd182e7cab27ae99bfe73823a491c570ac55d65
parentd698e6a00a6092381f2966ac5410ac2dbcce88bc
net: mhi-net: Add re-aggregation of fragmented packets

When device side MTU is larger than host side MTU, the packets
(typically rmnet packets) are split over multiple MHI transfers.
In that case, fragments must be re-aggregated to recover the packet
before forwarding to upper layer.

A fragmented packet result in -EOVERFLOW MHI transaction status for
each of its fragments, except the final one. Such transfer was
previously considered as error and fragments were simply dropped.

This change adds re-aggregation mechanism using skb chaining, via
skb frag_list.

A warning (once) is printed since this behavior usually comes from
a misconfiguration of the device (e.g. modem MTU).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Link: https://lore.kernel.org/r/1612428002-12333-1-git-send-email-loic.poulain@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/mhi_net.c