From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E05F8C43219 for ; Fri, 11 Nov 2022 15:06:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234896AbiKKPGn (ORCPT ); Fri, 11 Nov 2022 10:06:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234928AbiKKPEe (ORCPT ); Fri, 11 Nov 2022 10:04:34 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8859670195; Fri, 11 Nov 2022 07:02:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 00DE5B8262F; Fri, 11 Nov 2022 15:02:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 285ECC433C1; Fri, 11 Nov 2022 15:02:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1668178928; bh=RHFd6lZBWi3UidtHgAb7H5B7CyFXKaoJYUnzOJpdDKI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wZKtfKCvtkAHcRqegBZ5rvf2fSNNT5Jp9nsa7tHBLJ1FunZbXoHExBErfTh3zuzNX r4hkvCOmTK0QrFH0l20rbMnWE8AU+P8nmZyOgzviFZBoh2abXcFzInYkCbLbS13H++ MWXzls89wSjwmcEEze0qkRehIsJUzk/MHeWbOui4= Date: Fri, 11 Nov 2022 16:02:05 +0100 From: Greg Kroah-Hartman To: haozhe.chang@mediatek.com Cc: M Chetan Kumar , Intel Corporation , Loic Poulain , Sergey Ryazanov , Johannes Berg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Stephan Gerhold , Chandrashekar Devegowda , Chiranjeevi Rapolu , Liu Haijun , Ricardo Martinez , Matthias Brugger , Oliver Neukum , Shang XiaoJing , "open list:INTEL WWAN IOSM DRIVER" , open list , "open list:REMOTE PROCESSOR MESSAGING (RPMSG) WWAN CONTROL..." , "open list:USB SUBSYSTEM" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , lambert.wang@mediatek.com, xiayu.zhang@mediatek.com, hua.yang@mediatek.com Subject: Re: [PATCH v3] wwan: core: Support slicing in port TX flow of WWAN subsystem Message-ID: References: <20221111100840.105305-1-haozhe.chang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221111100840.105305-1-haozhe.chang@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Nov 11, 2022 at 06:08:36PM +0800, haozhe.chang@mediatek.com wrote: > From: haozhe chang > > 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 > > --- > Changes in v2 > -send fragments to device driver by skb frag_list. > > Changes in v3 > -move frag_len and headroom_len setting to wwan_create_port. > --- > drivers/net/wwan/iosm/iosm_ipc_port.c | 3 +- > drivers/net/wwan/mhi_wwan_ctrl.c | 2 +- > drivers/net/wwan/rpmsg_wwan_ctrl.c | 2 +- > drivers/net/wwan/t7xx/t7xx_port_wwan.c | 34 +++++++-------- > drivers/net/wwan/wwan_core.c | 59 ++++++++++++++++++++------ > drivers/net/wwan/wwan_hwsim.c | 2 +- > drivers/usb/class/cdc-wdm.c | 2 +- > include/linux/wwan.h | 6 ++- > 8 files changed, 73 insertions(+), 37 deletions(-) > > diff --git a/drivers/net/wwan/iosm/iosm_ipc_port.c b/drivers/net/wwan/iosm/iosm_ipc_port.c > index b6d81c627277..dc43b8f0d1af 100644 > --- a/drivers/net/wwan/iosm/iosm_ipc_port.c > +++ b/drivers/net/wwan/iosm/iosm_ipc_port.c > @@ -63,7 +63,8 @@ struct iosm_cdev *ipc_port_init(struct iosm_imem *ipc_imem, > ipc_port->ipc_imem = ipc_imem; > > ipc_port->iosm_port = wwan_create_port(ipc_port->dev, port_type, > - &ipc_wwan_ctrl_ops, ipc_port); > + &ipc_wwan_ctrl_ops, 0, 0, > + ipc_port); How is 0, 0 a valid option here? and if it is a valid option, shouldn't you just have 2 different functions, one that needs these values and one that does not? That would make it more descriptive as to what those options are, and ensure that you get them right. > @@ -112,7 +117,6 @@ void wwan_port_rx(struct wwan_port *port, struct sk_buff *skb); > */ > void wwan_port_txoff(struct wwan_port *port); > > - > /** Unneeded change. thanks, greg k-h