Skip to contentSkip to conversation

dlci: update last_rx after netif_rx

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dlci: update last_rx after netif_rx

Hi,

Please consider applying.

- Arnaldo

drivers/net/wan/dlci.c +2 -1
@@ -205,7 +205,7 @@
 
 			case FRAD_P_IP:
 				header = sizeof(hdr->control) + sizeof(hdr->IP_NLPID);
-				skb->protocol = htons(ETH_P_IP);
+				skb->protocol = __constant_htons(ETH_P_IP);
 				process = 1;
 				break;
 
@@ -229,6 +229,7 @@
 		skb_pull(skb, header);
 		netif_rx(skb);
 		dlp->stats.rx_packets++;
+		dev->last_rx = jiffies;
 	}
 	else
 		dev_kfree_skb(skb);
#1 lore raw

drivers/net/wan/dlci.c Mon Feb 26 23:43:25 2001 line 232

Quoted 7 lines · Arnaldo Carvalho de Melo
drivers/net/wan/dlci.c Mon Feb 26 23:43:25 2001 renamed from drivers/net/wan/dlci.c Tue Feb 13 19:15:05 2001 +1 -0
@@ -229,6 +229,7 @@
                skb_pull(skb, header);
                netif_rx(skb);
                dlp->stats.rx_packets++;
+               dev->last_rx = jiffies;

You need to update dlp->stats.rx_bytes too.

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
#2 lore raw
In reply to Arnaldo Carvalho de Melo

Em Mon, Feb 26, 2001 at 09:56:13PM -0500, Jeff Garzik escreveu:

Quoted 10 lines

drivers/net/wan/dlci.c Mon Feb 26 23:43:25 2001 line 232

Quoted 7 lines · Arnaldo Carvalho de Melo
drivers/net/wan/dlci.c Mon Feb 26 23:43:25 2001 renamed from drivers/net/wan/dlci.c Tue Feb 13 19:15:05 2001 +1 -0
@@ -229,6 +229,7 @@
                skb_pull(skb, header);
                netif_rx(skb);
                dlp->stats.rx_packets++;
+               dev->last_rx = jiffies;

You need to update dlp->stats.rx_bytes too.

thanks, updated patch, there was no previous variable with the pkt lenght, so I've added one, hope is ok.

- Arnaldo

drivers/net/wan/dlci.c +4 -1
@@ -205,7 +205,7 @@
 
 			case FRAD_P_IP:
 				header = sizeof(hdr->control) + sizeof(hdr->IP_NLPID);
-				skb->protocol = htons(ETH_P_IP);
+				skb->protocol = __constant_htons(ETH_P_IP);
 				process = 1;
 				break;
 
@@ -224,11 +224,14 @@
 
 	if (process)
 	{
+		int pktlen = skb->len;
 		/* we've set up the protocol, so discard the header */
 		skb->mac.raw = skb->data; 
 		skb_pull(skb, header);
 		netif_rx(skb);
 		dlp->stats.rx_packets++;
+		dlp->stats.rx_bytes += pktlen;
+		dev->last_rx = jiffies;
 	}
 	else
 		dev_kfree_skb(skb);