Netdev List
 help / color / mirror / Atom feed
* [PATCH] forcedeth: jumbo frame support
From: Manfred Spraul @ 2005-07-16 18:14 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Netdev

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

Hi,

Attached is the missing 0.36 patch that adds jumbo frame support for the 
nForce versions that support it.
The performance difference is quite huge:
- MTU 1500: 57 MB/sec, around 85% cpu load
- MTU 7200: 92 MB/sec, around 37% cpu load

Signed-Off-By: Manfred Spraul <manfred@colorfullife.com>

[-- Attachment #2: patch-forcedeth-036-jumbo --]
[-- Type: text/plain, Size: 6564 bytes --]

--- 2.6/drivers/net/forcedeth.c	2005-06-28 22:51:26.000000000 +0200
+++ build-2.6/drivers/net/forcedeth.c	2005-06-28 22:51:40.000000000 +0200
@@ -85,6 +85,7 @@
  *	0.33: 16 May 2005: Support for MCP51 added.
  *	0.34: 18 Jun 2005: Add DEV_NEED_LINKTIMER to all nForce nics.
  *	0.35: 26 Jun 2005: Support for MCP55 added.
+ *	0.36: 28 Jul 2005: Add jumbo frame support.
  *
  * Known bugs:
  * We suspect that on some hardware no TX done interrupts are generated.
@@ -96,7 +97,7 @@
  * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
  * superfluous timer interrupts from the nic.
  */
-#define FORCEDETH_VERSION		"0.35"
+#define FORCEDETH_VERSION		"0.36"
 #define DRV_NAME			"forcedeth"
 
 #include <linux/module.h>
@@ -379,9 +380,13 @@
 #define TX_LIMIT_START	62
 
 /* rx/tx mac addr + type + vlan + align + slack*/
-#define RX_NIC_BUFSIZE		(ETH_DATA_LEN + 64)
-/* even more slack */
-#define RX_ALLOC_BUFSIZE	(ETH_DATA_LEN + 128)
+#define NV_RX_HEADERS		(64)
+/* even more slack. */
+#define NV_RX_ALLOC_PAD		(64)
+
+/* maximum mtu size */
+#define NV_PKTLIMIT_1	ETH_DATA_LEN	/* hard limit not known */
+#define NV_PKTLIMIT_2	9100	/* Actual limit according to NVidia: 9202 */
 
 #define OOM_REFILL	(1+HZ/20)
 #define POLL_WAIT	(1+HZ/100)
@@ -473,6 +478,7 @@
 	struct sk_buff *rx_skbuff[RX_RING];
 	dma_addr_t rx_dma[RX_RING];
 	unsigned int rx_buf_sz;
+	unsigned int pkt_limit;
 	struct timer_list oom_kick;
 	struct timer_list nic_poll;
 
@@ -792,7 +798,7 @@
 		nr = refill_rx % RX_RING;
 		if (np->rx_skbuff[nr] == NULL) {
 
-			skb = dev_alloc_skb(RX_ALLOC_BUFSIZE);
+			skb = dev_alloc_skb(np->rx_buf_sz + NV_RX_ALLOC_PAD);
 			if (!skb)
 				break;
 
@@ -805,7 +811,7 @@
 						PCI_DMA_FROMDEVICE);
 		np->rx_ring[nr].PacketBuffer = cpu_to_le32(np->rx_dma[nr]);
 		wmb();
-		np->rx_ring[nr].FlagLen = cpu_to_le32(RX_NIC_BUFSIZE | NV_RX_AVAIL);
+		np->rx_ring[nr].FlagLen = cpu_to_le32(np->rx_buf_sz | NV_RX_AVAIL);
 		dprintk(KERN_DEBUG "%s: nv_alloc_rx: Packet %d marked as Available\n",
 					dev->name, refill_rx);
 		refill_rx++;
@@ -831,19 +837,31 @@
 	enable_irq(dev->irq);
 }
 
-static int nv_init_ring(struct net_device *dev)
+static void nv_init_rx(struct net_device *dev) 
 {
 	struct fe_priv *np = get_nvpriv(dev);
 	int i;
 
-	np->next_tx = np->nic_tx = 0;
-	for (i = 0; i < TX_RING; i++)
-		np->tx_ring[i].FlagLen = 0;
-
 	np->cur_rx = RX_RING;
 	np->refill_rx = 0;
 	for (i = 0; i < RX_RING; i++)
 		np->rx_ring[i].FlagLen = 0;
+}
+
+static void nv_init_tx(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	int i;
+
+	np->next_tx = np->nic_tx = 0;
+	for (i = 0; i < TX_RING; i++)
+		np->tx_ring[i].FlagLen = 0;
+}
+
+static int nv_init_ring(struct net_device *dev)
+{
+	nv_init_tx(dev);
+	nv_init_rx(dev);
 	return nv_alloc_rx(dev);
 }
 
@@ -1207,15 +1225,82 @@
 	}
 }
 
+static void set_bufsize(struct net_device *dev)
+{
+	struct fe_priv *np = netdev_priv(dev);
+
+	if (dev->mtu <= ETH_DATA_LEN)
+		np->rx_buf_sz = ETH_DATA_LEN + NV_RX_HEADERS;
+	else
+		np->rx_buf_sz = dev->mtu + NV_RX_HEADERS;
+}
+
 /*
  * nv_change_mtu: dev->change_mtu function
  * Called with dev_base_lock held for read.
  */
 static int nv_change_mtu(struct net_device *dev, int new_mtu)
 {
-	if (new_mtu > ETH_DATA_LEN)
+	struct fe_priv *np = get_nvpriv(dev);
+	int old_mtu;
+
+	if (new_mtu < 64 || new_mtu > np->pkt_limit)
 		return -EINVAL;
+
+	old_mtu = dev->mtu;
 	dev->mtu = new_mtu;
+
+	/* return early if the buffer sizes will not change */
+	if (old_mtu <= ETH_DATA_LEN && new_mtu <= ETH_DATA_LEN)
+		return 0;
+	if (old_mtu == new_mtu)
+		return 0;
+
+	/* synchronized against open : rtnl_lock() held by caller */
+	if (netif_running(dev)) {
+		u8 *base = get_hwbase(dev);
+		/*
+		 * It seems that the nic preloads valid ring entries into an
+		 * internal buffer. The procedure for flushing everything is
+		 * guessed, there is probably a simpler approach.
+		 * Changing the MTU is a rare event, it shouldn't matter.
+		 */
+		disable_irq(dev->irq);
+		spin_lock_bh(&dev->xmit_lock);
+		spin_lock(&np->lock);
+		/* stop engines */
+		nv_stop_rx(dev);
+		nv_stop_tx(dev);
+		nv_txrx_reset(dev);
+		/* drain rx queue */
+		nv_drain_rx(dev);
+		nv_drain_tx(dev);
+		/* reinit driver view of the rx queue */
+		nv_init_rx(dev);
+		nv_init_tx(dev);
+		/* alloc new rx buffers */
+		set_bufsize(dev);
+		if (nv_alloc_rx(dev)) {
+			if (!np->in_shutdown)
+				mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
+		}
+		/* reinit nic view of the rx queue */
+		writel(np->rx_buf_sz, base + NvRegOffloadConfig);
+		writel((u32) np->ring_addr, base + NvRegRxRingPhysAddr);
+		writel((u32) (np->ring_addr + RX_RING*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr);
+		writel( ((RX_RING-1) << NVREG_RINGSZ_RXSHIFT) + ((TX_RING-1) << NVREG_RINGSZ_TXSHIFT),
+			base + NvRegRingSizes);
+		pci_push(base);
+		writel(NVREG_TXRXCTL_KICK|np->desc_ver, get_hwbase(dev) + NvRegTxRxControl);
+		pci_push(base);
+
+		/* restart rx engine */
+		nv_start_rx(dev);
+		nv_start_tx(dev);
+		spin_unlock(&np->lock);
+		spin_unlock_bh(&dev->xmit_lock);
+		enable_irq(dev->irq);
+	}
 	return 0;
 }
 
@@ -1792,6 +1877,7 @@
 	writel(0, base + NvRegAdapterControl);
 
 	/* 2) initialize descriptor rings */
+	set_bufsize(dev);
 	oom = nv_init_ring(dev);
 
 	writel(0, base + NvRegLinkSpeed);
@@ -1837,7 +1923,7 @@
 	writel(NVREG_MISC1_FORCE | NVREG_MISC1_HD, base + NvRegMisc1);
 	writel(readl(base + NvRegTransmitterStatus), base + NvRegTransmitterStatus);
 	writel(NVREG_PFF_ALWAYS, base + NvRegPacketFilterFlags);
-	writel(NVREG_OFFLOAD_NORMAL, base + NvRegOffloadConfig);
+	writel(np->rx_buf_sz, base + NvRegOffloadConfig);
 
 	writel(readl(base + NvRegReceiverStatus), base + NvRegReceiverStatus);
 	get_random_bytes(&i, sizeof(i));
@@ -2007,13 +2093,16 @@
 
 	/* handle different descriptor versions */
 	if (pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_1 ||
-		pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_2 ||
-		pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_3 ||    
-		pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||
-		pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_13)
+			pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_2 ||
+			pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_3 ||    
+			pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||
+			pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) {
 		np->desc_ver = DESC_VER_1;
-	else
+ 		np->pkt_limit = NV_PKTLIMIT_1;
+	} else {
 		np->desc_ver = DESC_VER_2;
+ 		np->pkt_limit = NV_PKTLIMIT_1;
+	}
 
 	err = -ENOMEM;
 	np->base = ioremap(addr, NV_PCI_REGSZ);

