Skip to contentSkip to conversation

cycx_x25: update last_rx after netif_rx

PATCH In review Arnaldo Carvalho de Melo 2 participants 2 messages Feb 27, 2001 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cycx_x25: update last_rx after netif_rx

Em Mon, Feb 26, 2001 at 09:58:31PM -0300, Arnaldo Carvalho de Melo escreveu:
Hi,

Please apply. This one I maintain. 8)

- Arnaldo

drivers/net/wan/cycx_x25.c +3 -2
@@ -812,7 +812,6 @@
 	if (bitm)
 		return; /* more data is coming */
 
-	dev->last_rx = jiffies;		/* timestamp */
 	chan->rx_skb = NULL;		/* dequeue packet */
 
 	++chan->ifstats.rx_packets;
@@ -820,6 +819,7 @@
 
 	skb->mac.raw = skb->data;
 	netif_rx(skb);
+	dev->last_rx = jiffies;		/* timestamp */
 }
 
 /* Connect interrupt handler. */
@@ -1454,11 +1454,12 @@
         *ptr = event;
 
         skb->dev = dev;
-        skb->protocol = htons(ETH_P_X25);
+        skb->protocol = __constant_htons(ETH_P_X25);
         skb->mac.raw = skb->data;
         skb->pkt_type = PACKET_HOST;
 
         netif_rx(skb);
+	dev->last_rx = jiffies;		/* timestamp */
 }
 
 /* Convert line speed in bps to a number used by cyclom 2x code. */
#1 lore raw
Quoted 11 lines · Arnaldo Carvalho de Melo
drivers/net/wan/cycx_x25.c Mon Feb 26 23:38:48 2001 renamed from drivers/net/wan/cycx_x25.c Tue Feb 13 19:15:05 2001 +0 -1
@@ -812,7 +812,6 @@
        if (bitm)
                return; /* more data is coming */
 
-       dev->last_rx = jiffies;         /* timestamp */
        chan->rx_skb = NULL;            /* dequeue packet */
 
        ++chan->ifstats.rx_packets;

drivers/net/wan/cycx_x25.c Mon Feb 26 23:38:48 2001 line 825

Quoted 7 lines
drivers/net/wan/cycx_x25.c Mon Feb 26 23:38:48 2001 renamed from drivers/net/wan/cycx_x25.c Tue Feb 13 19:15:05 2001 +1 -0
@@ -820,6 +819,7 @@
 
        skb->mac.raw = skb->data;
        netif_rx(skb);
+       dev->last_rx = jiffies;         /* timestamp */
 }
 
 /* Connect interrupt handler. */

looks ok

drivers/net/wan/cycx_x25.c Mon Feb 26 23:38:48 2001 line 1457

Quoted 6 lines
drivers/net/wan/cycx_x25.c Mon Feb 26 23:38:48 2001 renamed from drivers/net/wan/cycx_x25.c Tue Feb 13 19:15:05 2001 +1 -1
@@ -1454,11 +1454,12 @@
         *ptr = event;
 
         skb->dev = dev;
-        skb->protocol = htons(ETH_P_X25);
+        skb->protocol = __constant_htons(ETH_P_X25);

The kernel definition for the htons macro should cover this..

drivers/net/wan/cycx_x25.c Mon Feb 26 23:38:48 2001 line 1462

Quoted 5 lines
drivers/net/wan/cycx_x25.c Mon Feb 26 23:38:48 2001 renamed from drivers/net/wan/cycx_x25.c Tue Feb 13 19:15:05 2001 +1 -0
         skb->mac.raw = skb->data;
         skb->pkt_type = PACKET_HOST;
 
         netif_rx(skb);
+       dev->last_rx = jiffies;         /* timestamp */

I wonder about this... For this function it is sending an event, not really a packet. So should we really timestamp it like a real packet? If so, you should increase rx_packets and rx_bytes stats too, as well as update last_rx here.

Jeff

Signature · 3 lines
Jeff Garzik       | "You see, in this world there's two kinds of
Building 1024     |  people, my friend: Those with loaded guns
MandrakeSoft      |  and those who dig. You dig."  --Blondie