linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dlci: update last_rx after netif_rx
@ 2001-02-27  1:11 Arnaldo Carvalho de Melo
  2001-02-27  2:56 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2001-02-27  1:11 UTC (permalink / raw)
  To: Alan Cox, Mike McLagan; +Cc: linux-kernel

Hi,

	Please consider applying.

- Arnaldo

--- linux-2.4.2/drivers/net/wan/dlci.c	Tue Feb 13 19:15:05 2001
+++ linux-2.4.2.acme/drivers/net/wan/dlci.c	Mon Feb 26 23:43:25 2001
@@ -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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dlci: update last_rx after netif_rx
  2001-02-27  2:56 ` Jeff Garzik
@ 2001-02-27  2:30   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2001-02-27  2:30 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alan Cox, Mike McLagan, linux-kernel

Em Mon, Feb 26, 2001 at 09:56:13PM -0500, Jeff Garzik escreveu:
> Arnaldo Carvalho de Melo wrote:
> > --- linux-2.4.2/drivers/net/wan/dlci.c  Tue Feb 13 19:15:05 2001
> > +++ linux-2.4.2.acme/drivers/net/wan/dlci.c     Mon Feb 26 23:43:25 2001
> > @@ -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


--- linux-2.4.2/drivers/net/wan/dlci.c	Tue Feb 13 19:15:05 2001
+++ linux-2.4.2.acme/drivers/net/wan/dlci.c	Tue Feb 27 00:03:05 2001
@@ -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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dlci: update last_rx after netif_rx
  2001-02-27  1:11 [PATCH] dlci: update last_rx after netif_rx Arnaldo Carvalho de Melo
@ 2001-02-27  2:56 ` Jeff Garzik
  2001-02-27  2:30   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2001-02-27  2:56 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: Alan Cox, Mike McLagan, linux-kernel

Arnaldo Carvalho de Melo wrote:
> --- linux-2.4.2/drivers/net/wan/dlci.c  Tue Feb 13 19:15:05 2001
> +++ linux-2.4.2.acme/drivers/net/wan/dlci.c     Mon Feb 26 23:43:25 2001
> @@ -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.

-- 
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-02-27  4:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-27  1:11 [PATCH] dlci: update last_rx after netif_rx Arnaldo Carvalho de Melo
2001-02-27  2:56 ` Jeff Garzik
2001-02-27  2:30   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).