Thread (8 messages) flat view 8 messages, 4 authors, 2023-08-21

Re: [PATCH 1/2] can: netlink: support setting hardware filters

From: Vincent Mailhol <hidden>
Date: 2023-08-19 13:11:46
Also in: linux-can, lkml

On Sat. 19 Aug. 2023, 01:19, Jakub Kicinski [off-list ref] wrote:
On Thu, 17 Aug 2023 12:10:13 +0200 Martin Hundebøll wrote:
quoted
+             int len = nla_len(data[IFLA_CAN_HW_FILTER]);
+             int num_filter = len / sizeof(struct can_filter);
+             struct can_filter *filter = nla_data(data[IFLA_CAN_HW_FILTER]);
This will prevent you from ever extending struct can_filter in
a backward-compatible fashion, right? I obviously know very little
about CAN but are you confident a more bespoke API to manipulate
filters individually and allow extensibility is not warranted?
I follow Jakub's point of view.

The current struct can_filter is not sound. Some devices such as the
ES582.1 supports filtering of the CAN frame based on the flags (i.e.
SFF/EFF, RTR, FDF).

I think that each of the fields of the filter should have its own NLA
declaration with the whole thing wrapped within a NLA_NESTED_ARRAY.

I also think that there should then be a method to report the precise
filtering capabilities of the hardware.


Yours sincerely,
Vincent Mailhol
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help