linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Devid Antonio Filoni <devid.filoni@egluetechnologies.com>
Cc: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>,
	Robin van der Gracht <robin@protonic.nl>,
	kernel@pengutronix.de, linux-can@vger.kernel.org,
	Oleksij Rempel <linux@rempel-privat.de>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Jayat <maxime.jayat@mobile-devices.fr>,
	kbuild test robot <lkp@intel.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Jander <david@protonic.nl>
Subject: Re: [PATCH RESEND] can: j1939: do not wait 250ms if the same addr was already claimed
Date: Wed, 11 May 2022 10:47:28 +0200	[thread overview]
Message-ID: <20220511084728.GD10669@pengutronix.de> (raw)
In-Reply-To: <ce7da10389fe448efee86d788dd5282b8022f92e.camel@egluetechnologies.com>

Hi,

i'll CC more J1939 users to the discussion.

On Tue, May 10, 2022 at 01:00:41PM +0200, Devid Antonio Filoni wrote:
> Hi,
> 
> On Tue, 2022-05-10 at 06:26 +0200, Oleksij Rempel wrote:
> > Hi,
> > 
> > On Mon, May 09, 2022 at 09:04:06PM +0200, Kurt Van Dijck wrote:
> > > On ma, 09 mei 2022 19:03:03 +0200, Devid Antonio Filoni wrote:
> > > > This is not explicitly stated in SAE J1939-21 and some tools used for
> > > > ISO-11783 certification do not expect this wait.
> > 
> > It will be interesting to know which certification tool do not expect it and
> > what explanation is used if it fails?
> > 
> > > IMHO, the current behaviour is not explicitely stated, but nor is the opposite.
> > > And if I'm not mistaken, this introduces a 250msec delay.
> > > 
> > > 1. If you want to avoid the 250msec gap, you should avoid to contest the same address.
> > > 
> > > 2. It's a balance between predictability and flexibility, but if you try to accomplish both,
> > > as your patch suggests, there is slight time-window until the current owner responds,
> > > in which it may be confusing which node has the address. It depends on how much history
> > > you have collected on the bus.
> > > 
> > > I'm sure that this problem decreases with increasing processing power on the nodes,
> > > but bigger internal queues also increase this window.
> > > 
> > > It would certainly help if you describe how the current implementation fails.
> > > 
> > > Would decreasing the dead time to 50msec help in such case.
> > > 
> > > Kind regards,
> > > Kurt
> > > 
> > 
> 
> The test that is being executed during the ISOBUS compliance is the
> following: after an address has been claimed by a CF (#1), another CF
> (#2) sends a  message (other than address-claim) using the same address
> claimed by CF #1.
> 
> As per ISO11783-5 standard, if a CF receives a message, other than the
> address-claimed message, which uses the CF's own SA, then the CF (#1):
> - shall send the address-claim message to the Global address;
> - shall activate a diagnostic trouble code with SPN = 2000+SA and FMI =
> 31
> 
> After the address-claim message is sent by CF #1, as per ISO11783-5
> standard:
> - If the name of the CF #1 has a lower priority then the one of the CF
> #2, the the CF #2 shall send its address-claim message and thus the CF
> #1 shall send the cannot-claim-address message or shall execute again
> the claim procedure with a new address
> - If the name of the CF #1 has higher priority then the of the CF #2,
> then the CF #2 shall send the cannot-claim-address message or shall
> execute the claim procedure with a new address
> 
> Above conflict management is OK with current J1939 driver
> implementation, however, since the driver always waits 250ms after
> sending an address-claim message, the CF #1 cannot set the DTC. The DM1
> message which is expected to be sent each second (as per J1939-73
> standard) may not be sent.
> 
> Honestly, I don't know which company is doing the ISOBUS compliance
> tests on our products and which tool they use as it was choosen by our
> customer, however they did send us some CAN traces of previously
> performed tests and we noticed that the DM1 message is sent 160ms after
> the address-claim message (but it may also be lower then that), and this
> is something that we cannot do because the driver blocks the application
> from sending it.
> 
> 28401.127146 1  18E6FFF0x    Tx   d 8 FE 26 FF FF FF FF FF FF  //Message
> with other CF's address
> 28401.167414 1  18EEFFF0x    Rx   d 8 15 76 D1 0B 00 86 00 A0  //Address
> Claim - SA = F0
> 28401.349214 1  18FECAF0x    Rx   d 8 FF FF C0 08 1F 01 FF FF  //DM1
> 28402.155774 1  18E6FFF0x    Tx   d 8 FE 26 FF FF FF FF FF FF  //Message
> with other CF's address
> 28402.169455 1  18EEFFF0x    Rx   d 8 15 76 D1 0B 00 86 00 A0  //Address
> Claim - SA = F0
> 28402.348226 1  18FECAF0x    Rx   d 8 FF FF C0 08 1F 02 FF FF  //DM1
> 28403.182753 1  18E6FFF0x    Tx   d 8 FE 26 FF FF FF FF FF FF  //Message
> with other CF's address
> 28403.188648 1  18EEFFF0x    Rx   d 8 15 76 D1 0B 00 86 00 A0  //Address
> Claim - SA = F0
> 28403.349328 1  18FECAF0x    Rx   d 8 FF FF C0 08 1F 03 FF FF  //DM1
> 28404.349406 1  18FECAF0x    Rx   d 8 FF FF C0 08 1F 03 FF FF  //DM1
> 28405.349740 1  18FECAF0x    Rx   d 8 FF FF C0 08 1F 03 FF FF  //DM1
> 
> Since the 250ms wait is not explicitly stated, IMHO it should be up to
> the user-space implementation to decide how to manage it.
> 
> Thank you,
> Devid
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2022-05-11  8:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 17:03 [PATCH RESEND] can: j1939: do not wait 250ms if the same addr was already claimed Devid Antonio Filoni
2022-05-09 19:04 ` Kurt Van Dijck
2022-05-10  4:26   ` Oleksij Rempel
2022-05-10 11:00     ` Devid Antonio Filoni
2022-05-11  8:47       ` Oleksij Rempel [this message]
2022-05-11  9:06         ` David Jander
2022-05-11 12:55           ` Devid Antonio Filoni
2022-05-11 14:22             ` David Jander
2022-05-13  9:46               ` Devid Antonio Filoni
2022-11-17 14:08                 ` Devid Antonio Filoni
2022-11-17 15:22                   ` David Jander
2022-11-18  6:06                     ` Oleksij Rempel
2022-11-18 10:25                       ` Devid Antonio Filoni
2022-11-18 12:30                         ` Oleksij Rempel
2022-11-18 12:41                           ` Devid Antonio Filoni
2022-11-18 13:44                             ` Oleksij Rempel
2022-11-18 15:12                               ` Devid Antonio Filoni
2022-11-19 10:12                                 ` Oleksij Rempel
2022-11-20  0:11                                   ` Devid Antonio Filoni
2022-11-20  8:45                                     ` Oleksij Rempel
2022-11-20 19:18                                       ` Devid Antonio Filoni
2022-11-21  5:19                                         ` Oleksij Rempel
2022-11-23 20:39                                           ` Devid Antonio Filoni
2022-11-24  5:16                                             ` Oleksij Rempel
2022-11-25 17:04                                               ` [PATCH v2] can: j1939: do not wait 250 ms " Devid Antonio Filoni
2022-11-26 10:28                                                 ` Oleksij Rempel
2023-02-07 13:50                                                   ` Devid Antonio Filoni
2023-02-07 14:05                                                     ` Marc Kleine-Budde

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=20220511084728.GD10669@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=david@protonic.nl \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=devid.filoni@egluetechnologies.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=lkp@intel.com \
    --cc=maxime.jayat@mobile-devices.fr \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robin@protonic.nl \
    --cc=socketcan@hartkopp.net \
    /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).