All of lore.kernel.org
 help / color / mirror / Atom feed
* J1939: /proc/net/can interface
@ 2020-06-16 18:40 Arnej Duranovic
  2020-06-17 12:59 ` Kurt Van Dijck
  0 siblings, 1 reply; 5+ messages in thread
From: Arnej Duranovic @ 2020-06-16 18:40 UTC (permalink / raw)
  To: linux-can

Hello all,

Earlier versions of J1939 contained the following:

+ 6. /proc/net/can-j1939 Interface.
+ --------------------------------
+
+   Files giving you a view on the in-kernel operation of J1939 are located at:
+   /proc/net/j1939.
+
+ 6.1 /proc/net/can-j1939/ecu
+
+   This file gives an overview of the known ECU's to the kernel.
+   - iface : network interface they operate on.
+   - SA : current address.
+   - name : 64bit NAME
+   - flags : 'L' = local, 'R' = remote

I am interested in what happened to this feature since I do not see it in the latest implementation or in the documentation?

I am interested in retrieving "known ECU's to the kernel" in the latest implementation. What is recommended?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: J1939: /proc/net/can interface
  2020-06-16 18:40 J1939: /proc/net/can interface Arnej Duranovic
@ 2020-06-17 12:59 ` Kurt Van Dijck
  2020-06-17 13:03   ` Marc Kleine-Budde
  0 siblings, 1 reply; 5+ messages in thread
From: Kurt Van Dijck @ 2020-06-17 12:59 UTC (permalink / raw)
  To: Arnej Duranovic; +Cc: linux-can

Hello,


On di, 16 jun 2020 18:40:49 +0000, Arnej Duranovic wrote:
> Hello all,
> 
> Earlier versions of J1939 contained the following:
> 
> + 6. /proc/net/can-j1939 Interface.
> + --------------------------------
> +
> +   Files giving you a view on the in-kernel operation of J1939 are located at:
> +   /proc/net/j1939.
> +
> + 6.1 /proc/net/can-j1939/ecu
> +
> +   This file gives an overview of the known ECU's to the kernel.
> +   - iface : network interface they operate on.
> +   - SA : current address.
> +   - name : 64bit NAME
> +   - flags : 'L' = local, 'R' = remote
> 
> I am interested in what happened to this feature since I do not see it in the latest implementation or in the documentation?

The feature got removed, as (almost) all of the /proc interface
for making mainline integration easier.
The idea was to restore the required interfaces when necessary.

> 
> I am interested in retrieving "known ECU's to the kernel" in the latest implementation. What is recommended?

I understand your question. The simple answer right now is: there isn't.

we could debate about this being necessary in /proc,
or rather in debugfs,
since this knowledge should not be used in real applications?
Am I right that your intended use is debugging related?

Kind regards,
Kurt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: J1939: /proc/net/can interface
  2020-06-17 12:59 ` Kurt Van Dijck
@ 2020-06-17 13:03   ` Marc Kleine-Budde
  2020-06-17 14:14     ` Arnej Duranovic
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Kleine-Budde @ 2020-06-17 13:03 UTC (permalink / raw)
  To: Arnej Duranovic, linux-can

On 6/17/20 2:59 PM, Kurt Van Dijck wrote:
>> + 6. /proc/net/can-j1939 Interface.
>> + --------------------------------
>> +
>> +   Files giving you a view on the in-kernel operation of J1939 are located at:
>> +   /proc/net/j1939.
>> +
>> + 6.1 /proc/net/can-j1939/ecu
>> +
>> +   This file gives an overview of the known ECU's to the kernel.
>> +   - iface : network interface they operate on.
>> +   - SA : current address.
>> +   - name : 64bit NAME
>> +   - flags : 'L' = local, 'R' = remote
>>
>> I am interested in what happened to this feature since I do not see it in the latest implementation or in the documentation?
> 
> The feature got removed, as (almost) all of the /proc interface
> for making mainline integration easier.
> The idea was to restore the required interfaces when necessary.

...or rather use something modern and machine readable.

>> I am interested in retrieving "known ECU's to the kernel" in the latest implementation. What is recommended?
> 
> I understand your question. The simple answer right now is: there isn't.
> 
> we could debate about this being necessary in /proc,
> or rather in debugfs,
> since this knowledge should not be used in real applications?
> Am I right that your intended use is debugging related?

