Re: [PATCH RFC net-next] can: dev: can_skb_get_dll_len(): introduce function to get data length of frame in data link layer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux