[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <be70562aa153e8de2446dcb3b8052c027e50b0cb.camel@mediatek.com>
Date: Thu, 16 Mar 2023 01:17:20 +0000
From: Haozhe Chang (常浩哲)
<Haozhe.Chang@...iatek.com>
To: "kuba@...nel.org" <kuba@...nel.org>
CC: "stephan@...hold.net" <stephan@...hold.net>,
"oneukum@...e.com" <oneukum@...e.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-remoteproc@...r.kernel.org" <linux-remoteproc@...r.kernel.org>,
"linuxwwan@...el.com" <linuxwwan@...el.com>,
"m.chetan.kumar@...el.com" <m.chetan.kumar@...el.com>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
Hua Yang (杨华) <Hua.Yang@...iatek.com>,
"chiranjeevi.rapolu@...ux.intel.com"
<chiranjeevi.rapolu@...ux.intel.com>,
Haijun Liu (刘海军)
<haijun.liu@...iatek.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"ryazanov.s.a@...il.com" <ryazanov.s.a@...il.com>,
Xiayu Zhang (张夏宇)
<Xiayu.Zhang@...iatek.com>,
"loic.poulain@...aro.org" <loic.poulain@...aro.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"chandrashekar.devegowda@...el.com"
<chandrashekar.devegowda@...el.com>,
"johannes@...solutions.net" <johannes@...solutions.net>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"shangxiaojing@...wei.com" <shangxiaojing@...wei.com>,
Lambert Wang (王伟)
<Lambert.Wang@...iatek.com>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"ricardo.martinez@...ux.intel.com" <ricardo.martinez@...ux.intel.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>
Subject: Re: [PATCH RESEND net-next v7] wwan: core: Support slicing in port TX
flow of WWAN subsystem
Dear Jakub Kicinski
On Mon, 2023-03-13 at 16:08 -0700, Jakub Kicinski wrote:
> On Wed, 8 Mar 2023 16:19:35 +0800 haozhe.chang@...iatek.com wrote:
> > /**
> > * wwan_create_port - Add a new WWAN port
> > * @parent: Device to use as parent and shared by all WWAN ports
> > * @type: WWAN port type
> > * @ops: WWAN port operations
> > + * @frag_len: WWAN port TX fragments length, if WWAN_NO_FRAGMENT
> > is set,
> > + * the WWAN core don't fragment control packages.
> > + * @headroom_len: WWAN port TX fragments reserved headroom length,
> > if WWAN_NO_HEADROOM
> > + * is set, the WWAN core don't reserve headroom in
> > control packages.
> > * @drvdata: Pointer to caller driver data
> > *
> > * Allocate and register a new WWAN port. The port will be
> > automatically exposed
> > @@ -86,6 +100,8 @@ struct wwan_port_ops {
> > struct wwan_port *wwan_create_port(struct device *parent,
> > enum wwan_port_type type,
> > const struct wwan_port_ops *ops,
> > + size_t frag_len,
> > + unsigned int headroom_len,
> > void *drvdata);
> >
>
> Too many arguments, and poor extensibility.
> Please wrap the new params into a capability struct:
>
> struct wwan_port_caps {
> unsigned int frag_len;
> unsigned int headroom_len;
> };
>
> pass a pointer to this kind of structure in.
>
> Next time someone needs to add a quirk they can just add a field and
> won't need to change all the drivers.
Thanks for your suggestion. But the same suggestion has been discussed
in previous patch v2:
https://patchwork.kernel.org/project/netdevbpf/patch/20221108105352.89801-1-haozhe.chang@mediatek.com/
The opinion from Loic: "I think 6 is still fine, if we need more fields
in the future we can always have a port_config struct as a parameter
instead."
BR
Powered by blists - more mailing lists