[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <62605ecb-3974-38a9-1f64-b08df6a72663@gmail.com>
Date: Thu, 15 Oct 2020 20:56:20 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Loic Poulain <loic.poulain@...aro.org>
Cc: davem@...emloft.net, Jakub Kicinski <kuba@...nel.org>,
netdev@...r.kernel.org, Hemant Kumar <hemantk@...eaurora.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Subject: Re: [PATCH v4 1/2] net: Add mhi-net driver
On 10/15/20 3:29 PM, Loic Poulain wrote:
> On Thu, 15 Oct 2020 at 14:41, Eric Dumazet <eric.dumazet@...il.com> wrote:
>>
>>
>>
>> On 10/15/20 12:31 PM, 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).
>>>
>>>
>>> +static int mhi_ndo_xmit(struct sk_buff *skb, struct net_device *ndev)
>>> +{
>>> + struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
>>> + struct mhi_device *mdev = mhi_netdev->mdev;
>>> + int err;
>>> +
>>> + skb_tx_timestamp(skb);
>>> +
>>> + /* mhi_queue_skb is not thread-safe, but xmit is serialized by the
>>> + * network core. Once MHI core will be thread save, migrate to
>>> + * NETIF_F_LLTX support.
>>> + */
>>> + err = mhi_queue_skb(mdev, DMA_TO_DEVICE, skb, skb->len, MHI_EOT);
>>> + if (err == -ENOMEM) {
>>> + netif_stop_queue(ndev);
>>
>> If you return NETDEV_TX_BUSY, this means this skb will be requeues,
>> then sent again right away, and this will potentially loop forever.
>
> The TX queue is stopped in that case, so the net core will not loop, right?
-ENOMEM suggests a memory allocation failed.
What is going to restart the queue when memory is available ?
-ENOMEM seems weird if used for queue being full.
>
>>
>> Also skb_tx_timestamp() would be called multiple times.
>
> OK so I'm going to remove that, maybe the MHI layer should mark
> timestamp instead.
Yes, probably.
Powered by blists - more mailing lists