^ permalink raw reply

* Re: [PATCH] forcedeth: TX handler changes (experimental)
From: Daniel Drake @ 2005-07-16 19:52 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: Linux Kernel Mailing List, Netdev, Ayaz Abdulla
In-Reply-To: <42D913D6.5050902@colorfullife.com>

Hi,

Manfred Spraul wrote:
> Attached is a patch that modifies the tx interrupt handling of the 
> nForce nic. It's part of the attempts to figure out what causes the nic 
> hangs (see bug 4552).
> The change is experimental: It affects all nForce versions. I've tested 
> it on my nForce 250-Gb.
> 
> Please test it. And especially: If you experince a nic hang, please send 
> me the debug output. That's the block starting with
> 
> <<
> NETDEV WATCHDOG: eth1: transmit timed out
> eth1: Got tx_timeout. irq: 00000000
> eth1: Ring at  ...
> <<

After applying the v0.38 patch, I can't get any network at all. DHCP fails to 
get an IP. v0.37 works fine.

I enabled debugging, and I get this failure for every packet being 
transmitted: ( i masked out part of my MAC addr with XX )

Jul 16 20:06:28 dsd eth0: nv_start_xmit: packet packet 3 queued for transmission.
Jul 16 20:06:28 dsd
Jul 16 20:06:28 dsd 000: ff ff ff ff ff ff 00 50 8d XX XX XX 08 00 45 00
Jul 16 20:06:28 dsd 010: 02 40 75 a0 00 00 40 11 03 0e 00 00 00 00 ff ff
Jul 16 20:06:28 dsd 020: ff ff 00 44 00 43 02 2c 13 0a 01 01 06 00 d2 76
Jul 16 20:06:28 dsd 030: bc 10 00 0a 00 00 00 00 00 00 00 00 00 00 00 00
Jul 16 20:06:28 dsd eth0: nv_nic_irq
Jul 16 20:06:28 dsd eth0: irq: 00000008
Jul 16 20:06:28 dsd eth0: nv_tx_done: looking at packet 3, Flags 0x6000024d.
Jul 16 20:06:28 dsd eth0: received irq with events 0x8. Probably TX fail.
Jul 16 20:06:28 dsd eth0: irq: 00000000
Jul 16 20:06:28 dsd eth0: nv_nic_irq completed

My hardware:

0000:00:04.0 Class 0200: 10de:0066 (rev a1)

0000:00:04.0 Ethernet controller: nVidia Corporation nForce2 Ethernet 
Controller (rev a1)
         Subsystem: ABIT Computer Corp.: Unknown device 1c00
         Flags: bus master, 66Mhz, fast devsel, latency 0, IRQ 17
         Memory at e0087000 (32-bit, non-prefetchable) [size=4K]
         I/O ports at b000 [size=8]
         Capabilities: [44] Power Management version 2

Here's the start of the logs:


Jul 16 20:05:27 dsd forcedeth.c: Reverse Engineered nForce ethernet driver. 
Version 0.38.
Jul 16 20:05:27 dsd ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [APCH] -> GSI 
21 (level, high) -> IRQ 17
Jul 16 20:05:27 dsd PCI: Setting latency timer of device 0000:00:04.0 to 64
Jul 16 20:05:27 dsd 0000:00:04.0: resource 0 start e0087000 len 4096 flags 
0x00000200.
Jul 16 20:05:27 dsd 0000:00:04.0: MAC Address 00:50:8d:XX:XX:XX
Jul 16 20:05:27 dsd 0000:00:04.0: link timer on.
Jul 16 20:05:27 dsd eth%d: mii_rw read from reg 2 at PHY 1: 0x0.
Jul 16 20:05:27 dsd eth%d: mii_rw read from reg 3 at PHY 1: 0x8201.
Jul 16 20:05:27 dsd 0000:00:04.0: open: Found PHY 0000:0020 at address 1.
Jul 16 20:05:27 dsd eth%d: mii_rw read from reg 4 at PHY 1: 0x1e1.
Jul 16 20:05:27 dsd eth%d: mii_rw wrote 0xde1 to reg 4 at PHY 1
Jul 16 20:05:27 dsd eth%d: mii_rw read from reg 1 at PHY 1: 0x786d.
Jul 16 20:05:27 dsd eth%d: mii_rw read from reg 0 at PHY 1: 0x3100.
Jul 16 20:05:27 dsd eth%d: mii_rw wrote 0xb100 to reg 0 at PHY 1
Jul 16 20:05:28 dsd eth%d: mii_rw read from reg 0 at PHY 1: 0x3000.
Jul 16 20:05:28 dsd eth%d: mii_rw read from reg 0 at PHY 1: 0x3000.
Jul 16 20:05:28 dsd eth%d: mii_rw wrote 0x3200 to reg 0 at PHY 1
Jul 16 20:05:28 dsd eth0: forcedeth.c: subsystem: 0147b:1c00 bound to 0000:00:04.0
Jul 16 20:05:28 dsd rc-scripts: Configuration not set for eth0 - assuming dhcp
Jul 16 20:05:28 dsd nv_open: begin
Jul 16 20:05:28 dsd eth0: nv_alloc_rx: Packet 0 marked as Available
Jul 16 20:05:28 dsd eth0: nv_alloc_rx: Packet 1 marked as Available
Jul 16 20:05:28 dsd eth0: nv_alloc_rx: Packet 2 marked as Available

<snip>

Jul 16 20:05:28 dsd eth0: nv_alloc_rx: Packet 125 marked as Available
Jul 16 20:05:28 dsd eth0: nv_alloc_rx: Packet 126 marked as Available
Jul 16 20:05:28 dsd eth0: nv_alloc_rx: Packet 127 marked as Available
Jul 16 20:05:28 dsd eth0: nv_txrx_reset
Jul 16 20:05:28 dsd startup: got 0x00000010.
Jul 16 20:05:28 dsd eth0: mii_rw read from reg 1 at PHY 1: 0x7849.
Jul 16 20:05:28 dsd eth0: mii_rw read from reg 1 at PHY 1: 0x7849.
Jul 16 20:05:28 dsd eth0: no link detected by phy - falling back to 10HD.
Jul 16 20:05:28 dsd eth0: nv_start_rx
Jul 16 20:05:28 dsd eth0: nv_start_rx to duplex 0, speed 0x000103e8.
Jul 16 20:05:28 dsd eth0: nv_start_tx
Jul 16 20:05:28 dsd eth0: no link during initialization.
Jul 16 20:05:28 dsd eth0: nv_stop_rx
Jul 16 20:05:28 dsd eth0: reconfiguration for multicast lists.
Jul 16 20:05:28 dsd eth0: nv_start_rx
Jul 16 20:05:28 dsd eth0: nv_start_rx to duplex 0, speed 0x000103e8.
Jul 16 20:05:28 dsd eth0: nv_stop_rx
Jul 16 20:05:28 dsd eth0: reconfiguration for multicast lists.
Jul 16 20:05:28 dsd eth0: nv_start_rx
Jul 16 20:05:28 dsd eth0: nv_start_rx to duplex 0, speed 0x000103e8.
Jul 16 20:05:28 dsd eth0: nv_stop_rx
Jul 16 20:05:28 dsd eth0: reconfiguration for multicast lists.
Jul 16 20:05:28 dsd eth0: nv_start_rx
Jul 16 20:05:28 dsd eth0: nv_start_rx to duplex 0, speed 0x000103e8.

Let me know if full logs would be useful (they are big, and it just shows a 
lot of interrupts, some packets being queued up, and 5 or so TX failures like 
the ones above).

Daniel

^ permalink raw reply

* Re: [PATCH] forcedeth: jumbo frame support
From: Tim Mattox @ 2005-07-16 21:09 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: Jeff Garzik, Netdev
In-Reply-To: <42D94E95.1060303@colorfullife.com>

This is just from a simple read of Manfred's patch, but shouldn't one side of
the if-else use the NV_PKTLIMIT_2 value?  If not, why is
np->pkt_limit = NV_PKTLIMIT_1; inside the if-else at all?

