* [PATCH 4/6] [6LoWPAN] UDP header compression
From: Alexander Smirnov @ 2011-11-02 16:35 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <20111102162520.GA2669-AUGNqIMGY+bGcXpsla5Oef8+0UxHXcjY@public.gmane.org>
This patch adds support for UDP header compression.
Derived from Contiki OS.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
net/ieee802154/6lowpan.c | 51 ++++++++++++++++++++++++++++++++++++++++++---
net/ieee802154/6lowpan.h | 5 ++++
2 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index c4aae4e..6da3357 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -365,8 +365,6 @@ static int lowpan_header_create(struct sk_buff *skb,
if (hdr->nexthdr == UIP_PROTO_UDP)
iphc0 |= LOWPAN_IPHC_NH_C;
-/* TODO: next header compression */
-
if ((iphc0 & LOWPAN_IPHC_NH_C) == 0) {
*hc06_ptr = hdr->nexthdr;
hc06_ptr += 1;
@@ -454,8 +452,53 @@ static int lowpan_header_create(struct sk_buff *skb,
}
}
- /* TODO: UDP header compression */
- /* TODO: Next Header compression */
+ /* UDP header compression */
+ if (hdr->nexthdr == UIP_PROTO_UDP) {
+ struct udphdr *uh = udp_hdr(skb);
+
+ pr_debug("(%s): UDP header compression\n", __func__);
+
+ if (((uh->source & LOWPAN_NHC_UDP_4BIT_MASK) ==
+ LOWPAN_NHC_UDP_4BIT_PORT) &&
+ ((uh->dest & LOWPAN_NHC_UDP_4BIT_MASK) ==
+ LOWPAN_NHC_UDP_4BIT_PORT)) {
+ pr_debug("(%s): both ports compression to 4 bits\n",
+ __func__);
+ *hc06_ptr = LOWPAN_NHC_UDP_CS_P_11;
+ *(hc06_ptr + 1) = /* subtraction is faster */
+ (u8)((uh->dest - LOWPAN_NHC_UDP_4BIT_PORT) +
+ ((uh->source & LOWPAN_NHC_UDP_4BIT_PORT) << 4));
+ hc06_ptr += 2;
+ } else if ((uh->dest & LOWPAN_NHC_UDP_8BIT_MASK) ==
+ LOWPAN_NHC_UDP_8BIT_PORT) {
+ pr_debug("(%s): remove 8 bits of dest\n", __func__);
+ *hc06_ptr = LOWPAN_NHC_UDP_CS_P_01;
+ memcpy(hc06_ptr + 1, &uh->source, 2);
+ *(hc06_ptr + 3) =
+ (u8)(uh->dest - LOWPAN_NHC_UDP_8BIT_PORT);
+ hc06_ptr += 4;
+ } else if ((uh->source & LOWPAN_NHC_UDP_8BIT_MASK) ==
+ LOWPAN_NHC_UDP_8BIT_PORT) {
+ pr_debug("(%s): remove 8 bits of source\n", __func__);
+ *hc06_ptr = LOWPAN_NHC_UDP_CS_P_10;
+ memcpy(hc06_ptr + 1, &uh->dest, 2);
+ *(hc06_ptr + 3) =
+ (u8)(uh->source - LOWPAN_NHC_UDP_8BIT_PORT);
+ hc06_ptr += 4;
+ } else {
+ pr_debug("(%s): can't compress header\n", __func__);
+ *hc06_ptr = LOWPAN_NHC_UDP_CS_P_00;
+ memcpy(hc06_ptr + 1, &uh->source, 2);
+ memcpy(hc06_ptr + 3, &uh->dest, 2);
+ hc06_ptr += 5;
+ }
+
+ /* checksum is always inline */
+ memcpy(hc06_ptr, &uh->check, 2);
+ hc06_ptr += 2;
+ }
+
+ /* TODO: other NH types support? */
head[0] = iphc0;
head[1] = iphc1;
diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h
index 5d2e5a0..aeff3f3 100644
--- a/net/ieee802154/6lowpan.h
+++ b/net/ieee802154/6lowpan.h
@@ -219,6 +219,11 @@
#define LOWPAN_NHC_UDP_CHECKSUMC 0x04
#define LOWPAN_NHC_UDP_CHECKSUMI 0x00
+#define LOWPAN_NHC_UDP_4BIT_PORT 0xF0B0
+#define LOWPAN_NHC_UDP_4BIT_MASK 0xFFF0
+#define LOWPAN_NHC_UDP_8BIT_PORT 0xF000
+#define LOWPAN_NHC_UDP_8BIT_MASK 0xFF00
+
/* values for port compression, _with checksum_ ie bit 5 set to 0 */
#define LOWPAN_NHC_UDP_CS_P_00 0xF0 /* all inline */
#define LOWPAN_NHC_UDP_CS_P_01 0xF1 /* source 16bit inline,
--
1.7.2.5
------------------------------------------------------------------------------
RSA® Conference 2012
Save $700 by Nov 18
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev1
^ permalink raw reply related
* [PATCH 2/6] [6LoWPAN] disable debugging by default
From: Alexander Smirnov @ 2011-11-02 16:34 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <20111102162520.GA2669-AUGNqIMGY+bGcXpsla5Oef8+0UxHXcjY@public.gmane.org>
This patch disables debug output enabled by default.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
net/ieee802154/6lowpan.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 890ecef..e5709fa 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -50,8 +50,6 @@
* SUCH DAMAGE.
*/
-#define DEBUG
-
#include <linux/bitops.h>
#include <linux/if_arp.h>
#include <linux/module.h>
--
1.7.2.5
------------------------------------------------------------------------------
RSA® Conference 2012
Save $700 by Nov 18
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev1
^ permalink raw reply related
* [PATCH 3/6] [6LoWPAN] set proper netdev flags
From: Alexander Smirnov @ 2011-11-02 16:34 UTC (permalink / raw)
To: davem; +Cc: dbaryshkov, linux-zigbee-devel, netdev, Alexander Smirnov
In-Reply-To: <20111102162520.GA2669@avtobot.cybertron>
This patch fixes settings for device initialization which makes possible to
use NDISC and TCP.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
---
net/ieee802154/6lowpan.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index e5709fa..c4aae4e 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -967,13 +967,12 @@ static void lowpan_setup(struct net_device *dev)
dev->addr_len = IEEE802154_ADDR_LEN;
memset(dev->broadcast, 0xff, IEEE802154_ADDR_LEN);
dev->type = ARPHRD_IEEE802154;
- dev->features = NETIF_F_NO_CSUM;
/* Frame Control + Sequence Number + Address fields + Security Header */
dev->hard_header_len = 2 + 1 + 20 + 14;
dev->needed_tailroom = 2; /* FCS */
dev->mtu = 1281;
dev->tx_queue_len = 0;
- dev->flags = IFF_NOARP | IFF_BROADCAST;
+ dev->flags = IFF_BROADCAST | IFF_MULTICAST;
dev->watchdog_timeo = 0;
dev->netdev_ops = &lowpan_netdev_ops;
--
1.7.2.5
^ permalink raw reply related
* [PATCH 1/6] [6LoWPAN] add fragmentation support
From: Alexander Smirnov @ 2011-11-02 16:32 UTC (permalink / raw)
To: davem; +Cc: dbaryshkov, linux-zigbee-devel, netdev, Alexander Smirnov
In-Reply-To: <20111102162520.GA2669@avtobot.cybertron>
This patch adds support for frame fragmentation.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
---
include/net/ieee802154.h | 6 +
net/ieee802154/6lowpan.c | 254 +++++++++++++++++++++++++++++++++++++++++++++-
net/ieee802154/6lowpan.h | 18 ++++
3 files changed, 274 insertions(+), 4 deletions(-)
diff --git a/include/net/ieee802154.h b/include/net/ieee802154.h
index d52685d..ee59f8b 100644
--- a/include/net/ieee802154.h
+++ b/include/net/ieee802154.h
@@ -21,11 +21,14 @@
* Maxim Gorbachyov <maxim.gorbachev@siemens.com>
* Maxim Osipov <maxim.osipov@siemens.com>
* Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
+ * Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
*/
#ifndef NET_IEEE802154_H
#define NET_IEEE802154_H
+#define IEEE802154_MTU 127
+
#define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */
#define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */
#define IEEE802154_FC_TYPE_ACK 0x2 /* Frame is acknowledgment */
@@ -56,6 +59,9 @@
(((x) & IEEE802154_FC_DAMODE_MASK) >> IEEE802154_FC_DAMODE_SHIFT)
+/* MAC footer size */
+#define IEEE802154_MFR_SIZE 2 /* 2 octets */
+
/* MAC's Command Frames Identifiers */
#define IEEE802154_CMD_ASSOCIATION_REQ 0x01
#define IEEE802154_CMD_ASSOCIATION_RESP 0x02
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 19d6aef..890ecef 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -113,6 +113,20 @@ struct lowpan_dev_record {
struct list_head list;
};
+struct lowpan_fragment {
+ struct sk_buff *skb; /* skb to be assembled */
+ spinlock_t lock; /* concurency lock */
+ u16 length; /* length to be assemled */
+ u32 bytes_rcv; /* bytes received */
+ u16 tag; /* current fragment tag */
+ struct timer_list timer; /* assembling timer */
+ struct list_head list; /* fragments list */
+};
+
+static unsigned short fragment_tag;
+static LIST_HEAD(lowpan_fragments);
+spinlock_t flist_lock;
+
static inline struct
lowpan_dev_info *lowpan_dev_info(const struct net_device *dev)
{
@@ -244,6 +258,17 @@ static u8 lowpan_fetch_skb_u8(struct sk_buff *skb)
return ret;
}
+static u16 lowpan_fetch_skb_u16(struct sk_buff *skb)
+{
+ u16 ret;
+
+ BUG_ON(!pskb_may_pull(skb, 2));
+
+ ret = skb->data[0] | (skb->data[1] << 8);
+ skb_pull(skb, 2);
+ return ret;
+}
+
static int lowpan_header_create(struct sk_buff *skb,
struct net_device *dev,
unsigned short type, const void *_daddr,
@@ -467,6 +492,7 @@ static int lowpan_header_create(struct sk_buff *skb,
memcpy(&(sa.hwaddr), saddr, 8);
mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA;
+
return dev_hard_header(skb, lowpan_dev_info(dev)->real_dev,
type, (void *)&da, (void *)&sa, skb->len);
}
@@ -511,6 +537,21 @@ static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
return stat;
}
+static void lowpan_fragment_timer_expired(unsigned long entry_addr)
+{
+ struct lowpan_fragment *entry = (struct lowpan_fragment *)entry_addr;
+
+ pr_debug("%s: timer expired for frame with tag %d\n", __func__,
+ entry->tag);
+
+ spin_lock(&flist_lock);
+ list_del(&entry->list);
+ spin_unlock(&flist_lock);
+
+ dev_kfree_skb(entry->skb);
+ kfree(entry);
+}
+
static int
lowpan_process_data(struct sk_buff *skb)
{
@@ -525,6 +566,104 @@ lowpan_process_data(struct sk_buff *skb)
if (skb->len < 2)
goto drop;
iphc0 = lowpan_fetch_skb_u8(skb);
+
+ /* fragments assembling */
+ switch (iphc0 & LOWPAN_DISPATCH_MASK) {
+ case LOWPAN_DISPATCH_FRAG1:
+ case LOWPAN_DISPATCH_FRAGN:
+ {
+ struct lowpan_fragment *frame;
+ u8 len, offset;
+ u16 tag;
+
+ len = lowpan_fetch_skb_u8(skb); /* frame length */
+ tag = lowpan_fetch_skb_u16(skb);
+
+ /*
+ * check if frame assembling with the same tag is
+ * already in progress
+ */
+ spin_lock(&flist_lock);
+
+ list_for_each_entry(frame, &lowpan_fragments, list)
+ if (frame->tag == tag)
+ break;
+
+ /* alloc new frame structure */
+ if (frame->tag != tag) {
+ frame = kzalloc(sizeof(struct lowpan_fragment),
+ GFP_ATOMIC);
+ if (!frame)
+ goto drop;
+
+ INIT_LIST_HEAD(&frame->list);
+
+ frame->length = (iphc0 & 7) | (len << 3);
+ frame->tag = tag;
+
+ /* allocate buffer for frame assembling */
+ frame->skb = alloc_skb(frame->length +
+ sizeof(struct ipv6hdr), GFP_ATOMIC);
+
+ frame->skb->priority = skb->priority;
+ frame->skb->dev = skb->dev;
+
+ if (!frame->skb) {
+ kfree(frame);
+ goto drop;
+ }
+
+ /* reserve headroom for uncompressed ipv6 header */
+ skb_reserve(frame->skb, sizeof(struct ipv6hdr));
+ skb_put(frame->skb, frame->length);
+
+ init_timer(&frame->timer);
+ /* time out is the same as for ipv6 - 60 sec */
+ frame->timer.expires = jiffies + LOWPAN_FRAG_TIMEOUT;
+ frame->timer.data = (unsigned long)frame;
+ frame->timer.function = lowpan_fragment_timer_expired;
+
+ add_timer(&frame->timer);
+
+ list_add_tail(&frame->list, &lowpan_fragments);
+ }
+
+ if ((iphc0 & LOWPAN_DISPATCH_MASK) == LOWPAN_DISPATCH_FRAG1)
+ goto drop;
+
+ offset = lowpan_fetch_skb_u8(skb); /* fetch offset */
+
+ /* if payload fits buffer, copy it */
+ if (likely((offset * 8 + skb->len) <= frame->length))
+ skb_copy_to_linear_data_offset(frame->skb, offset * 8,
+ skb->data, skb->len);
+ else
+ goto drop;
+
+ frame->bytes_rcv += skb->len;
+
+ /* frame assembling complete */
+ if ((frame->bytes_rcv == frame->length) &&
+ frame->timer.expires > jiffies) {
+ /* if timer haven't expired - first of all delete it */
+ del_timer(&frame->timer);
+ list_del(&frame->list);
+ spin_unlock(&flist_lock);
+
+ dev_kfree_skb(skb);
+ skb = frame->skb;
+ kfree(frame);
+ iphc0 = lowpan_fetch_skb_u8(skb);
+ break;
+ }
+ spin_unlock(&flist_lock);
+
+ return kfree_skb(skb), 0;
+ }
+ default:
+ break;
+ }
+
iphc1 = lowpan_fetch_skb_u8(skb);
_saddr = mac_cb(skb)->sa.hwaddr;
@@ -692,18 +831,118 @@ static int lowpan_set_address(struct net_device *dev, void *p)
return 0;
}
+static int lowpan_get_mac_header_length(struct sk_buff *skb)
+{
+ /*
+ * Currently long addressing mode is supported only, so the overall
+ * header size is 21:
+ * FC SeqNum DPAN DA SA Sec
+ * 2 + 1 + 2 + 8 + 8 + 0 = 21
+ */
+ return 21;
+}
+
+static int
+lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
+ int mlen, int plen, int offset)
+{
+ struct sk_buff *frag;
+ int hlen, ret;
+
+ /* if payload length is zero, therefore it's a first fragment */
+ hlen = (plen == 0 ? LOWPAN_FRAG1_HEAD_SIZE : LOWPAN_FRAGN_HEAD_SIZE);
+
+ lowpan_raw_dump_inline(__func__, "6lowpan fragment header", head, hlen);
+
+ frag = dev_alloc_skb(hlen + mlen + plen + IEEE802154_MFR_SIZE);
+ if (!frag)
+ return -ENOMEM;
+
+ frag->priority = skb->priority;
+ frag->dev = skb->dev;
+
+ /* copy header, MFR and payload */
+ memcpy(skb_put(frag, mlen), skb->data, mlen);
+ memcpy(skb_put(frag, hlen), head, hlen);
+
+ if (plen)
+ skb_copy_from_linear_data_offset(skb, offset + mlen,
+ skb_put(frag, plen), plen);
+
+ lowpan_raw_dump_table(__func__, " raw fragment dump", frag->data,
+ frag->len);
+
+ ret = dev_queue_xmit(frag);
+
+ if (ret < 0)
+ dev_kfree_skb(frag);
+
+ return ret;
+}
+
+static int
+lowpan_skb_fragmentation(struct sk_buff *skb)
+{
+ int err, header_length, payload_length, tag, offset = 0;
+ u8 head[5];
+
+ header_length = lowpan_get_mac_header_length(skb);
+ payload_length = skb->len - header_length;
+ tag = fragment_tag++;
+
+ /* first fragment header */
+ head[0] = LOWPAN_DISPATCH_FRAG1 | (payload_length & 0x7);
+ head[1] = (payload_length >> 3) & 0xff;
+ head[2] = tag & 0xff;
+ head[3] = tag >> 8;
+
+ err = lowpan_fragment_xmit(skb, head, header_length, 0, 0);
+
+ /* next fragment header */
+ head[0] &= ~LOWPAN_DISPATCH_FRAG1;
+ head[0] |= LOWPAN_DISPATCH_FRAGN;
+
+ while ((payload_length - offset > 0) && (err >= 0)) {
+ int len = LOWPAN_FRAG_SIZE;
+
+ head[4] = offset / 8;
+
+ if (payload_length - offset < len)
+ len = payload_length - offset;
+
+ err = lowpan_fragment_xmit(skb, head, header_length,
+ len, offset);
+ offset += len;
+ }
+
+ return err;
+}
+
static netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *dev)
{
- int err = 0;
+ int err = -1;
pr_debug("(%s): package xmit\n", __func__);
skb->dev = lowpan_dev_info(dev)->real_dev;
if (skb->dev == NULL) {
pr_debug("(%s) ERROR: no real wpan device found\n", __func__);
- dev_kfree_skb(skb);
- } else
+ goto error;
+ }
+
+ if (skb->len <= IEEE802154_MTU) {
err = dev_queue_xmit(skb);
+ goto out;
+ }
+
+ pr_debug("(%s): frame is too big, fragmentation is needed\n",
+ __func__);
+ err = lowpan_skb_fragmentation(skb);
+error:
+ dev_kfree_skb(skb);
+out:
+ if (err < 0)
+ pr_debug("(%s): ERROR: xmit failed\n", __func__);
return (err < 0 ? NETDEV_TX_BUSY : NETDEV_TX_OK);
}
@@ -765,8 +1004,15 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
goto drop;
/* check that it's our buffer */
- if ((skb->data[0] & 0xe0) == 0x60)
+ switch (skb->data[0] & 0xe0) {
+ case LOWPAN_DISPATCH_IPHC: /* ipv6 datagram */
+ case LOWPAN_DISPATCH_FRAG1: /* first fragment header */
+ case LOWPAN_DISPATCH_FRAGN: /* next fragments headers */
lowpan_process_data(skb);
+ break;
+ default:
+ break;
+ }
return NET_RX_SUCCESS;
diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h
index 5d8cf80..5d2e5a0 100644
--- a/net/ieee802154/6lowpan.h
+++ b/net/ieee802154/6lowpan.h
@@ -159,6 +159,24 @@
#define LOWPAN_DISPATCH_FRAG1 0xc0 /* 11000xxx */
#define LOWPAN_DISPATCH_FRAGN 0xe0 /* 11100xxx */
+#define LOWPAN_DISPATCH_MASK 0xf8 /* 11111000 */
+
+#define LOWPAN_FRAG_TIMEOUT (HZ * 60) /* time-out 60 sec */
+
+#define LOWPAN_FRAG1_HEAD_SIZE 0x4
+#define LOWPAN_FRAGN_HEAD_SIZE 0x5
+
+/*
+ * According IEEE802.15.4 standard:
+ * - MTU is 127 octets
+ * - maximum MHR size is 37 octets
+ * - MFR size is 2 octets
+ *
+ * so minimal payload size that we may guarantee is:
+ * MTU - MHR - MFR = 88 octets
+ */
+#define LOWPAN_FRAG_SIZE 88
+
/*
* Values of fields within the IPHC encoding first byte
* (C stands for compressed and I for inline)
--
1.7.2.5
^ permalink raw reply related
* [PATCH series][6LoWPAN]
From: Alexander Smirnov @ 2011-11-02 16:25 UTC (permalink / raw)
To: davem, dbaryshkov
Cc: linux-zigbee-devel, alex.bluesman.smirnov, netdev, jonsmirl
Hello all,
The following patch series adds both major feature and minor fixes.
Please find detailed description in each of the patches.
Just to summarize current development status:
By using MAC and PHY layers support from
"http://sourceforge.net/projects/linux-zigbee"
project now it's possible to run generic network applications (ssh, iperf) over
ieee802.15.4 network.
iperf shows about ~40Kbits/sec for TCP :-)
With best regards,
Alexander
^ permalink raw reply
* Re: [PATCH] IPv6 - support for NLM_F_* flags at IPv6 routing requests
From: Stephen Hemminger @ 2011-11-02 16:21 UTC (permalink / raw)
To: Matti Vaittinen; +Cc: davem, netdev
In-Reply-To: <1320217791.12052.12.camel@lakki>
On Wed, 02 Nov 2011 09:09:51 +0200
Matti Vaittinen <matti.vaittinen@nsn.com> wrote:
> On Tue, 2011-11-01 at 16:27 +0200, Matti Vaittinen wrote:
> > Hi dee Ho again.
> >
> > Here's the support for NLM_F_* flags at IPv6 routing requests once again.
> >
> > This time if no NLM_F_CREATE flag is not defined for RTM_NEWROUTE request,
> > warning is printed, but no error is returned. Instead new route is added.
> >
> > Exception is when NLM_F_REPLACE flag is given without NLM_F_CREATE, and
> > no matching route is found. In this case it should be safe to assume
> > that the request issuer is familiar with NLM_F_* flags, and does really
> > not want route to be created.
> >
> > Specifying NLM_F_REPLACE flag will now make the kernel to search for
> > matching route, and replace it with new one. If no route is found and
> > NLM_F_CREATE is specified as well, then new route is created.
> >
> > Also, specifying NLM_F_EXCL will yield returning of error if matching route
> > is found.
> >
> > Patch is created against linux-3.1-rc4
> >
>
> New patch where the definition of new error is removed as Stephen suggested.
>
> Signed-off-by: Matti Vaittinen <Mazziesaccount@gmail.com>
> ---
> diff -uNr linux-3.1-rc4.orig/net/ipv6/ip6_fib.c linux-3.1-rc4.new/net/ipv6/ip6_fib.c
> --- linux-3.1-rc4.orig/net/ipv6/ip6_fib.c 2011-11-01 14:01:55.000000000 +0200
> +++ linux-3.1-rc4.new/net/ipv6/ip6_fib.c 2011-11-02 08:37:21.000000000 +0200
> @@ -429,17 +429,34 @@
>
> static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
> int addrlen, int plen,
> - int offset)
> + int offset, struct nl_info *info)
> {
> struct fib6_node *fn, *in, *ln;
> struct fib6_node *pn = NULL;
> struct rt6key *key;
> int bit;
> +
> +
Gratuitous unnecessary whitespace added.
> + int allow_create = 1;
> + int replace_required = 0;
> +
> +
Personally, I dislike boolean flag variables, it is often a sign
of poorly executed logic flow
> __be32 dir = 0;
> __u32 sernum = fib6_new_sernum();
>
> RT6_TRACE("fib6_add_1\n");
>
> + if (NULL != info &&
> + NULL != info->nlh &&
> + (info->nlh->nlmsg_flags&NLM_F_REPLACE)) {
> + replace_required = 1;
> + }
> + if (NULL != info &&
> + NULL != info->nlh &&
> + !(info->nlh->nlmsg_flags&NLM_F_CREATE)) {
> + allow_create = 0;
> + }
I would move the flag calculation out to the caller and keep fib6_add_1
clean.
> /* insert node in tree */
>
> fn = root;
> @@ -451,8 +468,12 @@
> * Prefix match
> */
> if (plen < fn->fn_bit ||
> - !ipv6_prefix_equal(&key->addr, addr, fn->fn_bit))
> + !ipv6_prefix_equal(&key->addr, addr, fn->fn_bit)) {
> + if (!allow_create)
> + printk(KERN_WARNING
> + "NLM_F_CREATE should be specified when creating new rt\n");
> goto insert_above;
> + }
>
> /*
> * Exact match ?
> @@ -481,10 +502,27 @@
> fn = dir ? fn->right: fn->left;
> } while (fn);
>
> +
> + if (replace_required && !allow_create) {
> + /* We should not create new node because
> + * NLM_F_REPLACE was specified without NLM_F_CREATE
> + * I assume it is safe to require NLM_F_CREATE when
> + * REPLACE flag is used! Later we may want to remove the
> + * check for replace_required, because according
> + * to netlink specification, NLM_F_CREATE
> + * MUST be specified if new route is created.
> + * That would keep IPv6 consistent with IPv4
> + */
> + printk(KERN_WARNING
> + "NLM_F_CREATE should be specified when creating new rt - ignoring request\n");
> + return ERR_PTR(-ENOENT);
> + }
> /*
> * We walked to the bottom of tree.
> * Create new leaf node without children.
> */
> + if (!allow_create)
> + printk(KERN_WARNING "NLM_F_CREATE should be specified when creating new rt\n");
>
> ln = node_alloc();
>
> @@ -567,7 +605,6 @@
> fn->parent = in;
>
> ln->fn_sernum = sernum;
> -
> if (addr_bit_set(addr, bit)) {
> in->right = ln;
> in->left = fn;
Useless whitespace changes should not be part of the patch.
> @@ -585,6 +622,7 @@
>
> ln = node_alloc();
>
> +
> if (ln == NULL)
> return NULL;
More useless changes
> @@ -618,6 +656,12 @@
> {
> struct rt6_info *iter = NULL;
> struct rt6_info **ins;
> + int replace = (NULL != info &&
> + NULL != info->nlh &&
> + (info->nlh->nlmsg_flags&NLM_F_REPLACE));
> + int add = ((NULL == info || NULL == info->nlh) ||
> + (info->nlh->nlmsg_flags&NLM_F_CREATE));
> + int found = 0;
>
> ins = &fn->leaf;
>
> @@ -630,6 +674,13 @@
> /*
> * Same priority level
> */
> + if (NULL != info->nlh &&
> + (info->nlh->nlmsg_flags&NLM_F_EXCL))
> + return -EEXIST;
> + if (replace) {
> + found++;
> + break;
> + }
>
> if (iter->rt6i_dev == rt->rt6i_dev &&
> iter->rt6i_idev == rt->rt6i_idev &&
> @@ -659,19 +710,41 @@
> /*
> * insert node
> */
> + if (!replace) {
> + if (!add)
> + printk(KERN_WARNING "NLM_F_CREATE should be specified when creating new rt\n");
> +
> +add:
> + rt->dst.rt6_next = iter;
> + *ins = rt;
> + rt->rt6i_node = fn;
> + atomic_inc(&rt->rt6i_ref);
> + inet6_rt_notify(RTM_NEWROUTE, rt, info);
> + info->nl_net->ipv6.rt6_stats->fib_rt_entries++;
> +
> + if ((fn->fn_flags & RTN_RTINFO) == 0) {
> + info->nl_net->ipv6.rt6_stats->fib_route_nodes++;
> + fn->fn_flags |= RTN_RTINFO;
> + }
>
> - rt->dst.rt6_next = iter;
> - *ins = rt;
> - rt->rt6i_node = fn;
> - atomic_inc(&rt->rt6i_ref);
> - inet6_rt_notify(RTM_NEWROUTE, rt, info);
> - info->nl_net->ipv6.rt6_stats->fib_rt_entries++;
> -
> - if ((fn->fn_flags & RTN_RTINFO) == 0) {
> - info->nl_net->ipv6.rt6_stats->fib_route_nodes++;
> - fn->fn_flags |= RTN_RTINFO;
> + } else {
> + if (!found) {
> + if (add)
> + goto add;
> + printk(KERN_WARNING "add rtinfo to node - NLM_F_REPLACE specified, but no existing node found! bailing out\n");
> + return -ENOENT;
> + }
> + *ins = rt;
> + rt->rt6i_node = fn;
> + rt->dst.rt6_next = iter->dst.rt6_next;
> + atomic_inc(&rt->rt6i_ref);
> + inet6_rt_notify(RTM_NEWROUTE, rt, info);
> + rt6_release(iter);
> + if ((fn->fn_flags & RTN_RTINFO) == 0) {
> + info->nl_net->ipv6.rt6_stats->fib_route_nodes++;
> + fn->fn_flags |= RTN_RTINFO;
> + }
> }
> -
> return 0;
> }
>
> @@ -700,10 +773,29 @@
> {
> struct fib6_node *fn, *pn = NULL;
> int err = -ENOMEM;
> + int allow_create = 1;
> + int allow_replace = 1;
> + if (NULL != info &&
> + NULL != info->nlh &&
> + !(info->nlh->nlmsg_flags&NLM_F_REPLACE)) {
> + allow_replace = 0;
> + }
> + if (NULL != info &&
> + NULL != info->nlh &&
> + !(info->nlh->nlmsg_flags&NLM_F_CREATE)) {
> + allow_create = 0;
> + }
> + if (!allow_create && !allow_replace)
> + printk(KERN_WARNING "RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n");
>
> fn = fib6_add_1(root, &rt->rt6i_dst.addr, sizeof(struct in6_addr),
> - rt->rt6i_dst.plen, offsetof(struct rt6_info, rt6i_dst));
> + rt->rt6i_dst.plen, offsetof(struct rt6_info, rt6i_dst),
> + info);
>
> + if (-ENOENT == PTR_ERR(fn)) {
> + err = -EINVAL;
> + fn = NULL;
> + }
> if (fn == NULL)
> goto out;
>
> @@ -716,6 +808,8 @@
> if (fn->subtree == NULL) {
> struct fib6_node *sfn;
>
> + if (!allow_create)
> + printk(KERN_WARNING "NLM_F_CREATE should be specified when creating new rt\n");
> /*
> * Create subtree.
> *
> @@ -740,7 +834,8 @@
>
> sn = fib6_add_1(sfn, &rt->rt6i_src.addr,
> sizeof(struct in6_addr), rt->rt6i_src.plen,
> - offsetof(struct rt6_info, rt6i_src));
> + offsetof(struct rt6_info, rt6i_src),
> + info);
>
> if (sn == NULL) {
> /* If it is failed, discard just allocated
> @@ -757,8 +852,13 @@
> } else {
> sn = fib6_add_1(fn->subtree, &rt->rt6i_src.addr,
> sizeof(struct in6_addr), rt->rt6i_src.plen,
> - offsetof(struct rt6_info, rt6i_src));
> + offsetof(struct rt6_info, rt6i_src),
> + info);
>
> + if (-ENOENT == PTR_ERR(sn)) {
> + err = -EINVAL;
This is not how to use PTR_ERR; the more common convention is:
if (IS_ERR(sn)) {
err = PTR_ERR(sn);
...
> + sn = NULL;
> + }
> if (sn == NULL)
> goto st_failure;
> }
> diff -uNr linux-3.1-rc4.orig/net/ipv6/route.c linux-3.1-rc4.new/net/ipv6/route.c
> --- linux-3.1-rc4.orig/net/ipv6/route.c 2011-11-01 14:01:55.000000000 +0200
> +++ linux-3.1-rc4.new/net/ipv6/route.c 2011-10-27 10:45:05.000000000 +0300
> @@ -1223,9 +1223,18 @@
> if (cfg->fc_metric == 0)
> cfg->fc_metric = IP6_RT_PRIO_USER;
>
> - table = fib6_new_table(net, cfg->fc_table);
> + err = -ENOBUFS;
> + if (NULL != cfg->fc_nlinfo.nlh &&
> + !(cfg->fc_nlinfo.nlh->nlmsg_flags&NLM_F_CREATE)) {
> + table = fib6_get_table(net, cfg->fc_table);
> + if (table == NULL) {
> + printk(KERN_WARNING "NLM_F_CREATE should be specified when creating new rt\n");
> + table = fib6_new_table(net, cfg->fc_table);
> + }
> + } else {
> + table = fib6_new_table(net, cfg->fc_table);
> + }
> if (table == NULL) {
> - err = -ENOBUFS;
> goto out;
> }
This could be a separate patch
^ permalink raw reply
* Re: PROBLEM: pppol2tp over pppoe NULL pointer dereference
From: Jorge Boncompte [DTI2] @ 2011-11-02 15:54 UTC (permalink / raw)
To: eric.dumazet; +Cc: Misha Labjuk, netdev
In-Reply-To: <1320217652.30178.1.camel@edumazet-laptop>
El 02/11/2011 8:07, Eric Dumazet escribió:
> Le mercredi 02 novembre 2011 à 09:04 +0400, Misha Labjuk a écrit :
>> 2011/11/2 Eric Dumazet <eric.dumazet@gmail.com>:
>>>
>>> On what kind of NIC this is happening ?
>>>
>>
>> Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit
>> Ethernet controller (rev 02)
>> Kernel driver in use: r8169
>
> OK thanks, could you try the following patch as well ?
>
> If we release reorder_q.lock, we must not keep a dangling pointer (tmp)
> and restart the whole loop.
>
> diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
> index 34b2dde..bf8d50c 100644
> --- a/net/l2tp/l2tp_core.c
> +++ b/net/l2tp/l2tp_core.c
> @@ -397,6 +397,7 @@ static void l2tp_recv_dequeue(struct l2tp_session *session)
> * expect to send up next, dequeue it and any other
> * in-sequence packets behind it.
> */
> +start:
> spin_lock_bh(&session->reorder_q.lock);
> skb_queue_walk_safe(&session->reorder_q, skb, tmp) {
> if (time_after(jiffies, L2TP_SKB_CB(skb)->expires)) {
> @@ -433,7 +434,7 @@ static void l2tp_recv_dequeue(struct l2tp_session *session)
> */
> spin_unlock_bh(&session->reorder_q.lock);
> l2tp_recv_dequeue_skb(session, skb);
> - spin_lock_bh(&session->reorder_q.lock);
> + goto start;
> }
>
> out:
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
I've been using this same exact patch on an old kernel since a while ago. I had
one system that crashed here, now decommissioned. After some testing I was
unable to reproduce the bug in another systems but on the one that exhibited the
problem it fixed the crashes.
Regards,
Jorge
--
==============================================================
Jorge Boncompte - Ingenieria y Gestion de RED
DTI2 - Desarrollo de la Tecnologia de las Comunicaciones
--------------------------------------------------------------
C/ Abogado Enriquez Barrios, 5 14004 CORDOBA (SPAIN)
Tlf: +34 957 761395 / FAX: +34 957 450380
==============================================================
- There is only so much duct tape you can put on something
before it just becomes a giant ball of duct tape.
==============================================================
^ permalink raw reply
* Re: [LARTC] LARTC mailing list
From: Jan Engelhardt @ 2011-11-02 15:43 UTC (permalink / raw)
To: Andrew Beverley
Cc: Linux Advanced Routing & Traffic Control project,
linux-new-lists, netfilter, netdev
In-Reply-To: <1319292634.26402.6302.camel@andybev-desktop>
On Saturday 2011-10-22 16:10, Andrew Beverley wrote:
>On Sat, 2011-10-22 at 15:03 +0200, Niccolò Belli wrote:
>> Is someone still interested to bring LARTC to a new life?
>> I'm sorry for the subscription but the list didn't work anymore and it
>> was unfeasible to CC 30+ addresses. Let me know if you want to
>> unsubscribe and you don't know how to.
>
>Thanks for doing this Niccolo. However, I'd rather see it hosted at
>vger.kernel.org for all the reasons previously outlined.
>
>I was actually going to suggest a new list called net-users instead.
>There is netdev, netfilter-devel and netfilter, but not a general
>networking users list.
>
>User questions do get asked on netdev, and some non-netfilter questions
>get asked on the netfilter list, but it would seem sensible to have a
>general networking users list that would include LARTC questions.
>
>Comments anyone?
Might as well just go to netfilter for now, it's not like as if the
traffic was as much as linux-kernel.
^ permalink raw reply
* Re: Subnet router anycast for FE80/10 ?
From: David Lamparter @ 2011-11-02 15:38 UTC (permalink / raw)
To: Andreas Hofmeister; +Cc: netdev
In-Reply-To: <4EAF0391.80907@collax.com>
On Mon, Oct 31, 2011 at 09:22:41PM +0100, Andreas Hofmeister wrote:
> I noticed that once forwarding has been enabled on an interface, there
> is a "subnet router anycast address" for the link-local address prefix
> FE80/10.
(Please note that it is fe80::/64 is used, not /10)
> This address seems not to be explicitly mentioned in any RFC, but RFC
> 4291 says "All routers are required to support the Subnet-Router anycast
> addresses for the subnets to which they have interfaces."
That this directly contradicts RFC 2526 which specifies the
subnet-router anycast address to be either ::ffff:ffff:ffff:ff80 or
::fcff:ffff:ffff:ff80 depending on the phase of the moon (well,
interface type actually, but same thing. Also, the /64 <> /10
distinction would matter here.)
For even more confusion, look at
http://www.iana.org/assignments/ipv6-anycast-addresses/ipv6-anycast-addresses.xml
but the only point why I'm mentioning this at all is that if someone
implemented this, they might've noticed the colliding specifications,
and there would be an Errata.
> In the sense that a Linux router actually has an address FE80/10 on each
> ipv6 enabled interface, it seems to be correct to also have FE80:: as an
> anycast address on all interfaces which have ipv6 and forwarding enabled.
>
> But then, FE80/10 is not actually supposed to be routed at all and so a
> router cannot not really be a router for that particular subnet ?
This question isn't really relevant, because...
> Or is "FE80::" just supposed to be the anycast equivalent for the "all
> routers" multicast address ff02::2 ?
... it's actually fairly hard to implement this at all. The idea of
"Anycast" is that even if you have 1000 routers, only one router will
receive the packet. The network is supposed to magically take care of
that, but in reality this only works with Layer 3/IPv6 routing.
So, if you're /actually on/ the subnet yourself, the RFC
- either expects the ethernet switch to implement anycast (...)
- or implies the need for some anycast resolution protocol
(which is possible of course, but there would first need to actually
/be/ some such protocol; while some quick googling tells me such
things exist, they certainly belong in the esoterics drawer).
... which turns this entire thing into a really bad joke.
I would recommend forgetting that these anycast addresses exist at all.
If you need to reach a local on-subnet router, just use ff02::2 and
randomly pick one that answers.
-David
^ permalink raw reply
* Re: hiberante hangs TCP Re: [EXAMPLE CODE] Parasite thread injection and TCP connection hijacking
From: Tejun Heo @ 2011-11-02 15:10 UTC (permalink / raw)
To: MyungJoo Ham; +Cc: netdev, linux-pm, David Fries, linux-kernel
In-Reply-To: <CAJ0PZbSRX6Rqn5NnnMkVGrPovtSuc2NWasysOYnjr3j9rON1VQ@mail.gmail.com>
Hello,
On Wed, Nov 02, 2011 at 06:44:31PM +0900, MyungJoo Ham wrote:
> > Hmmm... sounds like taking down network interfaces before starting
> > hibernation sequence should be enough, which shouldn't be too
> > difficult to implement from userland. Rafael, what do you think?
> >
> > Thanks.
>
> Um... it seems that the "thaw" callbacks of network interfaces or TCP
> should do something on this.
>
> Probably, the "thaw" callbacks should make sure that the TCP
> connections are closed?
I don't think it's a good idea to diddle with TCP connections from
that layer. From what I understand, it seem all we need is plugging
tx/rx while preparing for hibernation. That shouldn't be too
difficult.
Thanks.
--
tejun
^ permalink raw reply
* [PATCH] ll_temac: Add support for phy_mii_ioctl
From: Ricardo Ribalda Delgado @ 2011-11-02 13:14 UTC (permalink / raw)
To: davem, ian.campbell, eric.dumazet, jeffrey.t.kirsher, jpirko,
netdev, linux-kernel
Cc: Ricardo Ribalda Delgado
This patch enables the ioctl support for the driver. So userspace
programs like mii-tool can work.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
drivers/net/ethernet/xilinx/ll_temac_main.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 4d1658e..b26e5ee 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -915,12 +915,26 @@ temac_poll_controller(struct net_device *ndev)
}
#endif
+static int temac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
+{
+ struct temac_local *lp = netdev_priv(ndev);
+
+ if (!netif_running(ndev))
+ return -EINVAL;
+
+ if (!lp->phy_dev)
+ return -EINVAL;
+
+ return phy_mii_ioctl(lp->phy_dev, rq, cmd);
+}
+
static const struct net_device_ops temac_netdev_ops = {
.ndo_open = temac_open,
.ndo_stop = temac_stop,
.ndo_start_xmit = temac_start_xmit,
.ndo_set_mac_address = netdev_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
+ .ndo_do_ioctl = temac_ioctl,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = temac_poll_controller,
#endif
--
1.7.7.1
^ permalink raw reply related
* RE: bnx2x kerneloops
From: Carlos Peón Costa @ 2011-11-02 11:59 UTC (permalink / raw)
To: dmitry; +Cc: netdev
In-Reply-To: <1320234845.2688.3.camel@lb-tlvb-dmitry>
Hi, It's a HP BL460c G6.
Regards.
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM57711E 10-Gigabit PCIe Subsystem: Hewlett-Packard Company NC532i Dual Port 10GbE Multifunction BL-C Adapter Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0, Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 28 Region 0: Memory at fb000000 (64-bit, non-prefetchable) [size=8M] Region 2: Memory at fa800000 (64-bit, non-prefetchable) [size=8M] [virtual] Expansion ROM at e4000000 [disabled] [size=64K] Capabilities: [48] Power Management version 3 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+) Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=1 PME- Capabilities: [50] Vital Product Data Product Name: HP_NC532i_DP_10GbE_Multifunction_BL-c_Adapter Read-only fields: [PN] Part number: N/A [EC] Engineering changes: N/A [SN] Serial number: 0123456789 [MN] Manufacture ID: 31 34 65 34 [RV] Reserved: checksum good, 39 byte(s) reserved End Capabilities: [58] MSI: Enable- Count=1/8 Maskable- 64bit+ Address: 0000000000000000 Data: 0000 Capabilities: [a0] MSI-X: Enable+ Count=17 Masked- Vector table: BAR=0 offset=00440000 PBA: BAR=0 offset=00441800 Capabilities: [ac] Express (v2) Endpoint, MSI 00 DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s <1us, L1 <2us ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+ Unsupported- RlxdOrd+ ExtTag- PhantFunc- AuxPwr+ NoSnoop+ MaxPayload 256 bytes, MaxReadReq 4096 bytes DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend- LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s L1, Latency L0 <4us, L1 <4us ClockPM- Surprise- LLActRep- BwNot- LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk- ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt- LnkSta: Speed 5GT/s, Width x4, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt- DevCap2: Completion Timeout: Range ABCD, TimeoutDis+ DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-, Selectable De-emphasis: -6dB Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS- Compliance De-emphasis: -6dB LnkSta2: Current De-emphasis Level: -6dB Capabilities: [100] Device Serial Number d8-d3-85-ff-fe-59-86-48 Capabilities: [110] Advanced Error Reporting UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol- UESvrt: DLP- SDES+ TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr- CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr- AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn- Capabilities: [150] Power Budgeting <?> Capabilities: [160] Virtual Channel <?> Kernel driver in use: bnx2x Kernel modules: bnx2x
----------------------------------------
> Subject: Re: bnx2x kerneloops
> From: dmitry@broadcom.com
> To: carlospeon@hotmail.com
> CC: netdev@vger.kernel.org
> Date: Wed, 2 Nov 2011 13:54:05 +0200
>
> Which HW you are using?
^ permalink raw reply
* Re: bnx2x kerneloops
From: Dmitry Kravkov @ 2011-11-02 11:54 UTC (permalink / raw)
To: Carlos Peón Costa; +Cc: netdev@vger.kernel.org
In-Reply-To: <SNT113-W64251CF45774789989C835DBD40@phx.gbl>
On Wed, 2011-11-02 at 04:04 -0700, Carlos Peón Costa wrote:
> Hello, can anybody help to debug this issue?
> Thanks.
Which HW you are using?
> kernel 2.6.32-131.17.1.el6.x86_64 (RH 6.1)
This is not "GA" kernel for RHEL6.1, do your know if bnx2x sources
differs from 2.6.32-131.0.15?
^ permalink raw reply
* [PATCH RESEND 01/18] MIPS: Alchemy: remove PB1000 support
From: Manuel Lauss @ 2011-11-02 11:53 UTC (permalink / raw)
To: Linux-MIPS, Ralf Baechle; +Cc: Manuel Lauss, netdev, linux-pcmcia
In-Reply-To: <1320174224-27305-2-git-send-email-manuel.lauss@googlemail.com>
Noone seems to have test hardware or care anymore. Drop PB1000 support
and along with it the old Alchemy PCMCIA socket driver.
Cc: netdev@vger.kernel.org
Cc: linux-pcmcia@lists.infradead.org
Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
---
Resend with CC's added as requested by Ralf.
Cc'ing netdev for IrDA driver parts and pcmcia for the socket driver
removal.
arch/mips/alchemy/Kconfig | 9 -
arch/mips/alchemy/Platform | 7 -
arch/mips/alchemy/common/irq.c | 11 -
arch/mips/alchemy/devboards/Makefile | 1 -
arch/mips/alchemy/devboards/pb1000/Makefile | 8 -
arch/mips/alchemy/devboards/pb1000/board_setup.c | 209 ---------
arch/mips/alchemy/devboards/prom.c | 2 +-
arch/mips/include/asm/mach-pb1x00/pb1000.h | 87 ----
drivers/net/irda/au1k_ir.c | 5 +-
drivers/pcmcia/Kconfig | 4 -
drivers/pcmcia/Makefile | 4 -
drivers/pcmcia/au1000_generic.c | 545 ----------------------
drivers/pcmcia/au1000_generic.h | 135 ------
drivers/pcmcia/au1000_pb1x00.c | 294 ------------
14 files changed, 2 insertions(+), 1319 deletions(-)
delete mode 100644 arch/mips/alchemy/devboards/pb1000/Makefile
delete mode 100644 arch/mips/alchemy/devboards/pb1000/board_setup.c
delete mode 100644 arch/mips/include/asm/mach-pb1x00/pb1000.h
delete mode 100644 drivers/pcmcia/au1000_generic.c
delete mode 100644 drivers/pcmcia/au1000_generic.h
delete mode 100644 drivers/pcmcia/au1000_pb1x00.c
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig
index 2a68be6..5a48387 100644
--- a/arch/mips/alchemy/Kconfig
+++ b/arch/mips/alchemy/Kconfig
@@ -78,15 +78,6 @@ config MIPS_MIRAGE
select SYS_SUPPORTS_LITTLE_ENDIAN
select SYS_HAS_EARLY_PRINTK
-config MIPS_PB1000
- bool "Alchemy PB1000 board"
- select ALCHEMY_GPIOINT_AU1000
- select DMA_NONCOHERENT
- select HW_HAS_PCI
- select SWAP_IO_SPACE
- select SYS_SUPPORTS_LITTLE_ENDIAN
- select SYS_HAS_EARLY_PRINTK
-
config MIPS_PB1100
bool "Alchemy PB1100 board"
select ALCHEMY_GPIOINT_AU1000
diff --git a/arch/mips/alchemy/Platform b/arch/mips/alchemy/Platform
index 96e9e41..4e07967 100644
--- a/arch/mips/alchemy/Platform
+++ b/arch/mips/alchemy/Platform
@@ -5,13 +5,6 @@ platform-$(CONFIG_MIPS_ALCHEMY) += alchemy/common/
#
-# AMD Alchemy Pb1000 eval board
-#
-platform-$(CONFIG_MIPS_PB1000) += alchemy/devboards/
-cflags-$(CONFIG_MIPS_PB1000) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00
-load-$(CONFIG_MIPS_PB1000) += 0xffffffff80100000
-
-#
# AMD Alchemy Pb1100 eval board
#
platform-$(CONFIG_MIPS_PB1100) += alchemy/devboards/
diff --git a/arch/mips/alchemy/common/irq.c b/arch/mips/alchemy/common/irq.c
index 8b60ba0..2a94a64 100644
--- a/arch/mips/alchemy/common/irq.c
+++ b/arch/mips/alchemy/common/irq.c
@@ -35,9 +35,6 @@
#include <asm/irq_cpu.h>
#include <asm/mipsregs.h>
#include <asm/mach-au1x00/au1000.h>
-#ifdef CONFIG_MIPS_PB1000
-#include <asm/mach-pb1x00/pb1000.h>
-#endif
/* Interrupt Controller register offsets */
#define IC_CFG0RD 0x40
@@ -265,14 +262,6 @@ static void au1x_ic1_unmask(struct irq_data *d)
__raw_writel(1 << bit, base + IC_MASKSET);
__raw_writel(1 << bit, base + IC_WAKESET);
-
-/* very hacky. does the pb1000 cpld auto-disable this int?
- * nowhere in the current kernel sources is it disabled. --mlau
- */
-#if defined(CONFIG_MIPS_PB1000)
- if (d->irq == AU1000_GPIO15_INT)
- __raw_writel(0x4000, (void __iomem *)PB1000_MDR); /* enable int */
-#endif
wmb();
}
diff --git a/arch/mips/alchemy/devboards/Makefile b/arch/mips/alchemy/devboards/Makefile
index 826449c..bea80d7 100644
--- a/arch/mips/alchemy/devboards/Makefile
+++ b/arch/mips/alchemy/devboards/Makefile
@@ -4,7 +4,6 @@
obj-y += prom.o bcsr.o platform.o
obj-$(CONFIG_PM) += pm.o
-obj-$(CONFIG_MIPS_PB1000) += pb1000/
obj-$(CONFIG_MIPS_PB1100) += pb1100/
obj-$(CONFIG_MIPS_PB1200) += pb1200/
obj-$(CONFIG_MIPS_PB1500) += pb1500/
diff --git a/arch/mips/alchemy/devboards/pb1000/Makefile b/arch/mips/alchemy/devboards/pb1000/Makefile
deleted file mode 100644
index 97c6615..0000000
--- a/arch/mips/alchemy/devboards/pb1000/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Copyright 2000, 2008 MontaVista Software Inc.
-# Author: MontaVista Software, Inc. <source@mvista.com>
-#
-# Makefile for the Alchemy Semiconductor Pb1000 board.
-#
-
-obj-y := board_setup.o
diff --git a/arch/mips/alchemy/devboards/pb1000/board_setup.c b/arch/mips/alchemy/devboards/pb1000/board_setup.c
deleted file mode 100644
index e64fdcb..0000000
--- a/arch/mips/alchemy/devboards/pb1000/board_setup.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright 2000, 2008 MontaVista Software Inc.
- * Author: MontaVista Software, Inc. <source@mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/delay.h>
-#include <linux/gpio.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/pm.h>
-#include <asm/mach-au1x00/au1000.h>
-#include <asm/mach-pb1x00/pb1000.h>
-#include <asm/reboot.h>
-#include <prom.h>
-
-#include "../platform.h"
-
-const char *get_system_type(void)
-{
- return "Alchemy Pb1000";
-}
-
-static void board_reset(char *c)
-{
- asm volatile ("jr %0" : : "r" (0xbfc00000));
-}
-
-static void board_power_off(void)
-{
- while (1)
- asm volatile (
- " .set mips32 \n"
- " wait \n"
- " .set mips0 \n");
-}
-
-void __init board_setup(void)
-{
- u32 pin_func, static_cfg0;
- u32 sys_freqctrl, sys_clksrc;
- u32 prid = read_c0_prid();
-
- sys_freqctrl = 0;
- sys_clksrc = 0;
-
- /* Set AUX clock to 12 MHz * 8 = 96 MHz */
- au_writel(8, SYS_AUXPLL);
- alchemy_gpio1_input_enable();
- udelay(100);
-
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
- /* Zero and disable FREQ2 */
- sys_freqctrl = au_readl(SYS_FREQCTRL0);
- sys_freqctrl &= ~0xFFF00000;
- au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
- /* Zero and disable USBH/USBD clocks */
- sys_clksrc = au_readl(SYS_CLKSRC);
- sys_clksrc &= ~(SYS_CS_CUD | SYS_CS_DUD | SYS_CS_MUD_MASK |
- SYS_CS_CUH | SYS_CS_DUH | SYS_CS_MUH_MASK);
- au_writel(sys_clksrc, SYS_CLKSRC);
-
- sys_freqctrl = au_readl(SYS_FREQCTRL0);
- sys_freqctrl &= ~0xFFF00000;
-
- sys_clksrc = au_readl(SYS_CLKSRC);
- sys_clksrc &= ~(SYS_CS_CUD | SYS_CS_DUD | SYS_CS_MUD_MASK |
- SYS_CS_CUH | SYS_CS_DUH | SYS_CS_MUH_MASK);
-
- switch (prid & 0x000000FF) {
- case 0x00: /* DA */
- case 0x01: /* HA */
- case 0x02: /* HB */
- /* CPU core freq to 48 MHz to slow it way down... */
- au_writel(4, SYS_CPUPLL);
-
- /*
- * Setup 48 MHz FREQ2 from CPUPLL for USB Host
- * FRDIV2 = 3 -> div by 8 of 384 MHz -> 48 MHz
- */
- sys_freqctrl |= (3 << SYS_FC_FRDIV2_BIT) | SYS_FC_FE2;
- au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
- /* CPU core freq to 384 MHz */
- au_writel(0x20, SYS_CPUPLL);
-
- printk(KERN_INFO "Au1000: 48 MHz OHCI workaround enabled\n");
- break;
-
- default: /* HC and newer */
- /* FREQ2 = aux / 2 = 48 MHz */
- sys_freqctrl |= (0 << SYS_FC_FRDIV2_BIT) |
- SYS_FC_FE2 | SYS_FC_FS2;
- au_writel(sys_freqctrl, SYS_FREQCTRL0);
- break;
- }
-
- /*
- * Route 48 MHz FREQ2 into USB Host and/or Device
- */
- sys_clksrc |= SYS_CS_MUX_FQ2 << SYS_CS_MUH_BIT;
- au_writel(sys_clksrc, SYS_CLKSRC);
-
- /* Configure pins GPIO[14:9] as GPIO */
- pin_func = au_readl(SYS_PINFUNC) & ~(SYS_PF_UR3 | SYS_PF_USB);
-
- /* 2nd USB port is USB host */
- pin_func |= SYS_PF_USB;
-
- au_writel(pin_func, SYS_PINFUNC);
-
- alchemy_gpio_direction_input(11);
- alchemy_gpio_direction_input(13);
- alchemy_gpio_direction_output(4, 0);
- alchemy_gpio_direction_output(5, 0);
-#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */
-
- /* Make GPIO 15 an input (for interrupt line) */
- pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_IRF;
- /* We don't need I2S, so make it available for GPIO[31:29] */
- pin_func |= SYS_PF_I2S;
- au_writel(pin_func, SYS_PINFUNC);
-
- alchemy_gpio_direction_input(15);
-
- static_cfg0 = au_readl(MEM_STCFG0) & ~0xc00;
- au_writel(static_cfg0, MEM_STCFG0);
-
- /* configure RCE2* for LCD */
- au_writel(0x00000004, MEM_STCFG2);
-
- /* MEM_STTIME2 */
- au_writel(0x09000000, MEM_STTIME2);
-
- /* Set 32-bit base address decoding for RCE2* */
- au_writel(0x10003ff0, MEM_STADDR2);
-
- /*
- * PCI CPLD setup
- * Expand CE0 to cover PCI
- */
- au_writel(0x11803e40, MEM_STADDR1);
-
- /* Burst visibility on */
- au_writel(au_readl(MEM_STCFG0) | 0x1000, MEM_STCFG0);
-
- au_writel(0x83, MEM_STCFG1); /* ewait enabled, flash timing */
- au_writel(0x33030a10, MEM_STTIME1); /* slower timing for FPGA */
-
- /* Setup the static bus controller */
- au_writel(0x00000002, MEM_STCFG3); /* type = PCMCIA */
- au_writel(0x280E3D07, MEM_STTIME3); /* 250ns cycle time */
- au_writel(0x10000000, MEM_STADDR3); /* any PCMCIA select */
-
- /*
- * Enable Au1000 BCLK switching - note: sed1356 must not use
- * its BCLK (Au1000 LCLK) for any timings
- */
- switch (prid & 0x000000FF) {
- case 0x00: /* DA */
- case 0x01: /* HA */
- case 0x02: /* HB */
- break;
- default: /* HC and newer */
- /*
- * Enable sys bus clock divider when IDLE state or no bus
- * activity.
- */
- au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
- break;
- }
-
- pm_power_off = board_power_off;
- _machine_halt = board_power_off;
- _machine_restart = board_reset;
-}
-
-static int __init pb1000_init_irq(void)
-{
- irq_set_irq_type(AU1000_GPIO15_INT, IRQF_TRIGGER_LOW);
- return 0;
-}
-arch_initcall(pb1000_init_irq);
-
-static int __init pb1000_device_init(void)
-{
- return db1x_register_norflash(8 * 1024 * 1024, 4, 0);
-}
-device_initcall(pb1000_device_init);
diff --git a/arch/mips/alchemy/devboards/prom.c b/arch/mips/alchemy/devboards/prom.c
index e5306b5..56d7ea5 100644
--- a/arch/mips/alchemy/devboards/prom.c
+++ b/arch/mips/alchemy/devboards/prom.c
@@ -33,7 +33,7 @@
#include <asm/mach-au1x00/au1000.h>
#include <prom.h>
-#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_DB1000) || \
+#if defined(CONFIG_MIPS_DB1000) || \
defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_DB1100) || \
defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_DB1500) || \
defined(CONFIG_MIPS_BOSPORUS) || defined(CONFIG_MIPS_MIRAGE)
diff --git a/arch/mips/include/asm/mach-pb1x00/pb1000.h b/arch/mips/include/asm/mach-pb1x00/pb1000.h
deleted file mode 100644
index 6505925..0000000
--- a/arch/mips/include/asm/mach-pb1x00/pb1000.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Alchemy Semi Pb1000 Reference Board
- *
- * Copyright 2001, 2008 MontaVista Software Inc.
- * Author: MontaVista Software, Inc. <source@mvista.com>
- *
- * ########################################################################
- *
- * This program is free software; you can distribute it and/or modify it
- * under the terms of the GNU General Public License (Version 2) as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * ########################################################################
- *
- *
- */
-#ifndef __ASM_PB1000_H
-#define __ASM_PB1000_H
-
-/* PCMCIA PB1000 specific defines */
-#define PCMCIA_MAX_SOCK 1
-#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
-
-#define PB1000_PCR 0xBE000000
-# define PCR_SLOT_0_VPP0 (1 << 0)
-# define PCR_SLOT_0_VPP1 (1 << 1)
-# define PCR_SLOT_0_VCC0 (1 << 2)
-# define PCR_SLOT_0_VCC1 (1 << 3)
-# define PCR_SLOT_0_RST (1 << 4)
-# define PCR_SLOT_1_VPP0 (1 << 8)
-# define PCR_SLOT_1_VPP1 (1 << 9)
-# define PCR_SLOT_1_VCC0 (1 << 10)
-# define PCR_SLOT_1_VCC1 (1 << 11)
-# define PCR_SLOT_1_RST (1 << 12)
-
-#define PB1000_MDR 0xBE000004
-# define MDR_PI (1 << 5) /* PCMCIA int latch */
-# define MDR_EPI (1 << 14) /* enable PCMCIA int */
-# define MDR_CPI (1 << 15) /* clear PCMCIA int */
-
-#define PB1000_ACR1 0xBE000008
-# define ACR1_SLOT_0_CD1 (1 << 0) /* card detect 1 */
-# define ACR1_SLOT_0_CD2 (1 << 1) /* card detect 2 */
-# define ACR1_SLOT_0_READY (1 << 2) /* ready */
-# define ACR1_SLOT_0_STATUS (1 << 3) /* status change */
-# define ACR1_SLOT_0_VS1 (1 << 4) /* voltage sense 1 */
-# define ACR1_SLOT_0_VS2 (1 << 5) /* voltage sense 2 */
-# define ACR1_SLOT_0_INPACK (1 << 6) /* inpack pin status */
-# define ACR1_SLOT_1_CD1 (1 << 8) /* card detect 1 */
-# define ACR1_SLOT_1_CD2 (1 << 9) /* card detect 2 */
-# define ACR1_SLOT_1_READY (1 << 10) /* ready */
-# define ACR1_SLOT_1_STATUS (1 << 11) /* status change */
-# define ACR1_SLOT_1_VS1 (1 << 12) /* voltage sense 1 */
-# define ACR1_SLOT_1_VS2 (1 << 13) /* voltage sense 2 */
-# define ACR1_SLOT_1_INPACK (1 << 14) /* inpack pin status */
-
-#define CPLD_AUX0 0xBE00000C
-#define CPLD_AUX1 0xBE000010
-#define CPLD_AUX2 0xBE000014
-
-/* Voltage levels */
-
-/* VPPEN1 - VPPEN0 */
-#define VPP_GND ((0 << 1) | (0 << 0))
-#define VPP_5V ((1 << 1) | (0 << 0))
-#define VPP_3V ((0 << 1) | (1 << 0))
-#define VPP_12V ((0 << 1) | (1 << 0))
-#define VPP_HIZ ((1 << 1) | (1 << 0))
-
-/* VCCEN1 - VCCEN0 */
-#define VCC_3V ((0 << 1) | (1 << 0))
-#define VCC_5V ((1 << 1) | (0 << 0))
-#define VCC_HIZ ((0 << 1) | (0 << 0))
-
-/* VPP/VCC */
-#define SET_VCC_VPP(VCC, VPP, SLOT) \
- ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
-#endif /* __ASM_PB1000_H */
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index a3d696a..d1a77ef 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -32,10 +32,7 @@
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/au1000.h>
-#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100)
-#include <asm/pb1000.h>
-#elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
-#include <asm/db1x00.h>
+#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
#include <asm/mach-db1x00/bcsr.h>
#else
#error au1k_ir: unsupported board
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 6e318ce..c022b5c 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -155,10 +155,6 @@ config PCMCIA_M8XX
This driver is also available as a module called m8xx_pcmcia.
-config PCMCIA_AU1X00
- tristate "Au1x00 pcmcia support"
- depends on MIPS_ALCHEMY && PCMCIA
-
config PCMCIA_ALCHEMY_DEVBOARD
tristate "Alchemy Db/Pb1xxx PCMCIA socket services"
depends on MIPS_ALCHEMY && PCMCIA
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 29935ea..ec543a4 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -29,7 +29,6 @@ obj-$(CONFIG_PCMCIA_SA1100) += sa11xx_base.o sa1100_cs.o
obj-$(CONFIG_PCMCIA_SA1111) += sa11xx_base.o sa1111_cs.o
obj-$(CONFIG_M32R_PCC) += m32r_pcc.o
obj-$(CONFIG_M32R_CFC) += m32r_cfc.o
-obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o
obj-$(CONFIG_PCMCIA_BCM63XX) += bcm63xx_pcmcia.o
obj-$(CONFIG_PCMCIA_VRC4171) += vrc4171_card.o
obj-$(CONFIG_PCMCIA_VRC4173) += vrc4173_cardu.o
@@ -39,9 +38,6 @@ obj-$(CONFIG_AT91_CF) += at91_cf.o
obj-$(CONFIG_ELECTRA_CF) += electra_cf.o
obj-$(CONFIG_PCMCIA_ALCHEMY_DEVBOARD) += db1xxx_ss.o
-au1x00_ss-y += au1000_generic.o
-au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o
-
sa1111_cs-y += sa1111_generic.o
sa1111_cs-$(CONFIG_ASSABET_NEPONSET) += sa1100_neponset.o
sa1111_cs-$(CONFIG_SA1100_BADGE4) += sa1100_badge4.o
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
deleted file mode 100644
index 95dd7c6..0000000
--- a/drivers/pcmcia/au1000_generic.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
- *
- * Alchemy Semi Au1000 pcmcia driver
- *
- * Copyright 2001-2003 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- * ppopov@embeddedalley.com or source@mvista.com
- *
- * Copyright 2004 Pete Popov, Embedded Alley Solutions, Inc.
- * Updated the driver to 2.6. Followed the sa11xx API and largely
- * copied many of the hardware independent functions.
- *
- * ########################################################################
- *
- * This program is free software; you can distribute it and/or modify it
- * under the terms of the GNU General Public License (Version 2) as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * ########################################################################
- *
- *
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/cpufreq.h>
-#include <linux/ioport.h>
-#include <linux/kernel.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/notifier.h>
-#include <linux/interrupt.h>
-#include <linux/spinlock.h>
-#include <linux/mutex.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/system.h>
-
-#include <asm/mach-au1x00/au1000.h>
-#include "au1000_generic.h"
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Pete Popov <ppopov@embeddedalley.com>");
-MODULE_DESCRIPTION("Linux PCMCIA Card Services: Au1x00 Socket Controller");
-
-#if 0
-#define debug(x,args...) printk(KERN_DEBUG "%s: " x, __func__ , ##args)
-#else
-#define debug(x,args...)
-#endif
-
-#define MAP_SIZE 0x100000
-extern struct au1000_pcmcia_socket au1000_pcmcia_socket[];
-#define PCMCIA_SOCKET(x) (au1000_pcmcia_socket + (x))
-#define to_au1000_socket(x) container_of(x, struct au1000_pcmcia_socket, socket)
-
-/* Some boards like to support CF cards as IDE root devices, so they
- * grab pcmcia sockets directly.
- */
-u32 *pcmcia_base_vaddrs[2];
-extern const unsigned long mips_io_port_base;
-
-static DEFINE_MUTEX(pcmcia_sockets_lock);
-
-static int (*au1x00_pcmcia_hw_init[])(struct device *dev) = {
- au1x_board_init,
-};
-
-static int
-au1x00_pcmcia_skt_state(struct au1000_pcmcia_socket *skt)
-{
- struct pcmcia_state state;
- unsigned int stat;
-
- memset(&state, 0, sizeof(struct pcmcia_state));
-
- skt->ops->socket_state(skt, &state);
-
- stat = state.detect ? SS_DETECT : 0;
- stat |= state.ready ? SS_READY : 0;
- stat |= state.wrprot ? SS_WRPROT : 0;
- stat |= state.vs_3v ? SS_3VCARD : 0;
- stat |= state.vs_Xv ? SS_XVCARD : 0;
- stat |= skt->cs_state.Vcc ? SS_POWERON : 0;
-
- if (skt->cs_state.flags & SS_IOCARD)
- stat |= state.bvd1 ? SS_STSCHG : 0;
- else {
- if (state.bvd1 == 0)
- stat |= SS_BATDEAD;
- else if (state.bvd2 == 0)
- stat |= SS_BATWARN;
- }
- return stat;
-}
-
-/*
- * au100_pcmcia_config_skt
- *
- * Convert PCMCIA socket state to our socket configure structure.
- */
-static int
-au1x00_pcmcia_config_skt(struct au1000_pcmcia_socket *skt, socket_state_t *state)
-{
- int ret;
-
- ret = skt->ops->configure_socket(skt, state);
- if (ret == 0) {
- skt->cs_state = *state;
- }
-
- if (ret < 0)
- debug("unable to configure socket %d\n", skt->nr);
-
- return ret;
-}
-
-/* au1x00_pcmcia_sock_init()
- *
- * (Re-)Initialise the socket, turning on status interrupts
- * and PCMCIA bus. This must wait for power to stabilise
- * so that the card status signals report correctly.
- *
- * Returns: 0
- */
-static int au1x00_pcmcia_sock_init(struct pcmcia_socket *sock)
-{
- struct au1000_pcmcia_socket *skt = to_au1000_socket(sock);
-
- debug("initializing socket %u\n", skt->nr);
-
- skt->ops->socket_init(skt);
- return 0;
-}
-
-/*
- * au1x00_pcmcia_suspend()
- *
- * Remove power on the socket, disable IRQs from the card.
- * Turn off status interrupts, and disable the PCMCIA bus.
- *
- * Returns: 0
- */
-static int au1x00_pcmcia_suspend(struct pcmcia_socket *sock)
-{
- struct au1000_pcmcia_socket *skt = to_au1000_socket(sock);
-
- debug("suspending socket %u\n", skt->nr);
-
- skt->ops->socket_suspend(skt);
-
- return 0;
-}
-
-static DEFINE_SPINLOCK(status_lock);
-
-/*
- * au1x00_check_status()
- */
-static void au1x00_check_status(struct au1000_pcmcia_socket *skt)
-{
- unsigned int events;
-
- debug("entering PCMCIA monitoring thread\n");
-
- do {
- unsigned int status;
- unsigned long flags;
-
- status = au1x00_pcmcia_skt_state(skt);
-
- spin_lock_irqsave(&status_lock, flags);
- events = (status ^ skt->status) & skt->cs_state.csc_mask;
- skt->status = status;
- spin_unlock_irqrestore(&status_lock, flags);
-
- debug("events: %s%s%s%s%s%s\n",
- events == 0 ? "<NONE>" : "",
- events & SS_DETECT ? "DETECT " : "",
- events & SS_READY ? "READY " : "",
- events & SS_BATDEAD ? "BATDEAD " : "",
- events & SS_BATWARN ? "BATWARN " : "",
- events & SS_STSCHG ? "STSCHG " : "");
-
- if (events)
- pcmcia_parse_events(&skt->socket, events);
- } while (events);
-}
-
-/*
- * au1x00_pcmcia_poll_event()
- * Let's poll for events in addition to IRQs since IRQ only is unreliable...
- */
-static void au1x00_pcmcia_poll_event(unsigned long dummy)
-{
- struct au1000_pcmcia_socket *skt = (struct au1000_pcmcia_socket *)dummy;
- debug("polling for events\n");
-
- mod_timer(&skt->poll_timer, jiffies + AU1000_PCMCIA_POLL_PERIOD);
-
- au1x00_check_status(skt);
-}
-
-/* au1x00_pcmcia_get_status()
- *
- * From the sa11xx_core.c:
- * Implements the get_status() operation for the in-kernel PCMCIA
- * service (formerly SS_GetStatus in Card Services). Essentially just
- * fills in bits in `status' according to internal driver state or
- * the value of the voltage detect chipselect register.
- *
- * As a debugging note, during card startup, the PCMCIA core issues
- * three set_socket() commands in a row the first with RESET deasserted,
- * the second with RESET asserted, and the last with RESET deasserted
- * again. Following the third set_socket(), a get_status() command will
- * be issued. The kernel is looking for the SS_READY flag (see
- * setup_socket(), reset_socket(), and unreset_socket() in cs.c).
- *
- * Returns: 0
- */
-static int
-au1x00_pcmcia_get_status(struct pcmcia_socket *sock, unsigned int *status)
-{
- struct au1000_pcmcia_socket *skt = to_au1000_socket(sock);
-
- skt->status = au1x00_pcmcia_skt_state(skt);
- *status = skt->status;
-
- return 0;
-}
-
-/* au1x00_pcmcia_set_socket()
- * Implements the set_socket() operation for the in-kernel PCMCIA
- * service (formerly SS_SetSocket in Card Services). We more or
- * less punt all of this work and let the kernel handle the details
- * of power configuration, reset, &c. We also record the value of
- * `state' in order to regurgitate it to the PCMCIA core later.
- *
- * Returns: 0
- */
-static int
-au1x00_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
-{
- struct au1000_pcmcia_socket *skt = to_au1000_socket(sock);
-
- debug("for sock %u\n", skt->nr);
-
- debug("\tmask: %s%s%s%s%s%s\n\tflags: %s%s%s%s%s%s\n",
- (state->csc_mask==0)?"<NONE>":"",
- (state->csc_mask&SS_DETECT)?"DETECT ":"",
- (state->csc_mask&SS_READY)?"READY ":"",
- (state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
- (state->csc_mask&SS_BATWARN)?"BATWARN ":"",
- (state->csc_mask&SS_STSCHG)?"STSCHG ":"",
- (state->flags==0)?"<NONE>":"",
- (state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
- (state->flags&SS_IOCARD)?"IOCARD ":"",
- (state->flags&SS_RESET)?"RESET ":"",
- (state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
- (state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"");
- debug("\tVcc %d Vpp %d irq %d\n",
- state->Vcc, state->Vpp, state->io_irq);
-
- return au1x00_pcmcia_config_skt(skt, state);
-}
-
-int
-au1x00_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *map)
-{
- struct au1000_pcmcia_socket *skt = to_au1000_socket(sock);
- unsigned int speed;
-
- if(map->map>=MAX_IO_WIN){
- debug("map (%d) out of range\n", map->map);
- return -1;
- }
-
- if(map->flags&MAP_ACTIVE){
- speed=(map->speed>0)?map->speed:AU1000_PCMCIA_IO_SPEED;
- skt->spd_io[map->map] = speed;
- }
-
- map->start=(unsigned int)(u32)skt->virt_io;
- map->stop=map->start+MAP_SIZE;
- return 0;
-
-} /* au1x00_pcmcia_set_io_map() */
-
-
-static int
-au1x00_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *map)
-{
- struct au1000_pcmcia_socket *skt = to_au1000_socket(sock);
- unsigned short speed = map->speed;
-
- if(map->map>=MAX_WIN){
- debug("map (%d) out of range\n", map->map);
- return -1;
- }
-
- if (map->flags & MAP_ATTRIB) {
- skt->spd_attr[map->map] = speed;
- skt->spd_mem[map->map] = 0;
- } else {
- skt->spd_attr[map->map] = 0;
- skt->spd_mem[map->map] = speed;
- }
-
- if (map->flags & MAP_ATTRIB) {
- map->static_start = skt->phys_attr + map->card_start;
- }
- else {
- map->static_start = skt->phys_mem + map->card_start;
- }
-
- debug("set_mem_map %d start %08lx card_start %08x\n",
- map->map, map->static_start, map->card_start);
- return 0;
-
-} /* au1x00_pcmcia_set_mem_map() */
-
-static struct pccard_operations au1x00_pcmcia_operations = {
- .init = au1x00_pcmcia_sock_init,
- .suspend = au1x00_pcmcia_suspend,
- .get_status = au1x00_pcmcia_get_status,
- .set_socket = au1x00_pcmcia_set_socket,
- .set_io_map = au1x00_pcmcia_set_io_map,
- .set_mem_map = au1x00_pcmcia_set_mem_map,
-};
-
-static const char *skt_names[] = {
- "PCMCIA socket 0",
- "PCMCIA socket 1",
-};
-
-struct skt_dev_info {
- int nskt;
-};
-
-int au1x00_pcmcia_socket_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr)
-{
- struct skt_dev_info *sinfo;
- struct au1000_pcmcia_socket *skt;
- int ret, i;
-
- sinfo = kzalloc(sizeof(struct skt_dev_info), GFP_KERNEL);
- if (!sinfo) {
- ret = -ENOMEM;
- goto out;
- }
-
- sinfo->nskt = nr;
-
- /*
- * Initialise the per-socket structure.
- */
- for (i = 0; i < nr; i++) {
- skt = PCMCIA_SOCKET(i);
- memset(skt, 0, sizeof(*skt));
-
- skt->socket.resource_ops = &pccard_static_ops;
- skt->socket.ops = &au1x00_pcmcia_operations;
- skt->socket.owner = ops->owner;
- skt->socket.dev.parent = dev;
-
- init_timer(&skt->poll_timer);
- skt->poll_timer.function = au1x00_pcmcia_poll_event;
- skt->poll_timer.data = (unsigned long)skt;
- skt->poll_timer.expires = jiffies + AU1000_PCMCIA_POLL_PERIOD;
-
- skt->nr = first + i;
- skt->irq = 255;
- skt->dev = dev;
- skt->ops = ops;
-
- skt->res_skt.name = skt_names[skt->nr];
- skt->res_io.name = "io";
- skt->res_io.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
- skt->res_mem.name = "memory";
- skt->res_mem.flags = IORESOURCE_MEM;
- skt->res_attr.name = "attribute";
- skt->res_attr.flags = IORESOURCE_MEM;
-
- /*
- * PCMCIA client drivers use the inb/outb macros to access the
- * IO registers. Since mips_io_port_base is added to the
- * access address of the mips implementation of inb/outb,
- * we need to subtract it here because we want to access the
- * I/O or MEM address directly, without going through this
- * "mips_io_port_base" mechanism.
- */
- if (i == 0) {
- skt->virt_io = (void *)
- (ioremap((phys_t)AU1X_SOCK0_IO, 0x1000) -
- (u32)mips_io_port_base);
- skt->phys_attr = AU1X_SOCK0_PHYS_ATTR;
- skt->phys_mem = AU1X_SOCK0_PHYS_MEM;
- }
- else {
- skt->virt_io = (void *)
- (ioremap((phys_t)AU1X_SOCK1_IO, 0x1000) -
- (u32)mips_io_port_base);
- skt->phys_attr = AU1X_SOCK1_PHYS_ATTR;
- skt->phys_mem = AU1X_SOCK1_PHYS_MEM;
- }
- pcmcia_base_vaddrs[i] = (u32 *)skt->virt_io;
- ret = ops->hw_init(skt);
-
- skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
- skt->socket.irq_mask = 0;
- skt->socket.map_size = MAP_SIZE;
- skt->socket.pci_irq = skt->irq;
- skt->socket.io_offset = (unsigned long)skt->virt_io;
-
- skt->status = au1x00_pcmcia_skt_state(skt);
-
- ret = pcmcia_register_socket(&skt->socket);
- if (ret)
- goto out_err;
-
- WARN_ON(skt->socket.sock != i);
-
- add_timer(&skt->poll_timer);
- }
-
- dev_set_drvdata(dev, sinfo);
- return 0;
-
-
-out_err:
- ops->hw_shutdown(skt);
- while (i-- > 0) {
- skt = PCMCIA_SOCKET(i);
-
- del_timer_sync(&skt->poll_timer);
- pcmcia_unregister_socket(&skt->socket);
- if (i == 0) {
- iounmap(skt->virt_io + (u32)mips_io_port_base);
- skt->virt_io = NULL;
- }
-#ifndef CONFIG_MIPS_XXS1500
- else {
- iounmap(skt->virt_io + (u32)mips_io_port_base);
- skt->virt_io = NULL;
- }
-#endif
- ops->hw_shutdown(skt);
-
- }
- kfree(sinfo);
-out:
- return ret;
-}
-
-int au1x00_drv_pcmcia_remove(struct platform_device *dev)
-{
- struct skt_dev_info *sinfo = platform_get_drvdata(dev);
- int i;
-
- mutex_lock(&pcmcia_sockets_lock);
- platform_set_drvdata(dev, NULL);
-
- for (i = 0; i < sinfo->nskt; i++) {
- struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
-
- del_timer_sync(&skt->poll_timer);
- pcmcia_unregister_socket(&skt->socket);
- skt->ops->hw_shutdown(skt);
- au1x00_pcmcia_config_skt(skt, &dead_socket);
- iounmap(skt->virt_io + (u32)mips_io_port_base);
- skt->virt_io = NULL;
- }
-
- kfree(sinfo);
- mutex_unlock(&pcmcia_sockets_lock);
- return 0;
-}
-
-
-/*
- * PCMCIA "Driver" API
- */
-
-static int au1x00_drv_pcmcia_probe(struct platform_device *dev)
-{
- int i, ret = -ENODEV;
-
- mutex_lock(&pcmcia_sockets_lock);
- for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) {
- ret = au1x00_pcmcia_hw_init[i](&dev->dev);
- if (ret == 0)
- break;
- }
- mutex_unlock(&pcmcia_sockets_lock);
- return ret;
-}
-
-static struct platform_driver au1x00_pcmcia_driver = {
- .driver = {
- .name = "au1x00-pcmcia",
- .owner = THIS_MODULE,
- },
- .probe = au1x00_drv_pcmcia_probe,
- .remove = au1x00_drv_pcmcia_remove,
-};
-
-
-/* au1x00_pcmcia_init()
- *
- * This routine performs low-level PCMCIA initialization and then
- * registers this socket driver with Card Services.
- *
- * Returns: 0 on success, -ve error code on failure
- */
-static int __init au1x00_pcmcia_init(void)
-{
- int error = 0;
- error = platform_driver_register(&au1x00_pcmcia_driver);
- return error;
-}
-
-/* au1x00_pcmcia_exit()
- * Invokes the low-level kernel service to free IRQs associated with this
- * socket controller and reset GPIO edge detection.
- */
-static void __exit au1x00_pcmcia_exit(void)
-{
- platform_driver_unregister(&au1x00_pcmcia_driver);
-}
-
-module_init(au1x00_pcmcia_init);
-module_exit(au1x00_pcmcia_exit);
diff --git a/drivers/pcmcia/au1000_generic.h b/drivers/pcmcia/au1000_generic.h
deleted file mode 100644
index 5c36bda..0000000
--- a/drivers/pcmcia/au1000_generic.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Alchemy Semi Au1000 pcmcia driver include file
- *
- * Copyright 2001 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- * ppopov@mvista.com or source@mvista.com
- *
- * This program is free software; you can distribute it and/or modify it
- * under the terms of the GNU General Public License (Version 2) as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- */
-#ifndef __ASM_AU1000_PCMCIA_H
-#define __ASM_AU1000_PCMCIA_H
-
-/* include the world */
-
-#include <pcmcia/ss.h>
-#include <pcmcia/cistpl.h>
-#include "cs_internal.h"
-
-#define AU1000_PCMCIA_POLL_PERIOD (2*HZ)
-#define AU1000_PCMCIA_IO_SPEED (255)
-#define AU1000_PCMCIA_MEM_SPEED (300)
-
-#define AU1X_SOCK0_IO 0xF00000000ULL
-#define AU1X_SOCK0_PHYS_ATTR 0xF40000000ULL
-#define AU1X_SOCK0_PHYS_MEM 0xF80000000ULL
-
-/* pcmcia socket 1 needs external glue logic so the memory map
- * differs from board to board.
- */
-#if defined(CONFIG_MIPS_PB1000)
-#define AU1X_SOCK1_IO 0xF08000000ULL
-#define AU1X_SOCK1_PHYS_ATTR 0xF48000000ULL
-#define AU1X_SOCK1_PHYS_MEM 0xF88000000ULL
-#endif
-
-struct pcmcia_state {
- unsigned detect: 1,
- ready: 1,
- wrprot: 1,
- bvd1: 1,
- bvd2: 1,
- vs_3v: 1,
- vs_Xv: 1;
-};
-
-struct pcmcia_configure {
- unsigned sock: 8,
- vcc: 8,
- vpp: 8,
- output: 1,
- speaker: 1,
- reset: 1;
-};
-
-struct pcmcia_irqs {
- int sock;
- int irq;
- const char *str;
-};
-
-
-struct au1000_pcmcia_socket {
- struct pcmcia_socket socket;
-
- /*
- * Info from low level handler
- */
- struct device *dev;
- unsigned int nr;
- unsigned int irq;
-
- /*
- * Core PCMCIA state
- */
- struct pcmcia_low_level *ops;
-
- unsigned int status;
- socket_state_t cs_state;
-
- unsigned short spd_io[MAX_IO_WIN];
- unsigned short spd_mem[MAX_WIN];
- unsigned short spd_attr[MAX_WIN];
-
- struct resource res_skt;
- struct resource res_io;
- struct resource res_mem;
- struct resource res_attr;
-
- void * virt_io;
- unsigned int phys_io;
- unsigned int phys_attr;
- unsigned int phys_mem;
- unsigned short speed_io, speed_attr, speed_mem;
-
- unsigned int irq_state;
-
- struct timer_list poll_timer;
-};
-
-struct pcmcia_low_level {
- struct module *owner;
-
- int (*hw_init)(struct au1000_pcmcia_socket *);
- void (*hw_shutdown)(struct au1000_pcmcia_socket *);
-
- void (*socket_state)(struct au1000_pcmcia_socket *, struct pcmcia_state *);
- int (*configure_socket)(struct au1000_pcmcia_socket *, struct socket_state_t *);
-
- /*
- * Enable card status IRQs on (re-)initialisation. This can
- * be called at initialisation, power management event, or
- * pcmcia event.
- */
- void (*socket_init)(struct au1000_pcmcia_socket *);
-
- /*
- * Disable card status IRQs and PCMCIA bus on suspend.
- */
- void (*socket_suspend)(struct au1000_pcmcia_socket *);
-};
-
-extern int au1x_board_init(struct device *dev);
-
-#endif /* __ASM_AU1000_PCMCIA_H */
diff --git a/drivers/pcmcia/au1000_pb1x00.c b/drivers/pcmcia/au1000_pb1x00.c
deleted file mode 100644
index b239664..0000000
--- a/drivers/pcmcia/au1000_pb1x00.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- *
- * Alchemy Semi Pb1000 boards specific pcmcia routines.
- *
- * Copyright 2002 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- * ppopov@mvista.com or source@mvista.com
- *
- * ########################################################################
- *
- * This program is free software; you can distribute it and/or modify it
- * under the terms of the GNU General Public License (Version 2) as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/ioport.h>
-#include <linux/kernel.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/proc_fs.h>
-#include <linux/types.h>
-
-#include <pcmcia/ss.h>
-#include <pcmcia/cistpl.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/system.h>
-
-#include <asm/au1000.h>
-#include <asm/au1000_pcmcia.h>
-
-#define debug(fmt, arg...) do { } while (0)
-
-#include <asm/pb1000.h>
-#define PCMCIA_IRQ AU1000_GPIO_15
-
-static int pb1x00_pcmcia_init(struct pcmcia_init *init)
-{
- u16 pcr;
- pcr = PCR_SLOT_0_RST | PCR_SLOT_1_RST;
-
- au_writel(0x8000, PB1000_MDR); /* clear pcmcia interrupt */
- au_sync_delay(100);
- au_writel(0x4000, PB1000_MDR); /* enable pcmcia interrupt */
- au_sync();
-
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,0);
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,1);
- au_writel(pcr, PB1000_PCR);
- au_sync_delay(20);
-
- return PCMCIA_NUM_SOCKS;
-}
-
-static int pb1x00_pcmcia_shutdown(void)
-{
- u16 pcr;
- pcr = PCR_SLOT_0_RST | PCR_SLOT_1_RST;
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,0);
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,1);
- au_writel(pcr, PB1000_PCR);
- au_sync_delay(20);
- return 0;
-}
-
-static int
-pb1x00_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
-{
- u32 inserted0, inserted1;
- u16 vs0, vs1;
-
- vs0 = vs1 = (u16)au_readl(PB1000_ACR1);
- inserted0 = !(vs0 & (ACR1_SLOT_0_CD1 | ACR1_SLOT_0_CD2));
- inserted1 = !(vs1 & (ACR1_SLOT_1_CD1 | ACR1_SLOT_1_CD2));
- vs0 = (vs0 >> 4) & 0x3;
- vs1 = (vs1 >> 12) & 0x3;
-
- state->ready = 0;
- state->vs_Xv = 0;
- state->vs_3v = 0;
- state->detect = 0;
-
- if (sock == 0) {
- if (inserted0) {
- switch (vs0) {
- case 0:
- case 2:
- state->vs_3v=1;
- break;
- case 3: /* 5V */
- break;
- default:
- /* return without setting 'detect' */
- printk(KERN_ERR "pb1x00 bad VS (%d)\n",
- vs0);
- return 0;
- }
- state->detect = 1;
- }
- }
- else {
- if (inserted1) {
- switch (vs1) {
- case 0:
- case 2:
- state->vs_3v=1;
- break;
- case 3: /* 5V */
- break;
- default:
- /* return without setting 'detect' */
- printk(KERN_ERR "pb1x00 bad VS (%d)\n",
- vs1);
- return 0;
- }
- state->detect = 1;
- }
- }
-
- if (state->detect) {
- state->ready = 1;
- }
-
- state->bvd1=1;
- state->bvd2=1;
- state->wrprot=0;
- return 1;
-}
-
-
-static int pb1x00_pcmcia_get_irq_info(struct pcmcia_irq_info *info)
-{
-
- if(info->sock > PCMCIA_MAX_SOCK) return -1;
-
- /*
- * Even in the case of the Pb1000, both sockets are connected
- * to the same irq line.
- */
- info->irq = PCMCIA_IRQ;
-
- return 0;
-}
-
-
-static int
-pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure)
-{
- u16 pcr;
-
- if(configure->sock > PCMCIA_MAX_SOCK) return -1;
-
- pcr = au_readl(PB1000_PCR);
-
- if (configure->sock == 0) {
- pcr &= ~(PCR_SLOT_0_VCC0 | PCR_SLOT_0_VCC1 |
- PCR_SLOT_0_VPP0 | PCR_SLOT_0_VPP1);
- }
- else {
- pcr &= ~(PCR_SLOT_1_VCC0 | PCR_SLOT_1_VCC1 |
- PCR_SLOT_1_VPP0 | PCR_SLOT_1_VPP1);
- }
-
- pcr &= ~PCR_SLOT_0_RST;
- debug("Vcc %dV Vpp %dV, pcr %x\n",
- configure->vcc, configure->vpp, pcr);
- switch(configure->vcc){
- case 0: /* Vcc 0 */
- switch(configure->vpp) {
- case 0:
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_GND,
- configure->sock);
- break;
- case 12:
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_12V,
- configure->sock);
- break;
- case 50:
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_5V,
- configure->sock);
- break;
- case 33:
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_3V,
- configure->sock);
- break;
- default:
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,
- configure->sock);
- printk("%s: bad Vcc/Vpp (%d:%d)\n",
- __func__,
- configure->vcc,
- configure->vpp);
- break;
- }
- break;
- case 50: /* Vcc 5V */
- switch(configure->vpp) {
- case 0:
- pcr |= SET_VCC_VPP(VCC_5V,VPP_GND,
- configure->sock);
- break;
- case 50:
- pcr |= SET_VCC_VPP(VCC_5V,VPP_5V,
- configure->sock);
- break;
- case 12:
- pcr |= SET_VCC_VPP(VCC_5V,VPP_12V,
- configure->sock);
- break;
- case 33:
- pcr |= SET_VCC_VPP(VCC_5V,VPP_3V,
- configure->sock);
- break;
- default:
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,
- configure->sock);
- printk("%s: bad Vcc/Vpp (%d:%d)\n",
- __func__,
- configure->vcc,
- configure->vpp);
- break;
- }
- break;
- case 33: /* Vcc 3.3V */
- switch(configure->vpp) {
- case 0:
- pcr |= SET_VCC_VPP(VCC_3V,VPP_GND,
- configure->sock);
- break;
- case 50:
- pcr |= SET_VCC_VPP(VCC_3V,VPP_5V,
- configure->sock);
- break;
- case 12:
- pcr |= SET_VCC_VPP(VCC_3V,VPP_12V,
- configure->sock);
- break;
- case 33:
- pcr |= SET_VCC_VPP(VCC_3V,VPP_3V,
- configure->sock);
- break;
- default:
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,
- configure->sock);
- printk("%s: bad Vcc/Vpp (%d:%d)\n",
- __func__,
- configure->vcc,
- configure->vpp);
- break;
- }
- break;
- default: /* what's this ? */
- pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,configure->sock);
- printk(KERN_ERR "%s: bad Vcc %d\n",
- __func__, configure->vcc);
- break;
- }
-
- if (configure->sock == 0) {
- pcr &= ~(PCR_SLOT_0_RST);
- if (configure->reset)
- pcr |= PCR_SLOT_0_RST;
- }
- else {
- pcr &= ~(PCR_SLOT_1_RST);
- if (configure->reset)
- pcr |= PCR_SLOT_1_RST;
- }
- au_writel(pcr, PB1000_PCR);
- au_sync_delay(300);
-
- return 0;
-}
-
-
-struct pcmcia_low_level pb1x00_pcmcia_ops = {
- pb1x00_pcmcia_init,
- pb1x00_pcmcia_shutdown,
- pb1x00_pcmcia_socket_state,
- pb1x00_pcmcia_get_irq_info,
- pb1x00_pcmcia_configure_socket
-};
--
1.7.7.1
^ permalink raw reply related
* Re: Quick Fair Queue scheduler maturity and examples
From: David Täht @ 2011-11-02 11:31 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Karel Rericha, netdev, bloat
In-Reply-To: <1320229869.2292.5.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
[-- Attachment #1: Type: text/plain, Size: 2924 bytes --]
On 11/02/2011 11:31 AM, Eric Dumazet wrote:
> Le mercredi 02 novembre 2011 à 11:05 +0100, David Täht a écrit :
>> (Example elided, see thread on netdev)
>>
>> On 11/02/2011 10:36 AM, Karel Rericha wrote:
>>> 2011/10/27 Eric Dumazet<eric.dumazet@gmail.com>:
>>> Thanks for example Eric. But it only added more confusion to me now
>>> :-) I was under impression (and read somewhere) that QFQ is non work
>>> conserving scheduler so I can use it more or less like HTB or HFSC to
>>> set bandwidth constraints to flows. But from this example (and from
>>> sources/patches/papers I try not to pretend I fully understand) it
>>> looks to me like some multiqueue scheduler with arbitrary number of
>>> queues and ability to arbitrary assign flows to this queues. So some
>>> sort of fair division of available bandwidth to flows without
>>> arbitrary bandwidth caps to these flows.
>> This is what I want! It may not be what you want...
>>> I really dont see what is non work conserving here :-S Please save my
>>> soul and enlighten me because I am at dead end now :-)
>> I initially had great hope for QFQ as I've been saying (mostly
>> privately) that "PFIFO_FAST must die" for over a year now. What to
>> replace it with is a rather large question, but I felt a start would be
>> to adopt some FQ algorithm. Over the last couple weeks I read all the
>> papers regarding DRR and QFQ and also poked into the source code and
>> like you, am seriously un-enlightened.
>>
>> I think eric's example is misleading as he divided up the queues by
>> bandwidth, rather than flow, in the first tier of his tc hierarchy.
>> useful as a test...
> It seems there is a bit of misunderstanding here.
>
> QFQ is not a 'all is included' in one qdisc, like SFQ
I grok. (or rather, I did after some reading last week)
>
> You really need to setup qfq classes, and describe how packets are
> mapped to qfq classes (this is done by an external flow classifier)
It would be mildly better (in the case of wireless) to be able to do
flow classification based on the nexthop mac, which while introducing an
extra routing table lookup, would improve packet aggregation
probabilities in the multiple ip or multi-hop wireless case.
I don't know if a route lookup of dest mac could be correctly done at
this layer.
> It also has no internal (default) flow classifier like SFQ did.
>
> It has of course no bandwidth constraints. If you need to shape and use
> QFQ, you'll have to use QFQ + a shaping qdisc. (This is why I used HTB
> in my script because I wanted to shape)
I just want FQ... for now.
> If you dont need to shape, you still need to describe/setup qfq classes
> and chose appropriate flow classifier.
>
Trying for two levels of flow classification here, which I still doubt I
can do here... hmm, perhaps with ifb...
don't want to shape, want to ultimately apply some level of a post-RED
AQM to the overall flows
>
--
Dave Täht
[-- Attachment #2: dave_taht.vcf --]
[-- Type: text/x-vcard, Size: 214 bytes --]
begin:vcard
fn;quoted-printable:Dave T=C3=A4ht
n;quoted-printable:T=C3=A4ht;Dave
email;internet:dave.taht@gmail.com
tel;home:1-239-829-5608
tel;cell:0638645374
x-mozilla-html:FALSE
version:2.1
end:vcard
^ permalink raw reply
* bnx2x kerneloops
From: Carlos Peón Costa @ 2011-11-02 11:04 UTC (permalink / raw)
To: netdev
Hello, can anybody help to debug this issue?
Thanks.
kernel 2.6.32-131.17.1.el6.x86_64 (RH 6.1)
ethtool -i eth0:driver: bnx2xversion: 1.62.00-6firmware-version: bc 5.2.7 phy baa0.105bus-info: 0000:02:00.0
Oct 31 10:40:34 apache1-pro kernel: NETDEV WATCHDOG: eth0 (bnx2x): transmit queue 6 timed out
Oct 31 10:40:34 apache1-pro kernel: Modules linked in: autofs4 nfs lockd fscache nfs_acl auth_rpcgss sunrpc pcc_cpufreq bonding ipv6 xt_recent ipt_LOG xt_limit nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_hashlimit iptable_filter ip_tables dm_mirror dm_region_hash dm_log power_meter ipmi_si ipmi_msghandler hpwdt hpilo sg bnx2x libcrc32c mdio microcode serio_raw iTCO_wdt iTCO_vendor_support i7core_edac edac_core shpchp ext4 mbcache jbd2 sd_mod crc_t10dif hpsa qla2xxx scsi_transport_fc scsi_tgt radeon ttm drm_kms_helper drm hwmon i2c_algo_bit i2c_core dm_mod [last unloaded: scsi_wait_scan]
Oct 31 10:40:34 apache1-pro kernel: Pid: 0, comm: swapper Not tainted 2.6.32-131.17.1.el6.x86_64 #1
Oct 31 10:40:34 apache1-pro kernel: Call Trace:
Oct 31 10:40:34 apache1-pro kernel: [] ? warn_slowpath_common+0x87/0xc0
Oct 31 10:40:34 apache1-pro kernel: [] ? warn_slowpath_fmt+0x46/0x50
Oct 31 10:40:34 apache1-pro kernel: [] ? dev_watchdog+0x26d/0x280
Oct 31 10:40:34 apache1-pro kernel: [] ? rh_timer_func+0x0/0x10
Oct 31 10:40:34 apache1-pro kernel: [] ? usb_hcd_poll_rh_status+0x141/0x180
Oct 31 10:40:34 apache1-pro kernel: [] ? read_tsc+0x9/0x20
Oct 31 10:40:34 apache1-pro kernel: [] ? dev_watchdog+0x0/0x280
Oct 31 10:40:34 apache1-pro kernel: [] ? run_timer_softirq+0x197/0x340
Oct 31 10:40:34 apache1-pro kernel: [] ? __do_softirq+0xc1/0x1d0
Oct 31 10:40:34 apache1-pro kernel: [] ? handle_IRQ_event+0x60/0x170
Oct 31 10:40:34 apache1-pro kernel: [] ? call_softirq+0x1c/0x30
Oct 31 10:40:34 apache1-pro kernel: [] ? do_softirq+0x65/0xa0
Oct 31 10:40:34 apache1-pro kernel: [] ? irq_exit+0x85/0x90
Oct 31 10:40:34 apache1-pro kernel: [] ? do_IRQ+0x75/0xf0
Oct 31 10:40:34 apache1-pro kernel: [] ? ret_from_intr+0x0/0x11
Oct 31 10:40:34 apache1-pro kernel: [] ? intel_idle+0xde/0x170
Oct 31 10:40:34 apache1-pro kernel: [] ? intel_idle+0xc1/0x170
Oct 31 10:40:34 apache1-pro kernel: [] ? cpuidle_idle_call+0xa7/0x140
Oct 31 10:40:34 apache1-pro kernel: [] ? cpu_idle+0xb6/0x110
Oct 31 10:40:34 apache1-pro kernel: [] ? rest_init+0x7a/0x80
Oct 31 10:40:34 apache1-pro kernel: [] ? start_kernel+0x41d/0x429
Oct 31 10:40:34 apache1-pro kernel: [] ? x86_64_start_reservations+0x125/0x129
Oct 31 10:40:34 apache1-pro kernel: [] ? x86_64_start_kernel+0xfa/0x109
Oct 31 10:40:34 apache1-pro kernel: ---[ end trace 77e43a1d40d78daf ]---
Oct 31 10:40:36 apache1-pro abrt: Kerneloops: Reported 1 kernel oopses to Abrt
Oct 31 10:40:36 apache1-pro abrtd: Directory 'kerneloops-1320054036-2000-1' creation detected
Oct 31 10:40:36 apache1-pro abrtd: Registered Database plugin 'SQLite3'
Oct 31 10:40:36 apache1-pro kernel: [bnx2x_chip_cleanup:7211(eth0)]timeout waiting for queue[6]
Oct 31 10:40:36 apache1-pro abrtd: New crash /var/spool/abrt/kerneloops-1320054036-2000-1, processing
Oct 31 10:40:46 apache1-pro kernel: [bnx2x_wait_ramrod:6305(eth0)]timeout waiting for state c0000 on IDX [6]
Oct 31 10:40:46 apache1-pro kernel: bnx2x 0000:02:00.0: firmware: requesting bnx2x/bnx2x-e1h-6.2.9.0.fw
Oct 31 10:40:46 apache1-pro kernel: bnx2x 0000:02:00.0: eth0: using MSI-X IRQs: sp 53 fp[0] 55 ... fp[7] 62
Oct 31 10:40:47 apache1-pro kernel: bonding: bond0: link status definitely down for interface eth0, disabling it
Oct 31 10:40:47 apache1-pro kernel: bonding: bond0: making interface eth1 the new active one.
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_attn_int_deasserted3:3142(eth1)]MC assert!
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_attn_int_deasserted3:3147(eth1)]driver assert
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:894(eth1)]begin crash dump -----------------
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:901(eth1)]def_idx(0x726) def_att_idx(0x8) attn_state(0x1) spq_prod_idx(0x2f)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:906(eth1)]DSB: attn bits(0x0) ack(0x1) id(0x10) idx(0x8)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:907(eth1)] def (0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x72d 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0) igu_sb_id(0x10) igu_seg_id (0x0) pf_id(0x1) vnic_id(0x0) vf_id(0xff) vf_valid (0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:951(eth1)]fp0: rx_bd_prod(0xbba) rx_bd_cons(0x9f3) rx_comp_prod(0xbc8) rx_comp_cons(0xa00) *rx_cons_sb(0x9ff)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:955(eth1)] rx_sge_prod(0x400) last_max_sge(0x0) fp_hc_idx(0x9ec)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:962(eth1)]fp0: tx_pkt_prod(0x0) tx_pkt_cons(0x0) tx_bd_prod(0x0) tx_bd_cons(0x0) *tx_cons_sb(0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:973(eth1)] run indexes (0x9ec 0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:979(eth1)] indexes (0x0 0x9ff 0x0 0x0 0x0 0x0 0x0 0x0)pf_id(0x1) vf_id (0xff) vf_valid(0x0) vnic_id(0x0) same_igu_sb_1b(0x1)
Oct 31 10:40:47 apache1-pro kernel: SM[0] __flags (0x0) igu_sb_id (0x1) igu_seg_id(0x0) time_to_expire (0x6ca43fd0) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: SM[1] __flags (0x0) igu_sb_id (0x1) igu_seg_id(0x0) time_to_expire (0xffffffff) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: INDEX[0] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[1] flags (0x2) timeout (0x6)
Oct 31 10:40:47 apache1-pro kernel: INDEX[2] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[3] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[4] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[5] flags (0x2) timeout (0xc)
Oct 31 10:40:47 apache1-pro kernel: INDEX[6] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[7] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:951(eth1)]fp1: rx_bd_prod(0x1c5) rx_bd_cons(0x0) rx_comp_prod(0x1c9) rx_comp_cons(0x1) *rx_cons_sb(0x1)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:955(eth1)] rx_sge_prod(0x400) last_max_sge(0x0) fp_hc_idx(0x1)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:962(eth1)]fp1: tx_pkt_prod(0x1) tx_pkt_cons(0x0) tx_bd_prod(0x2) tx_bd_cons(0x0) *tx_cons_sb(0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:973(eth1)] run indexes (0x1 0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:979(eth1)] indexes (0x0 0x1 0x0 0x0 0x0 0x0 0x0 0x0)pf_id(0x1) vf_id (0xff) vf_valid(0x0) vnic_id(0x0) same_igu_sb_1b(0x1)
Oct 31 10:40:47 apache1-pro kernel: SM[0] __flags (0x0) igu_sb_id (0x2) igu_seg_id(0x0) time_to_expire (0x216116) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: SM[1] __flags (0x0) igu_sb_id (0x2) igu_seg_id(0x0) time_to_expire (0xffffffff) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: INDEX[0] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[1] flags (0x2) timeout (0x6)
Oct 31 10:40:47 apache1-pro kernel: INDEX[2] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[3] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[4] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[5] flags (0x2) timeout (0xc)
Oct 31 10:40:47 apache1-pro kernel: INDEX[6] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[7] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:951(eth1)]fp2: rx_bd_prod(0x1dc) rx_bd_cons(0x17) rx_comp_prod(0x1e0) rx_comp_cons(0x18) *rx_cons_sb(0x18)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:955(eth1)] rx_sge_prod(0x400) last_max_sge(0x0) fp_hc_idx(0x18)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:962(eth1)]fp2: tx_pkt_prod(0x1) tx_pkt_cons(0x0) tx_bd_prod(0x2) tx_bd_cons(0x0) *tx_cons_sb(0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:973(eth1)] run indexes (0x18 0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:979(eth1)] indexes (0x0 0x18 0x0 0x0 0x0 0x0 0x0 0x0)pf_id(0x1) vf_id (0xff) vf_valid(0x0) vnic_id(0x0) same_igu_sb_1b(0x1)
Oct 31 10:40:47 apache1-pro kernel: SM[0] __flags (0x0) igu_sb_id (0x3) igu_seg_id(0x0) time_to_expire (0x6cab8f35) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: SM[1] __flags (0x0) igu_sb_id (0x3) igu_seg_id(0x0) time_to_expire (0xffffffff) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: INDEX[0] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[1] flags (0x2) timeout (0x6)
Oct 31 10:40:47 apache1-pro kernel: INDEX[2] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[3] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[4] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[5] flags (0x2) timeout (0xc)
Oct 31 10:40:47 apache1-pro kernel: INDEX[6] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[7] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:951(eth1)]fp3: rx_bd_prod(0x1ce) rx_bd_cons(0x9) rx_comp_prod(0x1d2) rx_comp_cons(0xa) *rx_cons_sb(0xa)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:955(eth1)] rx_sge_prod(0x400) last_max_sge(0x0) fp_hc_idx(0xa)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:962(eth1)]fp3: tx_pkt_prod(0x1) tx_pkt_cons(0x0) tx_bd_prod(0x2) tx_bd_cons(0x0) *tx_cons_sb(0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:973(eth1)] run indexes (0xa 0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:979(eth1)] indexes (0x0 0xa 0x0 0x0 0x0 0x0 0x0 0x0)pf_id(0x1) vf_id (0xff) vf_valid(0x0) vnic_id(0x0) same_igu_sb_1b(0x1)
Oct 31 10:40:47 apache1-pro kernel: SM[0] __flags (0x0) igu_sb_id (0x4) igu_seg_id(0x0) time_to_expire (0x6b22e5c4) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: SM[1] __flags (0x0) igu_sb_id (0x4) igu_seg_id(0x0) time_to_expire (0xffffffff) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: INDEX[0] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[1] flags (0x2) timeout (0x6)
Oct 31 10:40:47 apache1-pro kernel: INDEX[2] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[3] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[4] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[5] flags (0x2) timeout (0xc)
Oct 31 10:40:47 apache1-pro kernel: INDEX[6] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[7] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:951(eth1)]fp4: rx_bd_prod(0x1c5) rx_bd_cons(0x0) rx_comp_prod(0x1c9) rx_comp_cons(0x1) *rx_cons_sb(0x1)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:955(eth1)] rx_sge_prod(0x400) last_max_sge(0x0) fp_hc_idx(0x1)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:962(eth1)]fp4: tx_pkt_prod(0x0) tx_pkt_cons(0x0) tx_bd_prod(0x0) tx_bd_cons(0x0) *tx_cons_sb(0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:973(eth1)] run indexes (0x1 0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:979(eth1)] indexes (0x0 0x1 0x0 0x0 0x0 0x0 0x0 0x0)pf_id(0x1) vf_id (0xff) vf_valid(0x0) vnic_id(0x0) same_igu_sb_1b(0x1)
Oct 31 10:40:47 apache1-pro kernel: SM[0] __flags (0x0) igu_sb_id (0x5) igu_seg_id(0x0) time_to_expire (0x21787e) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: SM[1] __flags (0x0) igu_sb_id (0x5) igu_seg_id(0x0) time_to_expire (0xffffffff) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: INDEX[0] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[1] flags (0x2) timeout (0x6)
Oct 31 10:40:47 apache1-pro kernel: INDEX[2] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[3] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[4] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[5] flags (0x2) timeout (0xc)
Oct 31 10:40:47 apache1-pro kernel: INDEX[6] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[7] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:951(eth1)]fp5: rx_bd_prod(0x1c5) rx_bd_cons(0x0) rx_comp_prod(0x1c9) rx_comp_cons(0x1) *rx_cons_sb(0x1)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:955(eth1)] rx_sge_prod(0x400) last_max_sge(0x0) fp_hc_idx(0x1)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:962(eth1)]fp5: tx_pkt_prod(0x0) tx_pkt_cons(0x0) tx_bd_prod(0x0) tx_bd_cons(0x0) *tx_cons_sb(0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:973(eth1)] run indexes (0x1 0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:979(eth1)] indexes (0x0 0x1 0x0 0x0 0x0 0x0 0x0 0x0)pf_id(0x1) vf_id (0xff) vf_valid(0x0) vnic_id(0x0) same_igu_sb_1b(0x1)
Oct 31 10:40:47 apache1-pro kernel: SM[0] __flags (0x0) igu_sb_id (0x7) igu_seg_id(0x0) time_to_expire (0x218814) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: SM[1] __flags (0x0) igu_sb_id (0x7) igu_seg_id(0x0) time_to_expire (0xffffffff) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: INDEX[0] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[1] flags (0x2) timeout (0x6)
Oct 31 10:40:47 apache1-pro kernel: INDEX[2] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[3] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[4] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[5] flags (0x2) timeout (0xc)
Oct 31 10:40:47 apache1-pro kernel: INDEX[6] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[7] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:951(eth1)]fp7: rx_bd_prod(0x1d7) rx_bd_cons(0x12) rx_comp_prod(0x1db) rx_comp_cons(0x13) *rx_cons_sb(0x13)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:955(eth1)] rx_sge_prod(0x400) last_max_sge(0x0) fp_hc_idx(0x13)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:962(eth1)]fp7: tx_pkt_prod(0x0) tx_pkt_cons(0x0) tx_bd_prod(0x0) tx_bd_cons(0x0) *tx_cons_sb(0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:973(eth1)] run indexes (0x13 0x0)
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:979(eth1)] indexes (0x0 0x13 0x0 0x0 0x0 0x0 0x0 0x0)pf_id(0x1) vf_id (0xff) vf_valid(0x0) vnic_id(0x0) same_igu_sb_1b(0x1)
Oct 31 10:40:47 apache1-pro kernel: SM[0] __flags (0x0) igu_sb_id (0x8) igu_seg_id(0x0) time_to_expire (0x664cc527) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: SM[1] __flags (0x0) igu_sb_id (0x8) igu_seg_id(0x0) time_to_expire (0xffffffff) timer_value(0xff)
Oct 31 10:40:47 apache1-pro kernel: INDEX[0] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[1] flags (0x2) timeout (0x6)
Oct 31 10:40:47 apache1-pro kernel: INDEX[2] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[3] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[4] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[5] flags (0x2) timeout (0xc)
Oct 31 10:40:47 apache1-pro kernel: INDEX[6] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: INDEX[7] flags (0x0) timeout (0x0)
Oct 31 10:40:47 apache1-pro kernel: begin fw dump (mark 0xaf8e4)
Oct 31 10:40:47 apache1-pro kernel: nt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0Ap^AÈ->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x18:n 0x558=>0x6669746c
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x1c:n 0x55c=>0x74636e75
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x20:n 0x560=>0x5f6e6f69
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x24:n 0x564=>0x632d4c42
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x28:n 0x568=>0x6164415f
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x2c:n 0x56c=>0x72657470
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x30:n 0x570=>0x4b9000
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x34:n 0x574=>0x4e034e50
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x38:n 0x578=>0x4345412f
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x3c:n 0x57c=>0x412f4e03
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x40:n 0x580=>0x300a4e53
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x44:n 0x584=>0x34333231
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x48:n 0x588=>0x38373635
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x38:n 0x578=>0x4345412f
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x3c:n 0x57c=>0x412f4e03
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x40:n 0x580=>0x300a4e53
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x44:n 0x584=>0x34333231
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x48:n 0x588=>0x38373635
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x4c:n 0x58c=>0x44e4d39
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x50:n 0x590=>0x34653431
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x54:n 0x594=>0xf285652
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x58:n 0x598=>0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x5c:n 0x59c=>0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x60:n 0x5a0=>0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x64:n 0x5a4=>0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x68:n 0x5a8=>0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x6c:n 0x5ac=>0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x70:n 0x5b0=>0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x74:n 0x5b4=>0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x78:n 0x5b8=>0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x200
Oct 31 10:40:47 apache1-pro kernel: vpd[1]: a 0x7c:n 0x5bc=>0x78000000
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x200->0x0
Oct 31 10:40:47 apache1-pro kernel: f0: LOAD_REQ
Oct 31 10:40:47 apache1-pro kernel: p0: PMF->f0
Oct 31 10:40:47 apache1-pro kernel: f0: LOAD_DONE
Oct 31 10:40:47 apache1-pro kernel: evnt[0] 0x0->0x1000
Oct 31 10:40:47 apache1-pro kernel: evnt[0] 0x1000->0x0
Oct 31 10:40:47 apache1-pro kernel: f1: LOAD_REQ
Oct 31 10:40:47 apache1-pro kernel: p1: PMF->f1
Oct 31 10:40:47 apache1-pro kernel: f1: LOAD_DONE
Oct 31 10:40:47 apache1-pro kernel: evnt[0] 0x0->0x1000
Oct 31 10:40:47 apache1-pro kernel: evnt[0] 0x1000->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[0] 0x0->0x1000
Oct 31 10:40:47 apache1-pro kernel: evnt[0] 0x1000->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x1000
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x1000->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x1000
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x1000->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x0->0x1000
Oct 31 10:40:47 apache1-pro kernel: evnt[1] 0x1000->0x0
Oct 31 10:40:47 apache1-pro kernel: f0: UNLOAD_REQ_WOL_DIS
Oct 31 10:40:47 apache1-pro kernel: f0: UNLOAD_DONE
Oct 31 10:40:47 apache1-pro kernel: f0: LOAD_REQ
Oct 31 10:40:47 apache1-pro kernel: p0: PMF->f0
Oct 31 10:40:47 apache1-pro kernel: f0: LOAD_DONE
Oct 31 10:40:47 apache1-pro kernel: evnt[0] 0x0->0x1000
Oct 31 10:40:47 apache1-pro kernel: evnt[0] 0x1000->0x0
Oct 31 10:40:47 apache1-pro kernel: evnt[0] 0x0->0x1000
Oct 31 10:40:47 apache1-pro kernel: end of fw dump
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_mc_assert:732(eth1)]XSTORM_ASSERT_LIST_INDEX 0x2
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_mc_assert:749(eth1)]XSTORM_ASSERT_INDEX 0x0 = 0x00000000 0x00000000 0x00000000 0x00010014
Oct 31 10:40:47 apache1-pro kernel: [bnx2x_panic_dump:1099(eth1)]end crash dump -----------------
^ permalink raw reply
* [net] i825xx:xscale:8390:freescale: Fix Kconfig dependancies
From: Jeff Kirsher @ 2011-11-02 10:30 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann
i825xx and xscale are "sub" Kconfigs to NET_VENDOR_INTEL, so
NET_VENDOR_INTEL should contain ALL the dependencies of the
"sub" Kconfigs.
Same with 8390 is a "sub" Kconfig to NET_VENDOR_NATSEMI, so
NET_VENDOR_NATSEMI needs to contains ALL the dependencies.
Freescale Kconfig only had fs_enet as a sub Kconfig, and already
contained the needed dependencies, just cleaned up the dependencies.
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/freescale/Kconfig | 3 +--
drivers/net/ethernet/intel/Kconfig | 6 +++++-
drivers/net/ethernet/natsemi/Kconfig | 6 +++++-
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
index 1cf6716..c520cfd 100644
--- a/drivers/net/ethernet/freescale/Kconfig
+++ b/drivers/net/ethernet/freescale/Kconfig
@@ -7,8 +7,7 @@ config NET_VENDOR_FREESCALE
default y
depends on FSL_SOC || QUICC_ENGINE || CPM1 || CPM2 || PPC_MPC512x || \
M523x || M527x || M5272 || M528x || M520x || M532x || \
- ARCH_MXC || ARCH_MXS || \
- (PPC_MPC52xx && PPC_BESTCOMM)
+ ARCH_MXC || ARCH_MXS || (PPC_MPC52xx && PPC_BESTCOMM)
---help---
If you have a network (Ethernet) card belonging to this class, say Y
and read the Ethernet-HOWTO, available from
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 61029dc..7621316 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -5,7 +5,11 @@
config NET_VENDOR_INTEL
bool "Intel devices"
default y
- depends on PCI || PCI_MSI
+ depends on PCI || PCI_MSI || ISA || ISA_DMA_API || ARM || \
+ ARCH_ACORN || MCA || MCA_LEGACY || SNI_RM || SUN3 || \
+ GSC || BVME6000 || MVME16x || ARCH_ENP2611 || \
+ (ARM && ARCH_IXP4XX && IXP4XX_NPE && IXP4XX_QMGR) || \
+ EXPERIMENTAL
---help---
If you have a network (Ethernet) card belonging to this class, say Y
and read the Ethernet-HOWTO, available from
diff --git a/drivers/net/ethernet/natsemi/Kconfig b/drivers/net/ethernet/natsemi/Kconfig
index 4a6b9fd..c708bc3 100644
--- a/drivers/net/ethernet/natsemi/Kconfig
+++ b/drivers/net/ethernet/natsemi/Kconfig
@@ -5,7 +5,11 @@
config NET_VENDOR_NATSEMI
bool "National Semi-conductor devices"
default y
- depends on MCA || MAC || MACH_JAZZ || PCI || XTENSA_PLATFORM_XT2000
+ depends on AMIGA_PCMCIA || ARM || EISA || EXPERIMENTAL || H8300 || \
+ ISA || M32R || MAC || MACH_JAZZ || MACH_TX49XX || MCA || \
+ MCA_LEGACY || MIPS || PCI || PCMCIA || SUPERH || \
+ XTENSA_PLATFORM_XT2000 || ZORRO
+
---help---
If you have a network (Ethernet) card belonging to this class, say Y
and read the Ethernet-HOWTO, available from
--
1.7.6.4
^ permalink raw reply related
* Re: Quick Fair Queue scheduler maturity and examples
From: Eric Dumazet @ 2011-11-02 10:31 UTC (permalink / raw)
To: David Täht; +Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Karel Rericha, bloat
In-Reply-To: <4EB115F7.5070203-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Le mercredi 02 novembre 2011 à 11:05 +0100, David Täht a écrit :
> (Example elided, see thread on netdev)
>
> On 11/02/2011 10:36 AM, Karel Rericha wrote:
> > 2011/10/27 Eric Dumazet<eric.dumazet@gmail.com>:
> > Thanks for example Eric. But it only added more confusion to me now
> > :-) I was under impression (and read somewhere) that QFQ is non work
> > conserving scheduler so I can use it more or less like HTB or HFSC to
> > set bandwidth constraints to flows. But from this example (and from
> > sources/patches/papers I try not to pretend I fully understand) it
> > looks to me like some multiqueue scheduler with arbitrary number of
> > queues and ability to arbitrary assign flows to this queues. So some
> > sort of fair division of available bandwidth to flows without
> > arbitrary bandwidth caps to these flows.
> This is what I want! It may not be what you want...
> > I really dont see what is non work conserving here :-S Please save my
> > soul and enlighten me because I am at dead end now :-)
>
> I initially had great hope for QFQ as I've been saying (mostly
> privately) that "PFIFO_FAST must die" for over a year now. What to
> replace it with is a rather large question, but I felt a start would be
> to adopt some FQ algorithm. Over the last couple weeks I read all the
> papers regarding DRR and QFQ and also poked into the source code and
> like you, am seriously un-enlightened.
>
> I think eric's example is misleading as he divided up the queues by
> bandwidth, rather than flow, in the first tier of his tc hierarchy.
> useful as a test...
It seems there is a bit of misunderstanding here.
QFQ is not a 'all is included' in one qdisc, like SFQ
You really need to setup qfq classes, and describe how packets are
mapped to qfq classes (this is done by an external flow classifier)
It also has no internal (default) flow classifier like SFQ did.
It has of course no bandwidth constraints. If you need to shape and use
QFQ, you'll have to use QFQ + a shaping qdisc. (This is why I used HTB
in my script because I wanted to shape)
If you dont need to shape, you still need to describe/setup qfq classes
and chose appropriate flow classifier.
_______________________________________________
Bloat mailing list
Bloat@lists.bufferbloat.net
https://lists.bufferbloat.net/listinfo/bloat
^ permalink raw reply
* Re: ARP garbage collection issues in 3.1?
From: Anton Blanchard @ 2011-11-02 10:07 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20111102.004820.1600243559959513379.davem@davemloft.net>
Hi Dave,
> > Any ideas how we could make this behave a bit better? I know setting
> > gc_thresh3 higher is the ultimate solution, but if gc_thresh1 and
> > gc_thresh2 are always below the route threshold we should either fix
> > this issue or remove them completely.
>
> The solution is to do refcount'less RCU lookups into the neigh
> tables on every packet send, and long term that's what I intend
> to implement.
>
> That's what's behind making the recent change to make the ARP hash
> cheaper etc.
>
> See slides 5, 6, and 7 in:
>
> http://vger.kernel.org/netconf2011_slides/davem_netconf2011.pdf
>
> Once that's done you can trim whatever neigh entries you want,
> whenever you want.
>
> You are right that the current situation is silly, because if
> we're willing to commit to N routing table entries we might as
> well be willing to commit to N arp table entries as well.
Thanks for clearing it up! Looking forwards to the new scheme :)
Anton
^ permalink raw reply
* Re: Quick Fair Queue scheduler maturity and examples
From: David Täht @ 2011-11-02 10:05 UTC (permalink / raw)
To: Karel Rericha; +Cc: Eric Dumazet, netdev, bloat
In-Reply-To: <CAN==1Ro3Va7JHfOoENu=gJqfaktrqLvpo3NWV8=ZB9OKtyfeYQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3011 bytes --]
(Example elided, see thread on netdev)
On 11/02/2011 10:36 AM, Karel Rericha wrote:
> 2011/10/27 Eric Dumazet<eric.dumazet@gmail.com>:
> Thanks for example Eric. But it only added more confusion to me now
> :-) I was under impression (and read somewhere) that QFQ is non work
> conserving scheduler so I can use it more or less like HTB or HFSC to
> set bandwidth constraints to flows. But from this example (and from
> sources/patches/papers I try not to pretend I fully understand) it
> looks to me like some multiqueue scheduler with arbitrary number of
> queues and ability to arbitrary assign flows to this queues. So some
> sort of fair division of available bandwidth to flows without
> arbitrary bandwidth caps to these flows.
This is what I want! It may not be what you want...
> I really dont see what is non work conserving here :-S Please save my
> soul and enlighten me because I am at dead end now :-)
I initially had great hope for QFQ as I've been saying (mostly
privately) that "PFIFO_FAST must die" for over a year now. What to
replace it with is a rather large question, but I felt a start would be
to adopt some FQ algorithm. Over the last couple weeks I read all the
papers regarding DRR and QFQ and also poked into the source code and
like you, am seriously un-enlightened.
I think eric's example is misleading as he divided up the queues by
bandwidth, rather than flow, in the first tier of his tc hierarchy.
useful as a test...
That said, buried in one of the papers on QFQ is the item that it isn't
entirely fair queuing, as it has a maximum MSS of 5, rather than 1.
Still that would be an improvement over diffserv based classification in
the general case, and being somewhat bursty actually helps with 802.11n
packet aggregation (at present).
Anyway, I've built QFQ into the latest cerowrt and am building it for
another machine, and will try to come up with good ways to configure it
this week.
My use cases are different than yours, however.
On a wireless STA (a laptop) - FQ all flows originating from that box.
This would, for example, jump a DNS packet, ping, or TCP SYN attempt -
to near the beginning of the transmit buffer while another elephant flow
is taking place.
On the AP, FQ across the clients (so aggregation works better and
bittorrent is suppressed), and FQ within each flow from/to that client
(so as to reduce head of line blocking and have better performance for
things like dns/ping/etc) - this would apply to the internal wireless
and wired interfaces. As for the gateway interface, FQ across
originating clients as well (but far more stuff than that needs to happen)
Haven't a clue how to do any of that right at all, at present. Clues
wanted. I emailed one of the authors of QFQ for a clue, no reply as yet....
PS Also along the way whilst poking into that source code I found that
there was already a fifo_drop_head tc queue type, which strikes me as
almost useful for VO and VI wireless queues...
--
Dave Täht
[-- Attachment #2: dave_taht.vcf --]
[-- Type: text/x-vcard, Size: 204 bytes --]
begin:vcard
fn;quoted-printable:Dave T=C3=A4ht
n;quoted-printable:T=C3=A4ht;Dave
email;internet:dave.taht@gmail.com
tel;home:1-239-829-5608
tel;cell:0638645374
x-mozilla-html:FALSE
version:2.1
end:vcard
^ permalink raw reply
* Re: hiberante hangs TCP Re: [EXAMPLE CODE] Parasite thread injection and TCP connection hijacking
From: MyungJoo Ham @ 2011-11-02 9:44 UTC (permalink / raw)
To: Tejun Heo; +Cc: netdev, linux-pm, David Fries, linux-kernel
In-Reply-To: <20111030201618.GA7696@google.com>
On Mon, Oct 31, 2011 at 5:16 AM, Tejun Heo <tj@kernel.org> wrote:
> (cc'ing Rafael and linux-pm)
>
> On Sat, Oct 29, 2011 at 11:48:21PM -0500, David Fries wrote:
>> I saw the write up on this on lwn.net, pretty creative by the way, and
>> it got me thinking about a different checkpoint/restart problem I've
>> been running into. Specifically in hibernating to disk. In the
>> hibernate case active TCP connections hang after resuming, while an
>> idle TCP connection will continue after the system is back up. My
>> observation is the kernel checkpoints itself to memory, enables
>> devices, writes out that checkpoint image to storage, then powers off.
>> The problem is if TCP packets are received while writing to storage,
>> the kernel will continue to queue and ack those TCP packets, but the
>> running kernel and it's network state is shortly lost. When the
>> computer resumes, those TCP byte sequences hang the TCP connection for
>> an extended period of time while the resumed computer refuses to
>> acknowledge the data that was received after checkpointing and the now
>> running kernel knew nothing about, and the other computer tries in
>> vain to resend any data that hadn't yet been acknowledged, which is
>> always after the data that was lost, until one of them eventually
>> gives up.
>>
>> I've been wondering if it was safe or possible to leave any network
>> interfaces down after the checkpoint, or what the right solution would
>> be. I didn't think marking every TCP connection with a ZOMBIE_KERNEL
>> bit just after the kernel checkpoint (for the kernel is walking dead
>> and won't remember anything that happens), and then prevent any TCP
>> acks from being sent for those connections would be the right
>> solution. I've taken to unplugging the physical lan cable,
>> hibernating to disk, and plugging it back in after the system is down,
>> to avoid the problem. Any ideas?
>
> Hmmm... sounds like taking down network interfaces before starting
> hibernation sequence should be enough, which shouldn't be too
> difficult to implement from userland. Rafael, what do you think?
>
> Thanks.
Um... it seems that the "thaw" callbacks of network interfaces or TCP
should do something on this.
Probably, the "thaw" callbacks should make sure that the TCP
connections are closed?
Cheers,
MyungJoo
>
> --
> tejun
> _______________________________________________
> linux-pm mailing list
> linux-pm@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/linux-pm
>
--
MyungJoo Ham, Ph.D.
Mobile Software Platform Lab, DMC Business, Samsung Electronics
^ permalink raw reply
* TCP_CORK questions
From: Mihai Maruseac @ 2011-11-02 9:43 UTC (permalink / raw)
To: kernelnewbies; +Cc: netdev
Hi,
We are using TCP_CORK with TCP_NODELAY. We are setting TCP_NODELAY
first and then setting TCP_CORK before sending a bunch of data
buffers. After sending all the buffers we are clearing TCP_CORK. The
expectation -- as per manpage -- is that when TCP_CORK is set small
data packets will not be sent. When TCP_CORK is removed it will
immediately send out the remaining data even if the remaining amount
is very small.
However, this is not the observed behavior. Small packets are sent at
an approximatively constant rate. Digging further into the manpage for
tcp we saw that there is a 200ms ceiling on the time for which the
output is corked. Can we change this limit somehow? Ideally, in our
case we would like to have userspace mark a socket such that it will
only send full packets as long as it is marked, even if the completion
comes after a long time.
Digging into tcp.c when the socket options are set, we found that if
when setting TCP_NAGLE_CORK we also disable TCP_NAGLE_PUSH the code
works as intended. Is this the right way to solve it? Code comments
suggest that disabling this flag there has no effect.
Thanks,
Mihai
^ permalink raw reply
* Re: Quick Fair Queue scheduler maturity and examples
From: Karel Rericha @ 2011-11-02 9:36 UTC (permalink / raw)
To: Eric Dumazet, netdev
In-Reply-To: <1319732832.2601.43.camel@edumazet-laptop>
2011/10/27 Eric Dumazet <eric.dumazet@gmail.com>:
> Le jeudi 27 octobre 2011 à 18:08 +0200, Eric Dumazet a écrit :
>> Le jeudi 27 octobre 2011 à 14:46 +0200, Karel Rericha a écrit :
>>
>> > Actually I am doing some reseach to replace our main shaping machine
>> > with 60 000+ htb classes, which now saturates 12 core Xeon Westmere to
>> > 30% (there are five gigabit network ports on each interface affinited
>> > to cores). AFAIK QFQ should be O(1) complexity so it would bring
>> > saturation a requirements for number of cores down considerably (HTB
>> > has O(log(N)) complexity).
>> >
>> > I have test machine and about two months to decide if we will stay
>> > with HTB or we will try something else. So it would be VERY helpful,
>> > if you would search you memory instead your dead disk :-) and send me
>> > some example of QFQ usage, if I can ask for a little of your time. I
>> > promise to have results published here in return.
>> >
>> > Thanks, Karel
>> >
>>
>> That seems a good challenge to me ;)
>>
>> First upgrade to a recent kernel with QFQ included.
>> Also upgrade iproute2 to a recent enough version as well.
>>
>> Then you discover "tc ... qfq help" is not that helpful :(
>>
>> # tc qdisc add dev eth3 root qfq help
>> Usage: ... qfq
>>
>> OK, its parameters are :
>>
>> qfq weight num1 [maxpkt BYTES]
>>
>> You should not touch maxpkt, its default value being 2048
>>
>> Oh well, I just tried the obvious and my (remote) machine doesnt answer
>> to me anymore...
>>
>> Time for a bit of debugging I am afraid :(
>
> Never mind, it was an user error :)
>
> Here is what I used during my tests, I guess you can adapt your
> scripts...
>
> DEV=eth3
> RATE="rate 40Mbit"
> TNETS="10.2.2.0/25"
> ALLOT="allot 20000"
>
> tc qdisc del dev dummy0 root 2>/dev/null
>
> tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 rate 1000Mbit \
> bandwidth 1000Mbit
> tc class add dev $DEV parent 1: classid 1:1 \
> est 1sec 8sec cbq allot 10000 mpu 64 \
> rate 1000Mbit prio 1 avpkt 1500 bounded
>
> # output to test nets : 40 Mbit limit
> tc class add dev $DEV parent 1:1 classid 1:11 \
> est 1sec 8sec cbq $ALLOT mpu 64 \
> $RATE prio 2 avpkt 1400 bounded
>
> tc qdisc add dev $DEV parent 1:11 handle 11: \
> est 1sec 8sec qfq
>
> tc filter add dev $DEV protocol ip parent 11: handle 3 \
> flow hash keys rxhash divisor 8
>
> for i in `seq 1 8`
> do
> classid=11:$(printf %x $i)
> tc class add dev $DEV classid $classid qfq
> tc qdisc add dev $DEV parent $classid pfifo limit 30
> done
>
> for privnet in $TNETS
> do
> tc filter add dev $DEV parent 1: protocol ip prio 100 u32 \
> match ip dst $privnet flowid 1:11
> done
>
> tc filter add dev $DEV parent 1: protocol ip prio 100 u32 \
> match ip protocol 0 0x00 flowid 1:1
>
> iperf -u -c 10.2.2.1 -P 32 -l 50
>
>
>
Thanks for example Eric.
But it only added more confusion to me now :-) I was under impression
(and read somewhere) that QFQ is non work conserving scheduler so I
can use it more or less like HTB or HFSC to set bandwidth constraints
to flows. But from this example (and from sources/patches/papers I try
not to pretend I fully understand) it looks to me like some multiqueue
scheduler with arbitrary number of queues and ability to arbitrary
assign flows to this queues. So some sort of fair division of
available bandwidth to flows without arbitrary bandwidth caps to these
flows. I really dont see what is non work conserving here :-S
Please save my soul and enlighten me because I am at dead end now :-)
^ permalink raw reply
* [PATCH v3] IPv6 - support for NLM_F_* flags at routing requests
From: Matti Vaittinen @ 2011-11-02 8:04 UTC (permalink / raw)
To: davem; +Cc: netdev
Once more.. Changed returnvalue -EINVAL to -ENOENT for case
where NLM_F_REPLACE is specified without NLM_F_CREATE, and no
matching route is found.
The support for NLM_F_* flags at IPv6 routing requests.
If no NLM_F_CREATE flag is not defined for RTM_NEWROUTE request,
warning is printed, but no error is returned. Instead new route is added.
Exception is when NLM_F_REPLACE flag is given without NLM_F_CREATE, and
no matching route is found. In this case it should be safe to assume
that the request issuer is familiar with NLM_F_* flags, and does really
not want route to be created.
Specifying NLM_F_REPLACE flag will now make the kernel to search for
matching route, and replace it with new one. If no route is found and
NLM_F_CREATE is specified as well, then new route is created.
Also, specifying NLM_F_EXCL will yield returning of error if matching route
is found.
Signed-off-by: Matti Vaittinen <Mazziesaccount@gmail.com>
---
diff -uNr linux-3.1-rc4.orig/net/ipv6/ip6_fib.c linux-3.1-rc4.new/net/ipv6/ip6_fib.c
--- linux-3.1-rc4.orig/net/ipv6/ip6_fib.c 2011-11-01 14:01:55.000000000 +0200
+++ linux-3.1-rc4.new/net/ipv6/ip6_fib.c 2011-11-02 08:37:21.000000000 +0200
@@ -429,17 +429,34 @@
static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
int addrlen, int plen,
- int offset)
+ int offset, struct nl_info *info)
{
struct fib6_node *fn, *in, *ln;
struct fib6_node *pn = NULL;
struct rt6key *key;
int bit;
+
+
+ int allow_create = 1;
+ int replace_required = 0;
+
+
__be32 dir = 0;
__u32 sernum = fib6_new_sernum();
RT6_TRACE("fib6_add_1\n");
+ if (NULL != info &&
+ NULL != info->nlh &&
+ (info->nlh->nlmsg_flags&NLM_F_REPLACE)) {
+ replace_required = 1;
+ }
+ if (NULL != info &&
+ NULL != info->nlh &&
+ !(info->nlh->nlmsg_flags&NLM_F_CREATE)) {
+ allow_create = 0;
+ }
+
/* insert node in tree */
fn = root;
@@ -451,8 +468,12 @@
* Prefix match
*/
if (plen < fn->fn_bit ||
- !ipv6_prefix_equal(&key->addr, addr, fn->fn_bit))
+ !ipv6_prefix_equal(&key->addr, addr, fn->fn_bit)) {
+ if (!allow_create)
+ printk(KERN_WARNING
+ "NLM_F_CREATE should be specified when creating new rt\n");
goto insert_above;
+ }
/*
* Exact match ?
@@ -481,10 +502,27 @@
fn = dir ? fn->right: fn->left;
} while (fn);
+
+ if (replace_required && !allow_create) {
+ /* We should not create new node because
+ * NLM_F_REPLACE was specified without NLM_F_CREATE
+ * I assume it is safe to require NLM_F_CREATE when
+ * REPLACE flag is used! Later we may want to remove the
+ * check for replace_required, because according
+ * to netlink specification, NLM_F_CREATE
+ * MUST be specified if new route is created.
+ * That would keep IPv6 consistent with IPv4
+ */
+ printk(KERN_WARNING
+ "NLM_F_CREATE should be specified when creating new rt - ignoring request\n");
+ return ERR_PTR(-ENOENT);
+ }
/*
* We walked to the bottom of tree.
* Create new leaf node without children.
*/
+ if (!allow_create)
+ printk(KERN_WARNING "NLM_F_CREATE should be specified when creating new rt\n");
ln = node_alloc();
@@ -567,7 +605,6 @@
fn->parent = in;
ln->fn_sernum = sernum;
-
if (addr_bit_set(addr, bit)) {
in->right = ln;
in->left = fn;
@@ -585,6 +622,7 @@
ln = node_alloc();
+
if (ln == NULL)
return NULL;
@@ -618,6 +656,12 @@
{
struct rt6_info *iter = NULL;
struct rt6_info **ins;
+ int replace = (NULL != info &&
+ NULL != info->nlh &&
+ (info->nlh->nlmsg_flags&NLM_F_REPLACE));
+ int add = ((NULL == info || NULL == info->nlh) ||
+ (info->nlh->nlmsg_flags&NLM_F_CREATE));
+ int found = 0;
ins = &fn->leaf;
@@ -630,6 +674,13 @@
/*
* Same priority level
*/
+ if (NULL != info->nlh &&
+ (info->nlh->nlmsg_flags&NLM_F_EXCL))
+ return -EEXIST;
+ if (replace) {
+ found++;
+ break;
+ }
if (iter->rt6i_dev == rt->rt6i_dev &&
iter->rt6i_idev == rt->rt6i_idev &&
@@ -659,19 +710,41 @@
/*
* insert node
*/
+ if (!replace) {
+ if (!add)
+ printk(KERN_WARNING "NLM_F_CREATE should be specified when creating new rt\n");
+
+add:
+ rt->dst.rt6_next = iter;
+ *ins = rt;
+ rt->rt6i_node = fn;
+ atomic_inc(&rt->rt6i_ref);
+ inet6_rt_notify(RTM_NEWROUTE, rt, info);
+ info->nl_net->ipv6.rt6_stats->fib_rt_entries++;
+
+ if ((fn->fn_flags & RTN_RTINFO) == 0) {
+ info->nl_net->ipv6.rt6_stats->fib_route_nodes++;
+ fn->fn_flags |= RTN_RTINFO;
+ }
- rt->dst.rt6_next = iter;
- *ins = rt;
- rt->rt6i_node = fn;
- atomic_inc(&rt->rt6i_ref);
- inet6_rt_notify(RTM_NEWROUTE, rt, info);
- info->nl_net->ipv6.rt6_stats->fib_rt_entries++;
-
- if ((fn->fn_flags & RTN_RTINFO) == 0) {
- info->nl_net->ipv6.rt6_stats->fib_route_nodes++;
- fn->fn_flags |= RTN_RTINFO;
+ } else {
+ if (!found) {
+ if (add)
+ goto add;
+ printk(KERN_WARNING "add rtinfo to node - NLM_F_REPLACE specified, but no existing node found! bailing out\n");
+ return -ENOENT;
+ }
+ *ins = rt;
+ rt->rt6i_node = fn;
+ rt->dst.rt6_next = iter->dst.rt6_next;
+ atomic_inc(&rt->rt6i_ref);
+ inet6_rt_notify(RTM_NEWROUTE, rt, info);
+ rt6_release(iter);
+ if ((fn->fn_flags & RTN_RTINFO) == 0) {
+ info->nl_net->ipv6.rt6_stats->fib_route_nodes++;
+ fn->fn_flags |= RTN_RTINFO;
+ }
}
-
return 0;
}
@@ -700,10 +773,29 @@
{
struct fib6_node *fn, *pn = NULL;
int err = -ENOMEM;
+ int allow_create = 1;
+ int allow_replace = 1;
+ if (NULL != info &&
+ NULL != info->nlh &&
+ !(info->nlh->nlmsg_flags&NLM_F_REPLACE)) {
+ allow_replace = 0;
+ }
+ if (NULL != info &&
+ NULL != info->nlh &&
+ !(info->nlh->nlmsg_flags&NLM_F_CREATE)) {
+ allow_create = 0;
+ }
+ if (!allow_create && !allow_replace)
+ printk(KERN_WARNING "RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n");
fn = fib6_add_1(root, &rt->rt6i_dst.addr, sizeof(struct in6_addr),
- rt->rt6i_dst.plen, offsetof(struct rt6_info, rt6i_dst));
+ rt->rt6i_dst.plen, offsetof(struct rt6_info, rt6i_dst),
+ info);
+ if (-ENOENT == PTR_ERR(fn)) {
+ err = -ENOENT;
+ fn = NULL;
+ }
if (fn == NULL)
goto out;
@@ -716,6 +808,8 @@
if (fn->subtree == NULL) {
struct fib6_node *sfn;
+ if (!allow_create)
+ printk(KERN_WARNING "NLM_F_CREATE should be specified when creating new rt\n");
/*
* Create subtree.
*
@@ -740,7 +834,8 @@
sn = fib6_add_1(sfn, &rt->rt6i_src.addr,
sizeof(struct in6_addr), rt->rt6i_src.plen,
- offsetof(struct rt6_info, rt6i_src));
+ offsetof(struct rt6_info, rt6i_src),
+ info);
if (sn == NULL) {
/* If it is failed, discard just allocated
@@ -757,8 +852,13 @@
} else {
sn = fib6_add_1(fn->subtree, &rt->rt6i_src.addr,
sizeof(struct in6_addr), rt->rt6i_src.plen,
- offsetof(struct rt6_info, rt6i_src));
+ offsetof(struct rt6_info, rt6i_src),
+ info);
+ if (-ENOENT == PTR_ERR(sn)) {
+ err = -ENOENT;
+ sn = NULL;
+ }
if (sn == NULL)
goto st_failure;
}
diff -uNr linux-3.1-rc4.orig/net/ipv6/route.c linux-3.1-rc4.new/net/ipv6/route.c
--- linux-3.1-rc4.orig/net/ipv6/route.c 2011-11-01 14:01:55.000000000 +0200
+++ linux-3.1-rc4.new/net/ipv6/route.c 2011-10-27 10:45:05.000000000 +0300
@@ -1223,9 +1223,18 @@
if (cfg->fc_metric == 0)
cfg->fc_metric = IP6_RT_PRIO_USER;
- table = fib6_new_table(net, cfg->fc_table);
+ err = -ENOBUFS;
+ if (NULL != cfg->fc_nlinfo.nlh &&
+ !(cfg->fc_nlinfo.nlh->nlmsg_flags&NLM_F_CREATE)) {
+ table = fib6_get_table(net, cfg->fc_table);
+ if (table == NULL) {
+ printk(KERN_WARNING "NLM_F_CREATE should be specified when creating new rt\n");
+ table = fib6_new_table(net, cfg->fc_table);
+ }
+ } else {
+ table = fib6_new_table(net, cfg->fc_table);
+ }
if (table == NULL) {
- err = -ENOBUFS;
goto out;
}
^ permalink raw reply
* Re: [PATCH] flexcan: Fix CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK
From: Kurt Van Dijck @ 2011-11-02 8:04 UTC (permalink / raw)
To: Reuben Dowle; +Cc: netdev, linux-can
In-Reply-To: <70F6AAAFDC054F41B9994A9BCD3DF64E16FAA1DD@exch01-aklnz.MARINE.NET.INT>
On Tue, Nov 01, 2011 at 11:18:03AM +1300, Reuben Dowle wrote:
> Currently the flexcan driver uses hardware local echo. This blindly echos all transmitted frames to all receiving sockets, regardless what CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK are set to.
>
> This patch now submits transmitted frames to be echoed in the transmit complete interrupt, preserving the reference to the sending socket. This allows the can protocol to correctly handle the local echo.
>
> Signed-off-by: Reuben Dowle <reuben.dowle@navico.com>
>
> ---
> drivers/net/can/flexcan.c | 19 +++++++++++++++----
> 1 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index e023379..542ada8 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -302,7 +302,7 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
> flexcan_write(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
> flexcan_write(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
>
> - kfree_skb(skb);
> + can_put_echo_skb(skb, dev, 0);
>
> /* tx_packets is incremented in flexcan_irq */
> stats->tx_bytes += cf->can_dlc;
Why not move the statistics to the place where the echo_skb is popped?
When no frame gets out (due to whatever reason), the statistics may have
incremented.
Or maybe this needs a seperate patch?
The rest looks good.
Kurt
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox