Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

can: move frame_len to CAN skb extensions

The can_skb_priv::frame_len variable is used to cache a previous
calculated CAN frame length to be passed to BQL queueing disciplines.

Move the can_skb_priv::frame_len content to can_skb_ext::can_framelen.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://patch.msgid.link/20260201-can_skb_ext-v8-4-3635d790fe8b@hartkopp.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Oliver Hartkopp and committed by
Paolo Abeni
d2d91797 5a9229db

+20 -7
+20 -7
drivers/net/can/dev/skb.c
··· 49 49 unsigned int idx, unsigned int frame_len) 50 50 { 51 51 struct can_priv *priv = netdev_priv(dev); 52 + struct can_skb_ext *csx; 52 53 53 54 if (idx >= priv->echo_skb_max) { 54 55 netdev_err(dev, "%s: BUG! Trying to access can_priv::echo_skb out of bounds (%u/max %u)\n", ··· 76 75 skb->dev = dev; 77 76 78 77 /* save frame_len to reuse it when transmission is completed */ 79 - can_skb_prv(skb)->frame_len = frame_len; 78 + csx = can_skb_ext_find(skb); 79 + if (csx) 80 + csx->can_framelen = frame_len; 80 81 81 82 if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) 82 83 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; ··· 115 112 * length is supported on both CAN and CANFD frames. 116 113 */ 117 114 struct sk_buff *skb = priv->echo_skb[idx]; 118 - struct can_skb_priv *can_skb_priv = can_skb_prv(skb); 115 + struct can_skb_ext *csx; 119 116 120 117 if (skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS) 121 118 skb_tstamp_tx(skb, skb_hwtstamps(skb)); ··· 123 120 /* get the real payload length for netdev statistics */ 124 121 *len_ptr = can_skb_get_data_len(skb); 125 122 126 - if (frame_len_ptr) 127 - *frame_len_ptr = can_skb_priv->frame_len; 123 + if (frame_len_ptr) { 124 + csx = can_skb_ext_find(skb); 125 + if (csx) 126 + *frame_len_ptr = csx->can_framelen; 127 + else 128 + *frame_len_ptr = 0; 129 + } 128 130 129 131 priv->echo_skb[idx] = NULL; 130 132 ··· 189 181 190 182 if (priv->echo_skb[idx]) { 191 183 struct sk_buff *skb = priv->echo_skb[idx]; 192 - struct can_skb_priv *can_skb_priv = can_skb_prv(skb); 184 + struct can_skb_ext *csx; 193 185 194 - if (frame_len_ptr) 195 - *frame_len_ptr = can_skb_priv->frame_len; 186 + if (frame_len_ptr) { 187 + csx = can_skb_ext_find(skb); 188 + if (csx) 189 + *frame_len_ptr = csx->can_framelen; 190 + else 191 + *frame_len_ptr = 0; 192 + } 196 193 197 194 dev_kfree_skb_any(skb); 198 195 priv->echo_skb[idx] = NULL;