On 7/16/05, Manfred Spraul <manfred@colorfullife.com> wrote:
[snip]
> +/* maximum mtu size */
> +#define NV_PKTLIMIT_1  ETH_DATA_LEN    /* hard limit not known */
> +#define NV_PKTLIMIT_2  9100    /* Actual limit according to NVidia: 9202 */
[snip]
> @@ -2007,13 +2093,16 @@
> 
>         /* handle different descriptor versions */
>         if (pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_1 ||
> -               pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_2 ||
> -               pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_3 ||
> -               pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||
> -               pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_13)
> +                       pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_2 ||
> +                       pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_3 ||
> +                       pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||
> +                       pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) {
>                 np->desc_ver = DESC_VER_1;
> -       else
> +               np->pkt_limit = NV_PKTLIMIT_1;
> +       } else {
>                 np->desc_ver = DESC_VER_2;
> +               np->pkt_limit = NV_PKTLIMIT_1;
> +       }

-- 
Tim Mattox - tmattox@gmail.com
  http://homepage.mac.com/tmattox/
    I'm a bright... http://www.the-brights.net/

^ permalink raw reply

* Re: [PATCH] forcedeth: jumbo frame support
From: Manfred Spraul @ 2005-07-16 21:15 UTC (permalink / raw)
  To: Tim Mattox; +Cc: Jeff Garzik, Netdev
In-Reply-To: <ea86ce22050716140987d7ef8@mail.gmail.com>

Tim Mattox wrote:

>This is just from a simple read of Manfred's patch, but shouldn't one side of
>the if-else use the NV_PKTLIMIT_2 value?
>
It should - and it's already fixed in the following patch for 0.37, 
which is already in Jeff's queue.
I didn't want to break the patch in Jeff's queue, thus I submitted the 
patch as it was.
It doesn't hurt much: 0.36 adds the jumbo frame support, 0.37 actually 
enables it.

--
    Manfred

^ permalink raw reply

* Re: [PATCH] forcedeth: TX handler changes (experimental)
From: Daniel Drake @ 2005-07-16 21:24 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: Linux Kernel Mailing List, Netdev, Ayaz Abdulla
In-Reply-To: <42D9658B.7020907@gentoo.org>

Daniel Drake wrote:
> After applying the v0.38 patch, I can't get any network at all. DHCP 
> fails to get an IP. v0.37 works fine.

Tracked it down. (sorry for linewraps)

+#define DEV_NEED_TIMERIRQ	0x0001  /* set the timer irq flag in the irq mask */
+#define DEV_NEED_LINKTIMER	0x0002	/* poll link settings. Relies on the timer 
irq */
+#define DEV_HAS_LARGEDESC	0x0003	/* device supports jumbo frames and needs 
packet format 2 */

My hardware is NEED_TIMERIRQ|NEED_LINKTIMER, however, by this logic, it'll 
also be DEV_HAVE_LARGEDESC, which isn't true.

So, you want this instead:

#define DEV_HAS_LARGEDESC	0x0004

After making that change, all is working fine, but then again, I've never run 
into the hangs you are debugging. I'll follow up in a couple of days time to 
confirm I'm not getting any problems with the new code.

Thanks,
Daniel

^ permalink raw reply

* Re: [PATCH] forcedeth: TX handler changes (experimental)
From: Manfred Spraul @ 2005-07-16 21:36 UTC (permalink / raw)
  To: Daniel Drake; +Cc: Linux Kernel Mailing List, Netdev, Ayaz Abdulla
In-Reply-To: <42D97B29.4050400@gentoo.org>

Daniel Drake wrote:

> So, you want this instead:
>
> #define DEV_HAS_LARGEDESC    0x0004
>
Autsch.
Yes, you are right. Sorry for that, I should have reread the patch once 
more. I've fixed it on my website.

--
    Manfred

^ permalink raw reply

* [PATCH] convert nfmark and conntrack mark to 32bit
From: Harald Welte @ 2005-07-16 21:40 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, Netfilter Development Mailinglist

