From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Loic Poulain <loic.poulain@linaro.org>
Cc: kuba@kernel.org, davem@davemloft.net, hemantk@codeaurora.org,
netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org,
bbhatt@codeaurora.org, willemdebruijn.kernel@gmail.com,
jhugo@codeaurora.org
Subject: Re: [PATCH v8 2/2] net: Add mhi-net driver
Date: Fri, 30 Oct 2020 15:01:41 +0530 [thread overview]
Message-ID: <20201030093141.GC3818@Mani-XPS-13-9360> (raw)
In-Reply-To: <1603902898-25233-2-git-send-email-loic.poulain@linaro.org>
On Wed, Oct 28, 2020 at 05:34:58PM +0100, Loic Poulain wrote:
> This patch adds a new network driver implementing MHI transport for
> network packets. Packets can be in any format, though QMAP (rmnet)
> is the usual protocol (flow control + PDN mux).
>
> It support two MHI devices, IP_HW0 which is, the path to the IPA
> (IP accelerator) on qcom modem, And IP_SW0 which is the software
> driven IP path (to modem CPU).
>
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> ---
> v2: - rebase on net-next
> - remove useless skb_linearize
> - check error type on mhi_queue return
> - rate limited errors
> - Schedule RX refill only on 'low' buf level
> - SET_NETDEV_DEV in probe
> - reorder device remove sequence
> v3: - Stop channels on net_register error
> - Remove useles parentheses
> - Add driver .owner
> v4: - prevent potential cpu hog in rx-refill loop
> - Access mtu via READ_ONCE
> v5: - Fix access to u64 stats
> v6: - Stop TX queue earlier if queue is full
> - Preventing 'abnormal' NETDEV_TX_BUSY path
> v7: - Stop dl/ul cb operations on channel resetting
> v8: - remove premature comment about TX threading gain
> - check rx_queued to determine queuing limits
> - fix probe error path (unified goto usage)
>
> drivers/net/Kconfig | 7 ++
> drivers/net/Makefile | 1 +
> drivers/net/mhi_net.c | 313 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 321 insertions(+)
> create mode 100644 drivers/net/mhi_net.c
>
[...]
> +static int mhi_net_probe(struct mhi_device *mhi_dev,
> + const struct mhi_device_id *id)
> +{
> + const char *netname = (char *)id->driver_data;
> + struct mhi_net_dev *mhi_netdev;
> + struct net_device *ndev;
> + struct device *dev = &mhi_dev->dev;
> + int err;
> +
> + ndev = alloc_netdev(sizeof(*mhi_netdev), netname, NET_NAME_PREDICTABLE,
> + mhi_net_setup);
> + if (!ndev)
> + return -ENOMEM;
> +
> + mhi_netdev = netdev_priv(ndev);
> + dev_set_drvdata(dev, mhi_netdev);
> + mhi_netdev->ndev = ndev;
> + mhi_netdev->mdev = mhi_dev;
> + SET_NETDEV_DEV(ndev, &mhi_dev->dev);
> +
> + /* All MHI net channels have 128 ring elements (at least for now) */
> + mhi_netdev->rx_queue_sz = 128;
> +
> + INIT_DELAYED_WORK(&mhi_netdev->rx_refill, mhi_net_rx_refill_work);
> + u64_stats_init(&mhi_netdev->stats.rx_syncp);
> + u64_stats_init(&mhi_netdev->stats.tx_syncp);
> +
> + /* Start MHI channels */
> + err = mhi_prepare_for_transfer(mhi_dev);
> + if (err)
> + goto out_prep_err;
> +
> + err = register_netdev(ndev);
> + if (err)
> + goto out_register_err;
> +
> + return 0;
> +
> +out_register_err:
> + mhi_unprepare_from_transfer(mhi_dev);
Missed this one. MHI stack will do this for you incase of failure.
Thanks,
Mani
next prev parent reply other threads:[~2020-10-30 9:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 16:34 [PATCH v8 1/2] bus: mhi: Add mhi_queue_is_full function Loic Poulain
2020-10-28 16:34 ` [PATCH v8 2/2] net: Add mhi-net driver Loic Poulain
2020-10-30 8:13 ` Manivannan Sadhasivam
2020-10-30 9:27 ` Loic Poulain
2020-10-30 9:31 ` Manivannan Sadhasivam [this message]
2020-10-30 9:05 ` [PATCH v8 1/2] bus: mhi: Add mhi_queue_is_full function Manivannan Sadhasivam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201030093141.GC3818@Mani-XPS-13-9360 \
--to=manivannan.sadhasivam@linaro.org \
--cc=bbhatt@codeaurora.org \
--cc=davem@davemloft.net \
--cc=hemantk@codeaurora.org \
--cc=jhugo@codeaurora.org \
--cc=kuba@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox