diff options
author | Oliver Hartkopp <oliver@hartkopp.net> | 2009-01-06 11:07:54 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-06 11:07:54 -0800 |
commit | 1fa17d4ba43d7e5aab5e90777b07da06524f6748 (patch) | |
tree | ebe8704bd84c51d29c17a8425b496a13b4935dc5 /net/can/bcm.c | |
parent | 98658bc9dc37cfb7c3bf5585ca73ce44aeb05c9e (diff) | |
download | linux-stable-1fa17d4ba43d7e5aab5e90777b07da06524f6748.tar.gz linux-stable-1fa17d4ba43d7e5aab5e90777b07da06524f6748.tar.bz2 linux-stable-1fa17d4ba43d7e5aab5e90777b07da06524f6748.zip |
can: omit unneeded skb_clone() calls
The AF_CAN core delivered always cloned sk_buffs to the AF_CAN
protocols, although this was _only_ needed by the can-raw protocol.
With this (additionally documented) change, the AF_CAN core calls the
callback functions of the registered AF_CAN protocols with the original
(uncloned) sk_buff pointer and let's the can-raw protocol do the
skb_clone() itself which omits all unneeded skb_clone() calls for other
AF_CAN protocols.
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Urs Thuermann <urs.thuermann@volkswagen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/can/bcm.c')
-rw-r--r-- | net/can/bcm.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/can/bcm.c b/net/can/bcm.c index 6248ae2502c7..1649c8ab2c2f 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c @@ -633,7 +633,7 @@ static void bcm_rx_handler(struct sk_buff *skb, void *data) hrtimer_cancel(&op->timer); if (op->can_id != rxframe->can_id) - goto rx_freeskb; + return; /* save rx timestamp */ op->rx_stamp = skb->tstamp; @@ -645,19 +645,19 @@ static void bcm_rx_handler(struct sk_buff *skb, void *data) if (op->flags & RX_RTR_FRAME) { /* send reply for RTR-request (placed in op->frames[0]) */ bcm_can_tx(op); - goto rx_freeskb; + return; } if (op->flags & RX_FILTER_ID) { /* the easiest case */ bcm_rx_update_and_send(op, &op->last_frames[0], rxframe); - goto rx_freeskb_starttimer; + goto rx_starttimer; } if (op->nframes == 1) { /* simple compare with index 0 */ bcm_rx_cmp_to_index(op, 0, rxframe); - goto rx_freeskb_starttimer; + goto rx_starttimer; } if (op->nframes > 1) { @@ -678,10 +678,8 @@ static void bcm_rx_handler(struct sk_buff *skb, void *data) } } -rx_freeskb_starttimer: +rx_starttimer: bcm_rx_starttimer(op); -rx_freeskb: - kfree_skb(skb); } /* |