linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Torin Cooper-Bennun <torin@maxiluxsystems.com>
Cc: linux-can@vger.kernel.org, Pankaj Sharma <pankj.sharma@samsung.com>
Subject: Re: [PATCH 3/3] can: m_can: fix RX path: use rx-offload to ensure skbs are sent from softirq context
Date: Mon, 8 Mar 2021 10:16:54 +0100	[thread overview]
Message-ID: <59ad45a4-1404-4622-5f75-3ea08aa15287@pengutronix.de> (raw)
In-Reply-To: <20210308091130.23736cyh7euvwxse@bigthink>


[-- Attachment #1.1: Type: text/plain, Size: 1465 bytes --]

On 3/8/21 10:11 AM, Torin Cooper-Bennun wrote:
> On Fri, Mar 05, 2021 at 11:29:57PM +0100, Marc Kleine-Budde wrote:
>> On 05.03.2021 17:20:15, Torin Cooper-Bennun wrote:
>>> For peripheral devices, m_can sent skbs directly from a threaded irq
>>> instead of from a softirq context. This patch transitions the driver to
>>> use the rx-offload helper, ensuring the skbs are sent from the correct
>>> context, with h/w timestamping to ensure correct ordering.
>>
>> I think you beak the non-peripheral drivers here. They already have a
>> NAPI function m_can_poll(). It makes no sense and doesn't work, if you
>> do the RX in NAPI and then queue to rx-offload, which then needs to run
>> from NAPI again. But it cannot as m_can_poll is the NAPI function.
>>
>> For peripherals it works, as you do the RX in the threaded IRQ, queue to
>> rx-offload, which then schedules a NAPI, to push the CAN frames into the
>> networking stack.
> 
> Understood, I will make the skb handling conditional on
> cdev->is_peripheral and retain netif_receive_skb and can_get_echo_skb
> usage for non-peripherals as before.

Not beautify, but should make the tcan driver work at least.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-03-08  9:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 17:20 [PATCH 0/3] can: m_can: stabilise peripheral m_can RX and TX Torin Cooper-Bennun
2021-03-05 17:20 ` [PATCH 1/3] can: m_can: add infrastructure for internal timestamps Torin Cooper-Bennun
2021-03-05 21:28   ` Marc Kleine-Budde
2021-03-05 17:20 ` [PATCH 2/3] can: m_can: m_can_chip_config(): enable and configure " Torin Cooper-Bennun
2021-03-05 21:34   ` Marc Kleine-Budde
2021-03-08  9:09     ` Torin Cooper-Bennun
2021-03-05 17:20 ` [PATCH 3/3] can: m_can: fix RX path: use rx-offload to ensure skbs are sent from softirq context Torin Cooper-Bennun
2021-03-05 22:29   ` Marc Kleine-Budde
2021-03-08  9:11     ` Torin Cooper-Bennun
2021-03-08  9:16       ` Marc Kleine-Budde [this message]
2021-03-08 10:31         ` Torin Cooper-Bennun

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=59ad45a4-1404-4622-5f75-3ea08aa15287@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=pankj.sharma@samsung.com \
    --cc=torin@maxiluxsystems.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;
as well as URLs for NNTP newsgroup(s).