wwan: core: Support slicing in port TX flow of WWAN subsystem
authorhaozhe chang <haozhe.chang@mediatek.com>
Thu, 16 Mar 2023 09:58:20 +0000 (17:58 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 18 Mar 2023 05:38:31 +0000 (22:38 -0700)
commit36bd28c1cb0dbf48645cfe43159907fb3253b33a
treee03798a8e0af020702b53da1da3d52ed6621fb22
parented0578a46c5f08647f5ecb0e3c735a53267426f7
wwan: core: Support slicing in port TX flow of WWAN subsystem

wwan_port_fops_write inputs the SKB parameter to the TX callback of
the WWAN device driver. However, the WWAN device (e.g., t7xx) may
have an MTU less than the size of SKB, causing the TX buffer to be
sliced and copied once more in the WWAN device driver.

This patch implements the slicing in the WWAN subsystem and gives
the WWAN devices driver the option to slice(by frag_len) or not. By
doing so, the additional memory copy is reduced.

Meanwhile, this patch gives WWAN devices driver the option to reserve
headroom in fragments for the device-specific metadata.

Signed-off-by: haozhe chang <haozhe.chang@mediatek.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Link: https://lore.kernel.org/r/20230316095826.181904-1-haozhe.chang@mediatek.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wwan/iosm/iosm_ipc_port.c
drivers/net/wwan/mhi_wwan_ctrl.c
drivers/net/wwan/rpmsg_wwan_ctrl.c
drivers/net/wwan/t7xx/t7xx_port_wwan.c
drivers/net/wwan/wwan_core.c
drivers/net/wwan/wwan_hwsim.c
drivers/usb/class/cdc-wdm.c
include/linux/wwan.h