[-- Attachment #1: Type: text/plain, Size: 5309 bytes --]

Hi Dave, please apply:

As discussed at netconf'05, we convert nfmark and conntrack-mark to be
32bits even on 64bit architectures. 

Signed-off-by: Harald Welte <laforge@netfilter.org>

diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -171,7 +171,7 @@ struct ip_conntrack
 #endif /* CONFIG_IP_NF_NAT_NEEDED */
 
 #if defined(CONFIG_IP_NF_CONNTRACK_MARK)
-	unsigned long mark;
+	u_int32_t mark;
 #endif
 
 	/* Traversed often, so hopefully in different cacheline to top */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -259,7 +259,7 @@ struct sk_buff {
 
 	void			(*destructor)(struct sk_buff *skb);
 #ifdef CONFIG_NETFILTER
-	unsigned long		nfmark;
+	__u32			nfmark;
 	__u32			nfcache;
 	__u32			nfctinfo;
 	struct nf_conntrack	*nfct;
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -185,7 +185,7 @@ static int ct_seq_show(struct seq_file *
 			return -ENOSPC;
 
 #if defined(CONFIG_IP_NF_CONNTRACK_MARK)
-	if (seq_printf(s, "mark=%lu ", conntrack->mark))
+	if (seq_printf(s, "mark=%u ", conntrack->mark))
 		return -ENOSPC;
 #endif
 
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -367,7 +367,7 @@ target(struct sk_buff **pskb,
 #ifdef DEBUG_CLUSTERP
 	DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
 #endif
-	DEBUGP("hash=%u ct_hash=%lu ", hash, ct->mark);
+	DEBUGP("hash=%u ct_hash=%u ", hash, ct->mark);
 	if (!clusterip_responsible(cipinfo->config, hash)) {
 		DEBUGP("not responsible\n");
 		return NF_DROP;
diff --git a/net/ipv4/netfilter/ipt_CONNMARK.c b/net/ipv4/netfilter/ipt_CONNMARK.c
--- a/net/ipv4/netfilter/ipt_CONNMARK.c
+++ b/net/ipv4/netfilter/ipt_CONNMARK.c
@@ -40,9 +40,9 @@ target(struct sk_buff **pskb,
        void *userinfo)
 {
 	const struct ipt_connmark_target_info *markinfo = targinfo;
-	unsigned long diff;
-	unsigned long nfmark;
-	unsigned long newmark;
+	u_int32_t diff;
+	u_int32_t nfmark;
+	u_int32_t newmark;
 
 	enum ip_conntrack_info ctinfo;
 	struct ip_conntrack *ct = ip_conntrack_get((*pskb), &ctinfo);
@@ -94,6 +94,11 @@ checkentry(const char *tablename,
 	    }
 	}
 
+	if (matchinfo->mark > 0xffffffff || matchinfo->mask > 0xffffffff) {
+		printk(KERN_WARNING "CONNMARK: Only supports 32bit mark\n");
+		return 0;
+	}
+
 	return 1;
 }
 
diff --git a/net/ipv4/netfilter/ipt_MARK.c b/net/ipv4/netfilter/ipt_MARK.c
--- a/net/ipv4/netfilter/ipt_MARK.c
+++ b/net/ipv4/netfilter/ipt_MARK.c
@@ -76,6 +76,8 @@ checkentry_v0(const char *tablename,
 	      unsigned int targinfosize,
 	      unsigned int hook_mask)
 {
+	struct ipt_mark_target_info *markinfo = targinfo;
+
 	if (targinfosize != IPT_ALIGN(sizeof(struct ipt_mark_target_info))) {
 		printk(KERN_WARNING "MARK: targinfosize %u != %Zu\n",
 		       targinfosize,
@@ -88,6 +90,11 @@ checkentry_v0(const char *tablename,
 		return 0;
 	}
 
+	if (markinfo->mark > 0xffffffff) {
+		printk(KERN_WARNING "MARK: Only supports 32bit wide mark\n");
+		return 0;
+	}
+
 	return 1;
 }
 
@@ -120,6 +127,11 @@ checkentry_v1(const char *tablename,
 		return 0;
 	}
 
+	if (markinfo->mark > 0xffffffff) {
+		printk(KERN_WARNING "MARK: Only supports 32bit wide mark\n");
+		return 0;
+	}
+
 	return 1;
 }
 
diff --git a/net/ipv4/netfilter/ipt_connmark.c b/net/ipv4/netfilter/ipt_connmark.c
--- a/net/ipv4/netfilter/ipt_connmark.c
+++ b/net/ipv4/netfilter/ipt_connmark.c
@@ -54,9 +54,16 @@ checkentry(const char *tablename,
 	   unsigned int matchsize,
 	   unsigned int hook_mask)
 {
+	struct ipt_connmark_info *cm = 
+				(struct ipt_connmark_info *)matchinfo;
 	if (matchsize != IPT_ALIGN(sizeof(struct ipt_connmark_info)))
 		return 0;
 
+	if (cm->mark > 0xffffffff || cm->mask > 0xffffffff) {
+		printk(KERN_WARNING "connmark: only support 32bit mark\n");
+		return 0;
+	}
+
 	return 1;
 }
 
diff --git a/net/ipv4/netfilter/ipt_mark.c b/net/ipv4/netfilter/ipt_mark.c
--- a/net/ipv4/netfilter/ipt_mark.c
+++ b/net/ipv4/netfilter/ipt_mark.c
@@ -37,9 +37,16 @@ checkentry(const char *tablename,
            unsigned int matchsize,
            unsigned int hook_mask)
 {
+	struct ipt_mark_info *minfo = (struct ipt_mark_info *) matchinfo;
+
 	if (matchsize != IPT_ALIGN(sizeof(struct ipt_mark_info)))
 		return 0;
 
+	if (minfo->mark > 0xffffffff || minfo->mask > 0xffffffff) {
+		printk(KERN_WARNING "mark: only supports 32bit mark\n");
+		return 0;
+	}
+
 	return 1;
 }
 
-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH] reduce netfilte sk_buff enlargement
From: Harald Welte @ 2005-07-16 21:40 UTC (permalink / raw)
  To: Netfilter Development Mailinglist; +Cc: Linux Netdev List, wensong

[-- Attachment #1: Type: text/plain, Size: 19280 bytes --]

Hi!

As discussed at netconf'05, we're trying to save every bit in sk_buff.
The patch below makes sk_buff 8 bytes smaller.  I did some basic testing
on my notebook and it seems to work.

The only real in-tree user of nfcache was IPVS, who only needs a single
bit.  Unfortunately I couldn't find some other free bit in sk_buff to
stuff that bit into, so I introduced a separate field for them.  Maybe
the IPVS guys can resolve that to further save space.

Initially I wanted to shrink pkt_type to three bits (PACKET_HOST and
alike are only 6 values defined), but unfortunately the bluetooth code
overloads pkt_type :(

The conntrack-event-api (out-of-tree) uses nfcache, but Rusty just came
up with a way how to do it without any skb fields, so it's safe to
remove it.


- remove all never-implemented 'nfcache' code
- don't have ipvs code abuse 'nfcache' field. currently get's their own
  compile-conditional skb->ipvs_property field.  IPVS maintainers can
  decide to move this bit elswhere, but nfcache needs to die.
- remove skb->nfcache field to save 4 bytes
- move skb->nfctinfo into three unused bits to save further 4 bytes

Signed-off-by: Harald Welte <laforge@netfilter.org>

---
commit 11f0f1a381dd525aa9b48b64e8fb4dee22ef3520
tree c058108477e708ff81c63318168b6355356e9e6d
parent 1f78366f895151f38c15a2b22b9d4b988dd351e9
author laforge <laforge@netfilter.org> Sun, 17 Jul 2005 23:32:58 +0200
committer laforge <laforge@netfilter.org> Sun, 17 Jul 2005 23:32:58 +0200

 include/linux/netfilter.h              |    5 -----
 include/linux/netfilter_decnet.h       |   10 ----------
 include/linux/netfilter_ipv4.h         |   28 ----------------------------
 include/linux/netfilter_ipv6.h         |   30 ------------------------------
 include/linux/skbuff.h                 |   10 +++++-----
 net/bridge/netfilter/ebt_mark.c        |    5 ++---
 net/core/skbuff.c                      |    2 --
 net/ipv4/ip_output.c                   |    1 -
 net/ipv4/ipvs/ip_vs_core.c             |    9 +++++----
 net/ipv4/ipvs/ip_vs_xmit.c             |    2 +-
 net/ipv4/netfilter/ip_conntrack_core.c |    7 +------
 net/ipv4/netfilter/ip_nat_core.c       |    1 -
 net/ipv4/netfilter/ip_nat_standalone.c |    2 --
 net/ipv4/netfilter/ip_queue.c          |    1 -
 net/ipv4/netfilter/ip_tables.c         |    1 -
 net/ipv4/netfilter/ipt_CLASSIFY.c      |    4 +---
 net/ipv4/netfilter/ipt_CONNMARK.c      |    4 +---
 net/ipv4/netfilter/ipt_DSCP.c          |    1 -
 net/ipv4/netfilter/ipt_ECN.c           |    2 --
 net/ipv4/netfilter/ipt_MARK.c          |   10 ++++------
 net/ipv4/netfilter/ipt_REJECT.c        |    1 -
 net/ipv4/netfilter/ipt_TCPMSS.c        |    1 -
 net/ipv4/netfilter/ipt_TOS.c           |    1 -
 net/ipv6/ip6_output.c                  |   16 ++--------------
 net/ipv6/netfilter/ip6_queue.c         |    1 -
 net/ipv6/netfilter/ip6_tables.c        |    1 -
 net/ipv6/netfilter/ip6t_MARK.c         |    5 ++---
 27 files changed, 24 insertions(+), 137 deletions(-)

diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -21,11 +21,6 @@
 #define NF_STOP 5
 #define NF_MAX_VERDICT NF_STOP
 
-/* Generic cache responses from hook functions.
-   <= 0x2000 is used for protocol-flags. */
-#define NFC_UNKNOWN 0x4000
-#define NFC_ALTERED 0x8000
-
 #ifdef __KERNEL__
 #include <linux/config.h>
 #ifdef CONFIG_NETFILTER
diff --git a/include/linux/netfilter_decnet.h b/include/linux/netfilter_decnet.h
--- a/include/linux/netfilter_decnet.h
+++ b/include/linux/netfilter_decnet.h
@@ -9,16 +9,6 @@
 
 #include <linux/netfilter.h>
 
-/* IP Cache bits. */
-/* Src IP address. */
-#define NFC_DN_SRC		0x0001
-/* Dest IP address. */
-#define NFC_DN_DST		0x0002
-/* Input device. */
-#define NFC_DN_IF_IN		0x0004
-/* Output device. */
-#define NFC_DN_IF_OUT		0x0008
-
 /* DECnet Hooks */
 /* After promisc drops, checksum checks. */
 #define NF_DN_PRE_ROUTING	0
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -8,34 +8,6 @@
 #include <linux/config.h>
 #include <linux/netfilter.h>
 
-/* IP Cache bits. */
-/* Src IP address. */
-#define NFC_IP_SRC		0x0001
-/* Dest IP address. */
-#define NFC_IP_DST		0x0002
-/* Input device. */
-#define NFC_IP_IF_IN		0x0004
-/* Output device. */
-#define NFC_IP_IF_OUT		0x0008
-/* TOS. */
-#define NFC_IP_TOS		0x0010
-/* Protocol. */
-#define NFC_IP_PROTO		0x0020
-/* IP options. */
-#define NFC_IP_OPTIONS		0x0040
-/* Frag & flags. */
-#define NFC_IP_FRAG		0x0080
-
-/* Per-protocol information: only matters if proto match. */
-/* TCP flags. */
-#define NFC_IP_TCPFLAGS		0x0100
-/* Source port. */
-#define NFC_IP_SRC_PT		0x0200
-/* Dest port. */
-#define NFC_IP_DST_PT		0x0400
-/* Something else about the proto */
-#define NFC_IP_PROTO_UNKNOWN	0x2000
-
 /* IP Hooks */
 /* After promisc drops, checksum checks. */
 #define NF_IP_PRE_ROUTING	0
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -10,36 +10,6 @@
 
 #include <linux/netfilter.h>
 
-/* IP Cache bits. */
-/* Src IP address. */
-#define NFC_IP6_SRC              0x0001
-/* Dest IP address. */
-#define NFC_IP6_DST              0x0002
-/* Input device. */
-#define NFC_IP6_IF_IN            0x0004
-/* Output device. */
-#define NFC_IP6_IF_OUT           0x0008
-/* TOS. */
-#define NFC_IP6_TOS              0x0010
-/* Protocol. */
-#define NFC_IP6_PROTO            0x0020
-/* IP options. */
-#define NFC_IP6_OPTIONS          0x0040
-/* Frag & flags. */
-#define NFC_IP6_FRAG             0x0080
-
-
-/* Per-protocol information: only matters if proto match. */
-/* TCP flags. */
-#define NFC_IP6_TCPFLAGS         0x0100
-/* Source port. */
-#define NFC_IP6_SRC_PT           0x0200
-/* Dest port. */
-#define NFC_IP6_DST_PT           0x0400
-/* Something else about the proto */
-#define NFC_IP6_PROTO_UNKNOWN    0x2000
-
-
 /* IP6 Hooks */
 /* After promisc drops, checksum checks. */
 #define NF_IP6_PRE_ROUTING	0
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -190,7 +190,6 @@ struct skb_shared_info {
  *	@end: End pointer
  *	@destructor: Destruct function
  *	@nfmark: Can be used for communication between hooks
- *	@nfcache: Cache info
  *	@nfct: Associated connection, if any
  *	@nfctinfo: Relationship of this skb to the connection
  *	@nf_bridge: Saved data about a bridged frame - see br_netfilter.c
@@ -252,17 +251,18 @@ struct sk_buff {
 	__u8			local_df:1,
 				cloned:1,
 				ip_summed:2,
-				nohdr:1;
-				/* 3 bits spare */
+				nohdr:1,
+				nfctinfo:3;
 	__u8			pkt_type;
 	__u16			protocol;
 
 	void			(*destructor)(struct sk_buff *skb);
 #ifdef CONFIG_NETFILTER
 	__u32			nfmark;
-	__u32			nfcache;
-	__u32			nfctinfo;
 	struct nf_conntrack	*nfct;
+#if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE)
+	__u8			ipvs_property:1;
+#endif
 #ifdef CONFIG_BRIDGE_NETFILTER
 	struct nf_bridge_info	*nf_bridge;
 #endif
diff --git a/net/bridge/netfilter/ebt_mark.c b/net/bridge/netfilter/ebt_mark.c
--- a/net/bridge/netfilter/ebt_mark.c
+++ b/net/bridge/netfilter/ebt_mark.c
@@ -23,10 +23,9 @@ static int ebt_target_mark(struct sk_buf
 {
 	struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
 
-	if ((*pskb)->nfmark != info->mark) {
+	if ((*pskb)->nfmark != info->mark)
 		(*pskb)->nfmark = info->mark;
-		(*pskb)->nfcache |= NFC_ALTERED;
-	}
+
 	return info->target;
 }
 
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -361,7 +361,6 @@ struct sk_buff *skb_clone(struct sk_buff
 	n->destructor = NULL;
 #ifdef CONFIG_NETFILTER
 	C(nfmark);
-	C(nfcache);
 	C(nfct);
 	nf_conntrack_get(skb->nfct);
 	C(nfctinfo);
@@ -424,7 +423,6 @@ static void copy_skb_header(struct sk_bu
 	new->destructor = NULL;
 #ifdef CONFIG_NETFILTER
 	new->nfmark	= old->nfmark;
-	new->nfcache	= old->nfcache;
 	new->nfct	= old->nfct;
 	nf_conntrack_get(old->nfct);
 	new->nfctinfo	= old->nfctinfo;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -392,7 +392,6 @@ static void ip_copy_metadata(struct sk_b
 #endif
 #ifdef CONFIG_NETFILTER
 	to->nfmark = from->nfmark;
-	to->nfcache = from->nfcache;
 	/* Connection association is same as pre-frag packet */
 	nf_conntrack_put(to->nfct);
 	to->nfct = from->nfct;
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c
--- a/net/ipv4/ipvs/ip_vs_core.c
+++ b/net/ipv4/ipvs/ip_vs_core.c
@@ -22,6 +22,7 @@
  *
  * Changes:
  *	Paul `Rusty' Russell		properly handle non-linear skbs
+ *	Harald Welte			don't use nfcache
  *
  */
 
@@ -529,7 +530,7 @@ static unsigned int ip_vs_post_routing(u
 				       const struct net_device *out,
 				       int (*okfn)(struct sk_buff *))
 {
-	if (!((*pskb)->nfcache & NFC_IPVS_PROPERTY))
+	if (!((*pskb)->ipvs_property))
 		return NF_ACCEPT;
 
 	/* The packet was sent from IPVS, exit this chain */
@@ -701,7 +702,7 @@ static int ip_vs_out_icmp(struct sk_buff
 	/* do the statistics and put it back */
 	ip_vs_out_stats(cp, skb);
 
-	skb->nfcache |= NFC_IPVS_PROPERTY;
+	skb->ipvs_property = 1;
 	verdict = NF_ACCEPT;
 
   out:
@@ -739,7 +740,7 @@ ip_vs_out(unsigned int hooknum, struct s
 
 	EnterFunction(11);
 
-	if (skb->nfcache & NFC_IPVS_PROPERTY)
+	if (skb->ipvs_property)
 		return NF_ACCEPT;
 
 	iph = skb->nh.iph;
@@ -821,7 +822,7 @@ ip_vs_out(unsigned int hooknum, struct s
 	ip_vs_set_state(cp, IP_VS_DIR_OUTPUT, skb, pp);
 	ip_vs_conn_put(cp);
 
-	skb->nfcache |= NFC_IPVS_PROPERTY;
+	skb->ipvs_property = 1;
 
 	LeaveFunction(11);
 	return NF_ACCEPT;
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -127,7 +127,7 @@ ip_vs_dst_reset(struct ip_vs_dest *dest)
 
 #define IP_VS_XMIT(skb, rt)				\
 do {							\
-	(skb)->nfcache |= NFC_IPVS_PROPERTY;		\
+	(skb)->ipvs_property = 1;			\
 	(skb)->ip_summed = CHECKSUM_NONE;		\
 	NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, (skb), NULL,	\
 		(rt)->u.dst.dev, dst_output);		\
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
--- a/net/ipv4/netfilter/ip_conntrack_core.c
+++ b/net/ipv4/netfilter/ip_conntrack_core.c
@@ -627,9 +627,6 @@ unsigned int ip_conntrack_in(unsigned in
 		return NF_DROP;
 	}
 
-	/* FIXME: Do this right please. --RR */
-	(*pskb)->nfcache |= NFC_UNKNOWN;
-
 /* Doesn't cover locally-generated broadcast, so not worth it. */
 #if 0
 	/* Ignore broadcast: no `connection'. */
@@ -942,10 +939,8 @@ ip_ct_gather_frags(struct sk_buff *skb, 
 	skb = ip_defrag(skb, user);
 	local_bh_enable();
 
-	if (skb) {
+	if (skb)
 		ip_send_check(skb->nh.iph);
-		skb->nfcache |= NFC_ALTERED;
-	}
 	return skb;
 }
 
diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c
--- a/net/ipv4/netfilter/ip_nat_core.c
+++ b/net/ipv4/netfilter/ip_nat_core.c
@@ -321,7 +321,6 @@ manip_pkt(u_int16_t proto,
 {
 	struct iphdr *iph;
 
-	(*pskb)->nfcache |= NFC_ALTERED;
 	if (!skb_ip_make_writable(pskb, iphdroff + sizeof(*iph)))
 		return 0;
 
diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c
--- a/net/ipv4/netfilter/ip_nat_standalone.c
+++ b/net/ipv4/netfilter/ip_nat_standalone.c
@@ -73,8 +73,6 @@ ip_nat_fn(unsigned int hooknum,
 	IP_NF_ASSERT(!((*pskb)->nh.iph->frag_off
 		       & htons(IP_MF|IP_OFFSET)));
 
-	(*pskb)->nfcache |= NFC_UNKNOWN;
-
 	/* If we had a hardware checksum before, it's now invalid */
 	if ((*pskb)->ip_summed == CHECKSUM_HW)
 		if (skb_checksum_help(*pskb, (out == NULL)))
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -385,7 +385,6 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, st
 	if (!skb_ip_make_writable(&e->skb, v->data_len))
 		return -ENOMEM;
 	memcpy(e->skb->data, v->payload, v->data_len);
-	e->skb->nfcache |= NFC_ALTERED;
 
 	/*
 	 * Extra routing may needed on local out, as the QUEUE target never
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -312,7 +312,6 @@ ipt_do_table(struct sk_buff **pskb,
 	do {
 		IP_NF_ASSERT(e);
 		IP_NF_ASSERT(back);
-		(*pskb)->nfcache |= e->nfcache;
 		if (ip_packet_match(ip, indev, outdev, &e->ip, offset)) {
 			struct ipt_entry_target *t;
 
diff --git a/net/ipv4/netfilter/ipt_CLASSIFY.c b/net/ipv4/netfilter/ipt_CLASSIFY.c
--- a/net/ipv4/netfilter/ipt_CLASSIFY.c
+++ b/net/ipv4/netfilter/ipt_CLASSIFY.c
@@ -32,10 +32,8 @@ target(struct sk_buff **pskb,
 {
 	const struct ipt_classify_target_info *clinfo = targinfo;
 
-	if((*pskb)->priority != clinfo->priority) {
+	if((*pskb)->priority != clinfo->priority) 
 		(*pskb)->priority = clinfo->priority;
-		(*pskb)->nfcache |= NFC_ALTERED;
-	}
 
 	return IPT_CONTINUE;
 }
diff --git a/net/ipv4/netfilter/ipt_CONNMARK.c b/net/ipv4/netfilter/ipt_CONNMARK.c
--- a/net/ipv4/netfilter/ipt_CONNMARK.c
+++ b/net/ipv4/netfilter/ipt_CONNMARK.c
@@ -61,10 +61,8 @@ target(struct sk_buff **pskb,
 	    case IPT_CONNMARK_RESTORE:
 		nfmark = (*pskb)->nfmark;
 		diff = (ct->mark ^ nfmark) & markinfo->mask;
-		if (diff != 0) {
+		if (diff != 0)
 		    (*pskb)->nfmark = nfmark ^ diff;
-		    (*pskb)->nfcache |= NFC_ALTERED;
-		}
 		break;
 	    }
 	}
diff --git a/net/ipv4/netfilter/ipt_DSCP.c b/net/ipv4/netfilter/ipt_DSCP.c
--- a/net/ipv4/netfilter/ipt_DSCP.c
+++ b/net/ipv4/netfilter/ipt_DSCP.c
@@ -51,7 +51,6 @@ target(struct sk_buff **pskb,
 						 sizeof(diffs),
 						 (*pskb)->nh.iph->check
 						 ^ 0xFFFF));
-		(*pskb)->nfcache |= NFC_ALTERED;
 	}
 	return IPT_CONTINUE;
 }
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c
--- a/net/ipv4/netfilter/ipt_ECN.c
+++ b/net/ipv4/netfilter/ipt_ECN.c
@@ -43,7 +43,6 @@ set_ect_ip(struct sk_buff **pskb, const 
 						 sizeof(diffs),
 						 (*pskb)->nh.iph->check
 						 ^0xFFFF));
-		(*pskb)->nfcache |= NFC_ALTERED;
 	} 
 	return 1;
 }
@@ -86,7 +85,6 @@ set_ect_tcp(struct sk_buff **pskb, const
 	else
 		if (skb_checksum_help(*pskb, inward))
 			return 0;
-	(*pskb)->nfcache |= NFC_ALTERED;
 	return 1;
 }
 
diff --git a/net/ipv4/netfilter/ipt_MARK.c b/net/ipv4/netfilter/ipt_MARK.c
--- a/net/ipv4/netfilter/ipt_MARK.c
+++ b/net/ipv4/netfilter/ipt_MARK.c
@@ -29,10 +29,9 @@ target_v0(struct sk_buff **pskb,
 {
 	const struct ipt_mark_target_info *markinfo = targinfo;
 
-	if((*pskb)->nfmark != markinfo->mark) {
+	if((*pskb)->nfmark != markinfo->mark)
 		(*pskb)->nfmark = markinfo->mark;
-		(*pskb)->nfcache |= NFC_ALTERED;
-	}
+
 	return IPT_CONTINUE;
 }
 
@@ -61,10 +60,9 @@ target_v1(struct sk_buff **pskb,
 		break;
 	}
 
-	if((*pskb)->nfmark != mark) {
+	if((*pskb)->nfmark != mark)
 		(*pskb)->nfmark = mark;
-		(*pskb)->nfcache |= NFC_ALTERED;
-	}
+
 	return IPT_CONTINUE;
 }
 
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -156,7 +156,6 @@ static void send_reset(struct sk_buff *o
 
 	/* This packet will not be the same as the other: clear nf fields */
 	nf_reset(nskb);
-	nskb->nfcache = 0;
 	nskb->nfmark = 0;
 #ifdef CONFIG_BRIDGE_NETFILTER
 	nf_bridge_put(nskb->nf_bridge);
diff --git a/net/ipv4/netfilter/ipt_TCPMSS.c b/net/ipv4/netfilter/ipt_TCPMSS.c
--- a/net/ipv4/netfilter/ipt_TCPMSS.c
+++ b/net/ipv4/netfilter/ipt_TCPMSS.c
@@ -189,7 +189,6 @@ ipt_tcpmss_target(struct sk_buff **pskb,
 	/* We never hw checksum SYN packets.  */
 	BUG_ON((*pskb)->ip_summed == CHECKSUM_HW);
 
-	(*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED;
 	return IPT_CONTINUE;
 }
 
diff --git a/net/ipv4/netfilter/ipt_TOS.c b/net/ipv4/netfilter/ipt_TOS.c
--- a/net/ipv4/netfilter/ipt_TOS.c
+++ b/net/ipv4/netfilter/ipt_TOS.c
@@ -46,7 +46,6 @@ target(struct sk_buff **pskb,
 						 sizeof(diffs),
 						 (*pskb)->nh.iph->check
 						 ^0xFFFF));
-		(*pskb)->nfcache |= NFC_ALTERED;
 	}
 	return IPT_CONTINUE;
 }
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -185,19 +185,6 @@ int ip6_route_me_harder(struct sk_buff *
 }
 #endif
 
-static inline int ip6_maybe_reroute(struct sk_buff *skb)
-{
-#ifdef CONFIG_NETFILTER
-	if (skb->nfcache & NFC_ALTERED){
-		if (ip6_route_me_harder(skb) != 0){
-			kfree_skb(skb);
-			return -EINVAL;
-		}
-	}
-#endif /* CONFIG_NETFILTER */
-	return dst_output(skb);
-}
-
 /*
  *	xmit an sk_buff (used by TCP)
  */
@@ -266,7 +253,8 @@ int ip6_xmit(struct sock *sk, struct sk_
 	mtu = dst_mtu(dst);
 	if ((skb->len <= mtu) || ipfragok) {
 		IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
-		return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, ip6_maybe_reroute);
+		return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev,
+				dst_output);
 	}
 
 	if (net_ratelimit())
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -379,7 +379,6 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, st
 	if (!skb_ip_make_writable(&e->skb, v->data_len))
 		return -ENOMEM;
 	memcpy(e->skb->data, v->payload, v->data_len);
-	e->skb->nfcache |= NFC_ALTERED;
 
 	/*
 	 * Extra routing may needed on local out, as the QUEUE target never
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -401,7 +401,6 @@ ip6t_do_table(struct sk_buff **pskb,
 	do {
 		IP_NF_ASSERT(e);
 		IP_NF_ASSERT(back);
-		(*pskb)->nfcache |= e->nfcache;
 		if (ip6_packet_match(*pskb, indev, outdev, &e->ipv6,
 			&protoff, &offset)) {
 			struct ip6t_entry_target *t;
diff --git a/net/ipv6/netfilter/ip6t_MARK.c b/net/ipv6/netfilter/ip6t_MARK.c
--- a/net/ipv6/netfilter/ip6t_MARK.c
+++ b/net/ipv6/netfilter/ip6t_MARK.c
@@ -28,10 +28,9 @@ target(struct sk_buff **pskb,
 {
 	const struct ip6t_mark_target_info *markinfo = targinfo;
 
-	if((*pskb)->nfmark != markinfo->mark) {
+	if((*pskb)->nfmark != markinfo->mark)
 		(*pskb)->nfmark = markinfo->mark;
-		(*pskb)->nfcache |= NFC_ALTERED;
-	}
+
 	return IP6T_CONTINUE;
 }
 
-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [stable] Re: [05/11] SMP fix for 6pack driver
From: Ralf Baechle @ 2005-07-17 21:09 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Greg KH, Francois Romieu, Greg KH, torvalds, akpm,
	Theodore Ts'o, Zwane Mwaikambo, netdev, Justin Forbes,
	linux-kernel, Randy.Dunlap, Chuck Wolber, jgarzik, stable, alan
In-Reply-To: <20050715193556.GB18059@stusta.de>

On Fri, Jul 15, 2005 at 09:35:56PM +0200, Adrian Bunk wrote:

> I do agree with Francois regarding this issue:
> 
> AFAIR, there has been not one 2.6 kernel where this driver was available 
> for SMP kernels.

Eh...  That after all is the raison d'etre for this patch :)

> It's therefore untested which problems might arise with 
> this driver on SMP systems. I'm not arguing against including this 
> driver in 2.6.13, but 2.6.12.3 isn't the right place.

Nonsense.  Most development activity for this stuff happens not on the
internet and you won't be able to follow it unless you're a licensed ham.
I've been circulating things patch since a while and nobody has been unhappy.

> What surprises me most is that you accepted this patch is neither in 
> 2.6.13-rc3 nor in 2.6.13-rc3-mm1. There seems to be either an
> (IMHO unfortunate) change in your policy of what patches to accept,
> or there's a serious problem in your patch review process.

I've sent it to jgarzik so it's somewhere on it's long way there.

  Ralf

^ permalink raw reply

* Software 3000 pout
From: Jesus Milton @ 2005-07-18  0:32 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 110 bytes --]

Hello


We got thousands software at low low price

visit us now

topwinsoft.com




algorithm


^ permalink raw reply

* Re: [PATCH] [SCTP] Fix potential null pointer dereference while handling an icmp error
From: David S. Miller @ 2005-07-18 20:44 UTC (permalink / raw)
  To: sri; +Cc: lksctp-developers, netdev, cdeboys
In-Reply-To: <1121302485.5841.30.camel@w-sridhar2.beaverton.ibm.com>

From: Sridhar Samudrala <sri@us.ibm.com>
Date: Wed, 13 Jul 2005 17:54:45 -0700

> Please apply the following patch which fixes a potential null pointer
> dereference while handling an icmp error in sctp_icmp_* routines. These
> routines assume that we are passing a valid asoc.
> 
> Reported by Charles-Henri de Boysson <cdeboys@stevens.edu>

Applied, thanks Sridhar.

^ permalink raw reply

* Re: [PATCH] convert nfmark and conntrack mark to 32bit
From: David S. Miller @ 2005-07-19  3:29 UTC (permalink / raw)
  To: laforge; +Cc: netdev, netfilter-devel
In-Reply-To: <20050717214223.GA13434@rama.risq.ericsson.ca>

From: Harald Welte <laforge@netfilter.org>
Date: Sun, 17 Jul 2005 23:42:23 +0200

> As discussed at netconf'05, we convert nfmark and conntrack-mark to be
> 32bits even on 64bit architectures. 
> 
> Signed-off-by: Harald Welte <laforge@netfilter.org>

Applied, thanks Harald.

^ permalink raw reply

* Re: [PATCH] reduce netfilte sk_buff enlargement
From: David S. Miller @ 2005-07-19  3:31 UTC (permalink / raw)
  To: laforge; +Cc: netdev, netfilter-devel, wensong
In-Reply-To: <20050717220451.GB13434@rama.risq.ericsson.ca>

From: Harald Welte <laforge@netfilter.org>
Date: Mon, 18 Jul 2005 00:04:51 +0200

> The only real in-tree user of nfcache was IPVS, who only needs a single
> bit.  Unfortunately I couldn't find some other free bit in sk_buff to
> stuff that bit into, so I introduced a separate field for them.  Maybe
> the IPVS guys can resolve that to further save space.

I think we must resolve this one before 2.6.14 goes out, which
gives us a lot of time, but for now I'll eat that one-bit member.

> Initially I wanted to shrink pkt_type to three bits (PACKET_HOST and
> alike are only 6 values defined), but unfortunately the bluetooth code
> overloads pkt_type :(

This also must be cured somehow, that really isn't a clean nor nice
usage of this field.

> - remove all never-implemented 'nfcache' code
> - don't have ipvs code abuse 'nfcache' field. currently get's their own
>   compile-conditional skb->ipvs_property field.  IPVS maintainers can
>   decide to move this bit elswhere, but nfcache needs to die.
> - remove skb->nfcache field to save 4 bytes
> - move skb->nfctinfo into three unused bits to save further 4 bytes
> 
> Signed-off-by: Harald Welte <laforge@netfilter.org>

Applied, thanks Harald.

^ permalink raw reply

* Re: [PATCH] reduce netfilte sk_buff enlargement
From: Jan Engelhardt @ 2005-07-19  7:18 UTC (permalink / raw)
  To: David S. Miller; +Cc: laforge, netdev, netfilter-devel, wensong
In-Reply-To: <20050718.203145.105430424.davem@davemloft.net>


>but for now I'll eat that one-bit member.

What is more important? Being as small as possible using bitfields, or being 
as fast as possible? (Usage of bitfields is some CPU overhead for their 
extraction)

^ permalink raw reply

* Re: [PATCH] reduce netfilte sk_buff enlargement
From: David S. Miller @ 2005-07-19  7:23 UTC (permalink / raw)
  To: jengelh; +Cc: laforge, netdev, netfilter-devel, wensong
In-Reply-To: <Pine.LNX.4.61.0507190916410.15134@yvahk01.tjqt.qr>

From: Jan Engelhardt <jengelh@linux01.gwdg.de>
Date: Tue, 19 Jul 2005 09:18:38 +0200 (MEST)

> >but for now I'll eat that one-bit member.
> 
> What is more important? Being as small as possible using bitfields, or being 
> as fast as possible? (Usage of bitfields is some CPU overhead for their 
> extraction)

I'm conjuring that we can store the state elsewhere, for example
in the SKB ->cb[] control block.  But that requires some verifications.

Memory access overhead dwarfs whatever the cpu has to do to extract
the bits.

^ permalink raw reply

* drop counts
From: P @ 2005-07-19 10:57 UTC (permalink / raw)
  To: 'netdev@oss.sgi.com', e1000-devel

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

I'm confused about the drop count reporting in e1000
nics (and elsewhere). On e1000 nics the on nic rx buffer
drop counts are maintained in "mpc" and the in kernel buffer drops
are maintained in "rnbc".
Note also the e1000 nic does not count mpc in its
rx_packets count (gprc).
In kernel 2.6.11 and before these were mapped to the
kernel statistics like:

packets = gprc
dropped = rnbc
fifo = mpc
missed = mpc

In 2.6.12 this changed to:

packets = gprc
dropped = mpc
fifo = mpc
missed = mpc

Both are wrong I think and
I think it should do (see attached patch):

packets = gprc + mpc
dropped = mpc + rnbc
fifo = rnbc
missed = mpc

I tried to correlate this with the tg3 driver,
but that confused me also as it seems to do:

packets = rx_packets
dropped = equiv of rnbc (maintained by driver)
fifo = ?
missed = ?
errors = rx_errors + rx_discards

cheers,
Pádraig.

[-- Attachment #2: e1000-drops.diff --]
[-- Type: application/x-texinfo, Size: 1248 bytes --]

^ permalink raw reply

* [2.6 patch] VIA_VELOCITY must depend on INET
From: Adrian Bunk @ 2005-07-19 13:55 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linux-kernel

VIA_VELOCITY=y and INET=n results in the following compile error:

<--  snip  -->

...
  LD      .tmp_vmlinux1
drivers/built-in.o: In function `velocity_register_notifier':
via-velocity.c:(.text+0x3462c6): undefined reference to `register_inetaddr_notifier'
drivers/built-in.o: In function `velocity_unregister_notifier':
via-velocity.c:(.text+0x3462d6): undefined reference to `unregister_inetaddr_notifier'
make: *** [.tmp_vmlinux1] Error 1

<--  snip  -->


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.13-rc3-mm1-full/drivers/net/Kconfig.old	2005-07-19 02:11:45.000000000 +0200
+++ linux-2.6.13-rc3-mm1-full/drivers/net/Kconfig	2005-07-19 02:12:09.000000000 +0200
@@ -2016,7 +2016,7 @@
 
 config VIA_VELOCITY
 	tristate "VIA Velocity support"
-	depends on NET_PCI && PCI
+	depends on INET && NET_PCI && PCI
 	select CRC32
 	select CRC_CCITT
 	select MII

^ permalink raw reply

* [2.6 patch] NET_PKTGEN must depend on INET
From: Adrian Bunk @ 2005-07-19 13:55 UTC (permalink / raw)
  To: Robert Olsson; +Cc: jgarzik, netdev, linux-kernel

NET_PKTGEN=y and INET=n results in the following compile error:

<--  snip  -->

...
  LD      .tmp_vmlinux1
net/built-in.o: In function `proc_if_write':
pktgen.c:(.text+0x18ca9): undefined reference to `in_aton'
pktgen.c:(.text+0x19c11): undefined reference to `in_aton'
pktgen.c:(.text+0x19ced): undefined reference to `in_aton'
pktgen.c:(.text+0x19e85): undefined reference to `in_aton'
net/built-in.o: In function `pktgen_setup_inject':
pktgen.c:(.text+0x1a93f): undefined reference to `in_aton'
net/built-in.o:pktgen.c:(.text+0x1a950): more undefined references to `in_aton' follow
make: *** [.tmp_vmlinux1] Error 1

<--  snip  -->


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.13-rc3-mm1-full/net/Kconfig.old	2005-07-19 02:16:32.000000000 +0200
+++ linux-2.6.13-rc3-mm1-full/net/Kconfig	2005-07-19 02:16:57.000000000 +0200
@@ -192,7 +192,7 @@
 
 config NET_PKTGEN
 	tristate "Packet Generator (USE WITH CAUTION)"
-	depends on PROC_FS
+	depends on INET && PROC_FS
 	---help---
 	  This module will inject preconfigured packets, at a configurable
 	  rate, out of a given interface.  It is used for network interface

^ permalink raw reply

* [2.6 patch] BRIDGE_EBT_ARPREPLY must depend on INET
From: Adrian Bunk @ 2005-07-19 13:55 UTC (permalink / raw)
  To: shemminger, coreteam; +Cc: netfilter-devel, bridge, netdev, linux-kernel

BRIDGE_EBT_ARPREPLY=y and INET=n results in the following compile error:

<--  snip  -->

...
  LD      .tmp_vmlinux1
net/built-in.o: In function `ebt_target_reply':
ebt_arpreply.c:(.text+0x68fb9): undefined reference to `arp_send'
make: *** [.tmp_vmlinux1] Error 1

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.13-rc3-mm1-full/net/bridge/netfilter/Kconfig.old	2005-07-19 08:48:41.000000000 +0200
+++ linux-2.6.13-rc3-mm1-full/net/bridge/netfilter/Kconfig	2005-07-19 08:49:20.000000000 +0200
@@ -138,7 +138,7 @@
 #
 config BRIDGE_EBT_ARPREPLY
 	tristate "ebt: arp reply target support"
-	depends on BRIDGE_NF_EBTABLES
+	depends on BRIDGE_NF_EBTABLES && INET
 	help
 	  This option adds the arp reply target, which allows
 	  automatically sending arp replies to arp requests.

^ permalink raw reply

* [2.6 patch] NETCONSOLE must depend on INET
From: Adrian Bunk @ 2005-07-19 18:29 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linux-kernel

NETCONSOLE=y and INET=n results in the following compile error:

<--  snip  -->

...
  LD      .tmp_vmlinux1
net/built-in.o: In function `netpoll_parse_options':
: undefined reference to `in_aton'
net/built-in.o: In function `netpoll_parse_options':
: undefined reference to `in_aton'
make: *** [.tmp_vmlinux1] Error 1

<--  snip  -->


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.13-rc3/drivers/net/Kconfig.old	2005-07-19 19:29:25.000000000 +0200
+++ linux-2.6.13-rc3/drivers/net/Kconfig	2005-07-19 19:29:37.000000000 +0200
@@ -2544,7 +2544,7 @@
 
 config NETCONSOLE
 	tristate "Network console logging support (EXPERIMENTAL)"
-	depends on NETDEVICES && EXPERIMENTAL
+	depends on NETDEVICES && INET && EXPERIMENTAL
 	---help---
 	If you want to log kernel messages over the network, enable this.
 	See <file:Documentation/networking/netconsole.txt> for details.

^ permalink raw reply

* [PATCH 1/8][ATM]: [zatm] eliminate kfree warning (from Tobias Hirning <sskyman@web.de>)
From: chas williams - CONTRACTOR @ 2005-07-19 20:44 UTC (permalink / raw)
  To: netdev; +Cc: davem

please apply to 2.6 -- thanks!

[ATM]: [zatm] eliminate kfree warning (from Tobias Hirning <sskyman@web.de>)

  Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>


---
commit 4932248439d20412610ffaade625cbde0e001e37
tree 35a60e3551f5f1abced8a435238575c488041af6
parent 238921d2cb04eb6dcc2ff5914d555d7dcaa4dfc5
author chas williams <chas@relax.(none)> Wed, 06 Jul 2005 13:10:18 -0400
committer chas williams <chas@relax.(none)> Wed, 06 Jul 2005 13:10:18 -0400

 drivers/atm/zatm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -1339,7 +1339,7 @@ static int __init zatm_start(struct atm_
 	return 0;
     out:
 	for (i = 0; i < NR_MBX; i++)
-		kfree(zatm_dev->mbx_start[i]);
+		kfree(&zatm_dev->mbx_start[i]);
 	kfree(zatm_dev->rx_map);
 	kfree(zatm_dev->tx_map);
 	free_irq(zatm_dev->irq, dev);

^ permalink raw reply

* [PATCH 2/8][ATM]: allow bind() on point-to-multpoint svcs (from Martin Whitaker <martin_whitaker@ntlworld.com>)
From: chas williams - CONTRACTOR @ 2005-07-19 20:45 UTC (permalink / raw)
  To: netdev; +Cc: davem

please apply to 2.6 -- thanks!

[ATM]: allow bind() on point-to-multpoint svcs (from Martin Whitaker <martin_whitaker@ntlworld.com>)

  Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>


---
commit c4029a0d6294a1052353346235320a678add4f41
tree e6de8b582d908c7943242e8725d435f0b1fda20a
parent 73500df545c8763d662192d9749fd8d64209c819
author chas williams <chas@relax.(none)> Tue, 19 Jul 2005 14:50:33 -0400
committer chas williams <chas@relax.(none)> Tue, 19 Jul 2005 14:50:33 -0400

 net/atm/svc.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/net/atm/svc.c b/net/atm/svc.c
--- a/net/atm/svc.c
+++ b/net/atm/svc.c
@@ -118,10 +118,6 @@ static int svc_bind(struct socket *sock,
 		goto out;
 	}
 	vcc = ATM_SD(sock);
-	if (test_bit(ATM_VF_SESSION, &vcc->flags)) {
-		error = -EINVAL;
-		goto out;
-	}
 	addr = (struct sockaddr_atmsvc *) sockaddr;
 	if (addr->sas_family != AF_ATMSVC) {
 		error = -EAFNOSUPPORT;

^ permalink raw reply

* [PATCH 3/8][ATM]: [idt77252] use time_after() macro
From: chas williams - CONTRACTOR @ 2005-07-19 20:45 UTC (permalink / raw)
  To: netdev; +Cc: davem

please apply to 2.6 -- thanks!

[ATM]: [idt77252] use time_after() macro

  Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
  Signed-off-by: Domen Puncer <domen@coderock.org>
  Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>


---
commit ac4755cc8eefb198945e76d4069184454c0819ce
tree e0dc319dca5c9e7f98c5d093c739db07a2707ac7
parent c4029a0d6294a1052353346235320a678add4f41
author chas williams <chas@relax.(none)> Tue, 19 Jul 2005 14:55:40 -0400
committer chas williams <chas@relax.(none)> Tue, 19 Jul 2005 14:55:40 -0400

 drivers/atm/idt77252.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -46,6 +46,7 @@ static char const rcsid[] =
 #include <linux/init.h>
 #include <linux/bitops.h>
 #include <linux/wait.h>
+#include <linux/jiffies.h>
 #include <asm/semaphore.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -780,7 +781,7 @@ push_on_scq(struct idt77252_dev *card, s
 	return 0;
 
 out:
-	if (jiffies - scq->trans_start > HZ) {
+	if (time_after(jiffies, scq->trans_start + HZ)) {
 		printk("%s: Error pushing TBD for %d.%d\n",
 		       card->name, vc->tx_vcc->vpi, vc->tx_vcc->vci);
 #ifdef CONFIG_ATM_IDT77252_DEBUG

^ permalink raw reply

* [PATCH 4/8][ATM]: [he] remove linux/version.h include
From: chas williams - CONTRACTOR @ 2005-07-19 20:45 UTC (permalink / raw)
  To: netdev; +Cc: davem

please apply to 2.6 -- thanks!

[ATM]: [he] remove linux/version.h include

  Signed-off-by: Olaf Hering <olh@suse.de>
  Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>


---
commit 9c893a8cd5716416ee719a57e04e01aeb2c68bd3
tree ae99b267a7f35cec41df7ccdfb9aa3695a3e2b67
parent eefc05048924978c1e28835bf5085c5de2e653d2
author chas williams <chas@relax.(none)> Tue, 19 Jul 2005 15:06:23 -0400
committer chas williams <chas@relax.(none)> Tue, 19 Jul 2005 15:06:23 -0400

 drivers/atm/he.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/atm/he.c b/drivers/atm/he.c
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -57,7 +57,6 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
-#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
 #include <linux/pci.h>

^ permalink raw reply

* [PATCH 5/8][ATM]: [firestream] fix the sparse warning "implicit cast to nocast type"
From: chas williams - CONTRACTOR @ 2005-07-19 20:45 UTC (permalink / raw)
  To: netdev; +Cc: davem

please apply to 2.6 -- thanks!

[ATM]: [firestream] fix the sparse warning "implicit cast to nocast type"

Signed-off-by: Victor Fusco <victor@cetuc.puc-rio.br>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>


---
commit 6e59c9c1673a7b31f00cc8dd79f1e11abf91be9a
tree 962d15261cc88a8b094461689bcc122896508333
parent 9c893a8cd5716416ee719a57e04e01aeb2c68bd3
author chas williams <chas@relax.(none)> Tue, 19 Jul 2005 15:07:01 -0400
committer chas williams <chas@relax.(none)> Tue, 19 Jul 2005 15:07:01 -0400

 drivers/atm/firestream.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1374,7 +1374,8 @@ static void reset_chip (struct fs_dev *d
 	}
 }
 
-static void __devinit *aligned_kmalloc (int size, int flags, int alignment)
+static void __devinit *aligned_kmalloc (int size, unsigned int __nocast flags,
+					int alignment)
 {
 	void  *t;
 
@@ -1464,7 +1465,8 @@ static inline int nr_buffers_in_freepool
    does. I've seen "receive abort: no buffers" and things started
    working again after that...  -- REW */
 
-static void top_off_fp (struct fs_dev *dev, struct freepool *fp, int gfp_flags)
+static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
+			unsigned int __nocast gfp_flags)
 {
 	struct FS_BPENTRY *qe, *ne;
 	struct sk_buff *skb;

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox