On 15.12.20 12:37, Vincent MAILHOL wrote:
On Tue 15 Dec. 2020 at 17:08, Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> wrote:
We can calculate this information twice, but I thought we might put it into the
struct can_skb_priv.
https://elixir.bootlin.com/linux/latest/source/include/linux/can/skb.h#L34
Thoughts?
I am not knowledgeable enough on this part to guarantee if there will
be no side effects but regardless, I like the idea.
Also, an u8 is enough to hold the value. I wonder if it would be fine
to change ifindex to, for example, u16, so that we do not lose any
memory.
We should not make can_skb_priv.ifindex another type than
net_device.ifindex:
https://elixir.bootlin.com/linux/latest/source/include/linux/netdevice.h#L1899
I would look like that:
struct can_skb_priv {
u16 ifindex;
u8 frame_len;
u8 res;
int skbcnt;
struct can_frame cf[];
};
Regards,
Oliver