Today we probably want to have a netlink interface to read that information from
the kernel.

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 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: J1939: /proc/net/can interface
  2020-06-17 13:03   ` Marc Kleine-Budde
@ 2020-06-17 14:14     ` Arnej Duranovic
  2020-06-17 16:37       ` Kurt Van Dijck
  0 siblings, 1 reply; 5+ messages in thread
From: Arnej Duranovic @ 2020-06-17 14:14 UTC (permalink / raw)
  To: linux-can

On Wednesday, June 17, 2020 8:03 AM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:

> On 6/17/20 2:59 PM, Kurt Van Dijck wrote:
>
> > > -   6.  /proc/net/can-j1939 Interface.
> > > -
> > > -
> > > -   Files giving you a view on the in-kernel operation of J1939 are located at:
> > > -   /proc/net/j1939.
> > > -
> > > -   6.1 /proc/net/can-j1939/ecu
> > > -
> > > -   This file gives an overview of the known ECU's to the kernel.
> > > -   -   iface : network interface they operate on.
> > > -   -   SA : current address.
> > > -   -   name : 64bit NAME
> > > -   -   flags : 'L' = local, 'R' = remote
> > >
> > > I am interested in what happened to this feature since I do not see it in the latest implementation or in the documentation?
> >
> > The feature got removed, as (almost) all of the /proc interface
> > for making mainline integration easier.
> > The idea was to restore the required interfaces when necessary.

That's what I thought, thanks!

>
> ...or rather use something modern and machine readable.
>
> > > I am interested in retrieving "known ECU's to the kernel" in the latest implementation. What is recommended?
> >
> > I understand your question. The simple answer right now is: there isn't.
> > we could debate about this being necessary in /proc,
> > or rather in debugfs,
> > since this knowledge should not be used in real applications?
> > Am I right that your intended use is debugging related?

I think this would be great for debugging and helpful in a development environment but I am being asked to include this feature in production. If you have time, can you please elaborate on why this should not be used in real applications?

>
> Today we probably want to have a netlink interface to read that information from
> the kernel.
>
> 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 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: J1939: /proc/net/can interface
  2020-06-17 14:14     ` Arnej Duranovic
@ 2020-06-17 16:37       ` Kurt Van Dijck
  0 siblings, 0 replies; 5+ messages in thread
From: Kurt Van Dijck @ 2020-06-17 16:37 UTC (permalink / raw)
  To: Arnej Duranovic; +Cc: linux-can

On wo, 17 jun 2020 14:14:25 +0000, Arnej Duranovic wrote:
> On Wednesday, June 17, 2020 8:03 AM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> 
> > On 6/17/20 2:59 PM, Kurt Van Dijck wrote:
> >
> > > > -   6.  /proc/net/can-j1939 Interface.
> > > > -
> > > > -
> > > > -   Files giving you a view on the in-kernel operation of J1939 are located at:
> > > > -   /proc/net/j1939.
> > > > -
> > > > -   6.1 /proc/net/can-j1939/ecu
> > > > -
> > > > -   This file gives an overview of the known ECU's to the kernel.
> > > > -   -   iface : network interface they operate on.
> > > > -   -   SA : current address.
> > > > -   -   name : 64bit NAME
> > > > -   -   flags : 'L' = local, 'R' = remote
> > > >
> > > > I am interested in what happened to this feature since I do not see it in the latest implementation or in the documentation?
> > >
> > > The feature got removed, as (almost) all of the /proc interface
> > > for making mainline integration easier.
> > > The idea was to restore the required interfaces when necessary.
> 
> That's what I thought, thanks!
> 
> >
> > ...or rather use something modern and machine readable.
> >
> > > > I am interested in retrieving "known ECU's to the kernel" in the latest implementation. What is recommended?
> > >
> > > I understand your question. The simple answer right now is: there isn't.
> > > we could debate about this being necessary in /proc,
> > > or rather in debugfs,
> > > since this knowledge should not be used in real applications?
> > > Am I right that your intended use is debugging related?
> 
> 
> >
> > Today we probably want to have a netlink interface to read that information from
> > the kernel.

If we consider this an application interface, then yes, but for
debugging only, some ascii debugfs file is way more simple to use.

> I think this would be great for debugging and helpful in a development environment but I am being asked to include this feature in production.
> If you have time, can you please elaborate on why this should not be used in real applications?

The kernel's notion of local/remote ecu's is to verify and validate
traffic and avoid protocol violations.

If an application needs to know all local and/or remote ecu's, then you
listen to traffic on the bus and maintain your own logic.

This provides less obscure situations during transitions due to the
single source of information (j1939 traffic) compared to j1939 traffic
combined with netlink or debugfs information, where the latter is
inherently taken on a different timestamp, out-of-sync with the rest.

Of course, this is not a big problem for all applications, but it is an
essential defect.

If you would want to know all ecu's on a modern J1939 bus, then issue a
request-for-address-claim, and listen to all claimed addressed. That is,
IMHO, a correct way compared to fetching the info from the kernel's
cache. It is also easier to describe, reproduce, debug and maintain.

Kurt
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-17 16:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 18:40 J1939: /proc/net/can interface Arnej Duranovic
2020-06-17 12:59 ` Kurt Van Dijck
2020-06-17 13:03   ` Marc Kleine-Budde
2020-06-17 14:14     ` Arnej Duranovic
2020-06-17 16:37       ` Kurt Van Dijck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.