* [PATCH v2 net-next 03/12] 6lowpan: always enable link-layer acknowledgments
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
This feature is especially important when using fragmentation, because
the reassembly mechanism cannot recover from the loss of a fragment.
Note that some hardware ignore this flag and not will not transmit
acknowledgments even if this is set.
Signed-off-by: Tony Cheneau <tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
---
net/ieee802154/6lowpan.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 9f53904..e7f61de 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -584,6 +584,10 @@ static int lowpan_header_create(struct sk_buff *skb,
mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA;
+ /* request acknowledgment when possible */
+ if (!lowpan_is_addr_broadcast(daddr))
+ mac_cb(skb)->flags |= MAC_CB_FLAG_ACKREQ;
+
return dev_hard_header(skb, lowpan_dev_info(dev)->real_dev,
type, (void *)&da, (void *)&sa, skb->len);
}
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
^ permalink raw reply related
* [PATCH v2 net-next 04/12] mac802154: turn on ACK when enabled by the upper layers
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
Signed-off-by: Tony Cheneau <tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
---
net/mac802154/wpan.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index d20c6d3..7d3f659 100644
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -145,6 +145,8 @@ static int mac802154_header_create(struct sk_buff *skb,
head[pos++] = mac_cb(skb)->seq; /* DSN/BSN */
fc = mac_cb_type(skb);
+ if (mac_cb_is_ackreq(skb))
+ fc |= IEEE802154_FC_ACK_REQ;
if (!saddr) {
spin_lock_bh(&priv->mib_lock);
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
^ permalink raw reply related
* [PATCH v2 net-next 05/12] 6lowpan: use short IEEE 802.15.4 addresses for broadcast destination
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
The IEEE 802.15.4 standard uses the 0xFFFF short address (2 bytes) for message
broadcasting.
Signed-off-by: Tony Cheneau <tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
---
net/ieee802154/6lowpan.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index e7f61de..0eebb96 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -572,21 +572,28 @@ static int lowpan_header_create(struct sk_buff *skb,
* this isn't implemented in mainline yet, so currently we assign 0xff
*/
{
+ mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA;
+
/* prepare wpan address data */
sa.addr_type = IEEE802154_ADDR_LONG;
sa.pan_id = 0xff;
-
- da.addr_type = IEEE802154_ADDR_LONG;
- da.pan_id = 0xff;
-
- memcpy(&(da.hwaddr), daddr, 8);
memcpy(&(sa.hwaddr), saddr, 8);
- mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA;
+ da.pan_id = 0xff;
+ /*
+ * if the destination address is the broadcast address, use the
+ * corresponding short address
+ */
+ if (lowpan_is_addr_broadcast(daddr)) {
+ da.addr_type = IEEE802154_ADDR_SHORT;
+ da.short_addr = IEEE802154_ADDR_BROADCAST;
+ } else {
+ da.addr_type = IEEE802154_ADDR_LONG;
+ memcpy(&(da.hwaddr), daddr, 8);
- /* request acknowledgment when possible */
- if (!lowpan_is_addr_broadcast(daddr))
+ /* request acknowledgment */
mac_cb(skb)->flags |= MAC_CB_FLAG_ACKREQ;
+ }
return dev_hard_header(skb, lowpan_dev_info(dev)->real_dev,
type, (void *)&da, (void *)&sa, skb->len);
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
^ permalink raw reply related
* [PATCH v2 net-next 06/12] 6lowpan: fix first fragment (FRAG1) handling
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
The first fragment, FRAG1, must contain some payload according to the
specs. However, as it is currently written, the first fragment will
remain empty and only contain the 6lowpan headers.
This patch also extracts the transport layer information from the first
fragment. This information is used later on when uncompressing UDP
header.
Thanks to Wolf-Bastian Pöttner for noticing that the offset value was
not properly initialized.
Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
---
net/ieee802154/6lowpan.c | 36 +++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 13 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 0eebb96..4a62289 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -661,7 +661,7 @@ static void lowpan_fragment_timer_expired(unsigned long entry_addr)
}
static struct lowpan_fragment *
-lowpan_alloc_new_frame(struct sk_buff *skb, u8 len, u16 tag)
+lowpan_alloc_new_frame(struct sk_buff *skb, u16 len, u16 tag)
{
struct lowpan_fragment *frame;
@@ -731,7 +731,7 @@ lowpan_process_data(struct sk_buff *skb)
{
struct lowpan_fragment *frame;
/* slen stores the rightmost 8 bits of the 11 bits length */
- u8 slen, offset;
+ u8 slen, offset = 0;
u16 len, tag;
bool found = false;
@@ -742,6 +742,12 @@ lowpan_process_data(struct sk_buff *skb)
/* adds the 3 MSB to the 8 LSB to retrieve the 11 bits length */
len = ((iphc0 & 7) << 8) | slen;
+ /* FRAGN */
+ if ((iphc0 & LOWPAN_DISPATCH_MASK) != LOWPAN_DISPATCH_FRAG1) {
+ if (lowpan_fetch_skb_u8(skb, &offset))
+ goto unlock_and_drop;
+ }
+
/*
* check if frame assembling with the same tag is
* already in progress
@@ -761,12 +767,6 @@ lowpan_process_data(struct sk_buff *skb)
goto unlock_and_drop;
}
- if ((iphc0 & LOWPAN_DISPATCH_MASK) == LOWPAN_DISPATCH_FRAG1)
- goto unlock_and_drop;
-
- if (lowpan_fetch_skb_u8(skb, &offset)) /* fetch offset */
- goto unlock_and_drop;
-
/* if payload fits buffer, copy it */
if (likely((offset * 8 + skb->len) <= frame->length))
skb_copy_to_linear_data_offset(frame->skb, offset * 8,
@@ -982,13 +982,13 @@ static int lowpan_get_mac_header_length(struct sk_buff *skb)
static int
lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
- int mlen, int plen, int offset)
+ int mlen, int plen, int offset, int type)
{
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);
+ hlen = (type == LOWPAN_DISPATCH_FRAG1) ?
+ LOWPAN_FRAG1_HEAD_SIZE : LOWPAN_FRAGN_HEAD_SIZE;
lowpan_raw_dump_inline(__func__, "6lowpan fragment header", head, hlen);
@@ -1031,7 +1031,13 @@ lowpan_skb_fragmentation(struct sk_buff *skb)
head[2] = tag >> 8;
head[3] = tag & 0xff;
- err = lowpan_fragment_xmit(skb, head, header_length, 0, 0);
+ err = lowpan_fragment_xmit(skb, head, header_length, LOWPAN_FRAG_SIZE,
+ 0, LOWPAN_DISPATCH_FRAG1);
+
+ if (err)
+ goto exit;
+
+ offset = LOWPAN_FRAG_SIZE;
/* next fragment header */
head[0] &= ~LOWPAN_DISPATCH_FRAG1;
@@ -1046,10 +1052,14 @@ lowpan_skb_fragmentation(struct sk_buff *skb)
len = payload_length - offset;
err = lowpan_fragment_xmit(skb, head, header_length,
- len, offset);
+ len, offset, LOWPAN_DISPATCH_FRAGN);
+ if (err)
+ goto exit;
+
offset += len;
}
+exit:
return err;
}
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel
^ permalink raw reply related
* [PATCH v2 net-next 07/12] 6lowpan: add debug messages for 6LoWPAN fragmentation
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
Add pr_debug() call in order to debug 6LoWPAN fragmentation and
reassembly.
Signed-off-by: Tony Cheneau <tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
---
net/ieee802154/6lowpan.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 4a62289..61eee9d 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -742,10 +742,16 @@ lowpan_process_data(struct sk_buff *skb)
/* adds the 3 MSB to the 8 LSB to retrieve the 11 bits length */
len = ((iphc0 & 7) << 8) | slen;
- /* FRAGN */
- if ((iphc0 & LOWPAN_DISPATCH_MASK) != LOWPAN_DISPATCH_FRAG1) {
+ if ((iphc0 & LOWPAN_DISPATCH_MASK) == LOWPAN_DISPATCH_FRAG1) {
+ pr_debug("%s received a FRAG1 packet (tag: %d, "
+ "size of the entire IP packet: %d)",
+ __func__, tag, len);
+ } else { /* FRAGN */
if (lowpan_fetch_skb_u8(skb, &offset))
goto unlock_and_drop;
+ pr_debug("%s received a FRAGN packet (tag: %d, "
+ "size of the entire IP packet: %d, "
+ "offset: %d)", __func__, tag, len, offset * 8);
}
/*
@@ -762,6 +768,8 @@ lowpan_process_data(struct sk_buff *skb)
/* alloc new frame structure */
if (!found) {
+ pr_debug("%s first fragment received for tag %d, "
+ "begin packet reassembly", __func__, tag);
frame = lowpan_alloc_new_frame(skb, len, tag);
if (!frame)
goto unlock_and_drop;
@@ -784,6 +792,9 @@ lowpan_process_data(struct sk_buff *skb)
list_del(&frame->list);
spin_unlock_bh(&flist_lock);
+ pr_debug("%s successfully reassembled fragment "
+ "(tag %d)", __func__, tag);
+
dev_kfree_skb(skb);
skb = frame->skb;
kfree(frame);
@@ -1034,8 +1045,11 @@ lowpan_skb_fragmentation(struct sk_buff *skb)
err = lowpan_fragment_xmit(skb, head, header_length, LOWPAN_FRAG_SIZE,
0, LOWPAN_DISPATCH_FRAG1);
- if (err)
+ if (err) {
+ pr_debug("%s unable to send FRAG1 packet (tag: %d)",
+ __func__, tag);
goto exit;
+ }
offset = LOWPAN_FRAG_SIZE;
@@ -1053,8 +1067,11 @@ lowpan_skb_fragmentation(struct sk_buff *skb)
err = lowpan_fragment_xmit(skb, head, header_length,
len, offset, LOWPAN_DISPATCH_FRAGN);
- if (err)
+ if (err) {
+ pr_debug("%s unable to send a subsequent FRAGN packet "
+ "(tag: %d, offset: %d", __func__, tag, offset);
goto exit;
+ }
offset += len;
}
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
^ permalink raw reply related
* [PATCH v2 net-next 08/12] 6lowpan: store fragment tag values per device instead of net stack wide
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
Signed-off-by: Tony Cheneau <tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
---
net/ieee802154/6lowpan.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 61eee9d..f952451 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -104,6 +104,7 @@ static const u8 lowpan_llprefix[] = {0xfe, 0x80};
struct lowpan_dev_info {
struct net_device *real_dev; /* real WPAN device ptr */
struct mutex dev_list_mtx; /* mutex for list ops */
+ unsigned short fragment_tag;
};
struct lowpan_dev_record {
@@ -120,7 +121,6 @@ struct lowpan_fragment {
struct list_head list; /* fragments list */
};
-static unsigned short fragment_tag;
static LIST_HEAD(lowpan_fragments);
static DEFINE_SPINLOCK(flist_lock);
@@ -1027,14 +1027,14 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
}
static int
-lowpan_skb_fragmentation(struct sk_buff *skb)
+lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
{
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++;
+ tag = lowpan_dev_info(dev)->fragment_tag++;
/* first fragment header */
head[0] = LOWPAN_DISPATCH_FRAG1 | ((payload_length >> 8) & 0x7);
@@ -1099,7 +1099,7 @@ static netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *dev)
}
pr_debug("frame is too big, fragmentation is needed\n");
- err = lowpan_skb_fragmentation(skb);
+ err = lowpan_skb_fragmentation(skb, dev);
error:
dev_kfree_skb(skb);
out:
@@ -1243,6 +1243,7 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev,
return -ENODEV;
lowpan_dev_info(dev)->real_dev = real_dev;
+ lowpan_dev_info(dev)->fragment_tag = 0;
mutex_init(&lowpan_dev_info(dev)->dev_list_mtx);
entry = kzalloc(sizeof(struct lowpan_dev_record), GFP_KERNEL);
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
^ permalink raw reply related
* [PATCH v2 net-next 09/12] mac802154: add mac802154_dev_get_dsn()
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
Bring-over mac802154_dev_get_dsn() function that was present in the
Linux ZigBee kernel. This function is called by the 6LoWPAN code in
order to properly set the DSN (Data Sequence Number) value in the IEEE
802.15.4 frame.
Signed-off-by: Tony Cheneau <tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
---
net/mac802154/mac802154.h | 1 +
net/mac802154/mac_cmd.c | 1 +
net/mac802154/mib.c | 9 +++++++++
3 files changed, 11 insertions(+)
diff --git a/net/mac802154/mac802154.h b/net/mac802154/mac802154.h
index a4dcaf1..21fa386 100644
--- a/net/mac802154/mac802154.h
+++ b/net/mac802154/mac802154.h
@@ -114,5 +114,6 @@ void mac802154_dev_set_ieee_addr(struct net_device *dev);
u16 mac802154_dev_get_pan_id(const struct net_device *dev);
void mac802154_dev_set_pan_id(struct net_device *dev, u16 val);
void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan);
+u8 mac802154_dev_get_dsn(const struct net_device *dev);
#endif /* MAC802154_H */
diff --git a/net/mac802154/mac_cmd.c b/net/mac802154/mac_cmd.c
index d8d2770..a99910d 100644
--- a/net/mac802154/mac_cmd.c
+++ b/net/mac802154/mac_cmd.c
@@ -73,4 +73,5 @@ struct ieee802154_mlme_ops mac802154_mlme_wpan = {
.start_req = mac802154_mlme_start_req,
.get_pan_id = mac802154_dev_get_pan_id,
.get_short_addr = mac802154_dev_get_short_addr,
+ .get_dsn = mac802154_dev_get_dsn,
};
diff --git a/net/mac802154/mib.c b/net/mac802154/mib.c
index f47781a..f03e55f 100644
--- a/net/mac802154/mib.c
+++ b/net/mac802154/mib.c
@@ -159,6 +159,15 @@ void mac802154_dev_set_pan_id(struct net_device *dev, u16 val)
}
}
+u8 mac802154_dev_get_dsn(const struct net_device *dev)
+{
+ struct mac802154_sub_if_data *priv = netdev_priv(dev);
+
+ BUG_ON(dev->type != ARPHRD_IEEE802154);
+
+ return priv->dsn++;
+}
+
static void phy_chan_notify(struct work_struct *work)
{
struct phy_chan_notify_work *nw = container_of(work,
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
^ permalink raw reply related
* [PATCH v2 net-next 10/12] 6lowpan: obtain IEEE802.15.4 sequence number from the MAC layer
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
Sets the sequence number in the frame format. Without this fix, the sequence
number is always set to 0. This makes trafic analysis very hard.
Signed-off-by: Tony Cheneau <tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
---
net/ieee802154/6lowpan.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index f952451..d1d4ee6 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -573,6 +573,7 @@ static int lowpan_header_create(struct sk_buff *skb,
*/
{
mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA;
+ mac_cb(skb)->seq = ieee802154_mlme_ops(dev)->get_dsn(dev);
/* prepare wpan address data */
sa.addr_type = IEEE802154_ADDR_LONG;
@@ -1127,6 +1128,12 @@ static u16 lowpan_get_short_addr(const struct net_device *dev)
return ieee802154_mlme_ops(real_dev)->get_short_addr(real_dev);
}
+static u8 lowpan_get_dsn(const struct net_device *dev)
+{
+ struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
+ return ieee802154_mlme_ops(real_dev)->get_dsn(real_dev);
+}
+
static struct header_ops lowpan_header_ops = {
.create = lowpan_header_create,
};
@@ -1140,6 +1147,7 @@ static struct ieee802154_mlme_ops lowpan_mlme = {
.get_pan_id = lowpan_get_pan_id,
.get_phy = lowpan_get_phy,
.get_short_addr = lowpan_get_short_addr,
+ .get_dsn = lowpan_get_dsn,
};
static void lowpan_setup(struct net_device *dev)
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
^ permalink raw reply related
* [PATCH v2 net-next 11/12] 6lowpan: use the PANID provided by the device instead of a static value
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
Signed-off-by: Tony Cheneau <tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
---
net/ieee802154/6lowpan.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index d1d4ee6..276971b 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -577,10 +577,12 @@ static int lowpan_header_create(struct sk_buff *skb,
/* prepare wpan address data */
sa.addr_type = IEEE802154_ADDR_LONG;
- sa.pan_id = 0xff;
+ sa.pan_id = ieee802154_mlme_ops(dev)->get_pan_id(dev);
+
memcpy(&(sa.hwaddr), saddr, 8);
+ /* intra-PAN communications */
+ da.pan_id = ieee802154_mlme_ops(dev)->get_pan_id(dev);
- da.pan_id = 0xff;
/*
* if the destination address is the broadcast address, use the
* corresponding short address
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
^ permalink raw reply related
* [PATCH v2 net-next 12/12] 6lowpan: modify udp compression/uncompression to match the standard
From: Tony Cheneau @ 2013-03-26 3:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Alan Ott
In-Reply-To: <1364270372-19430-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
The previous code would just compress the UDP header and send the compressed
UDP header along with the uncompressed one.
Signed-off-by: Tony Cheneau <tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
---
net/ieee802154/6lowpan.c | 39 ++++++++++++++++++++++++++++++++++++---
1 file changed, 36 insertions(+), 3 deletions(-)
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 276971b..c9c3f3d 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -284,6 +284,9 @@ lowpan_compress_udp_header(u8 **hc06_ptr, struct sk_buff *skb)
/* checksum is always inline */
memcpy(*hc06_ptr, &uh->check, 2);
*hc06_ptr += 2;
+
+ /* skip the UDP header */
+ skb_pull(skb, sizeof(struct udphdr));
}
static inline int lowpan_fetch_skb_u8(struct sk_buff *skb, u8 *val)
@@ -309,9 +312,8 @@ static inline int lowpan_fetch_skb_u16(struct sk_buff *skb, u16 *val)
}
static int
-lowpan_uncompress_udp_header(struct sk_buff *skb)
+lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
{
- struct udphdr *uh = udp_hdr(skb);
u8 tmp;
if (!uh)
@@ -358,6 +360,14 @@ lowpan_uncompress_udp_header(struct sk_buff *skb)
/* copy checksum */
memcpy(&uh->check, &skb->data[0], 2);
skb_pull(skb, 2);
+
+ /*
+ * UDP lenght needs to be infered from the lower layers
+ * here, we obtain the hint from the remaining size of the
+ * frame
+ */
+ uh->len = htons(skb->len + sizeof(struct udphdr));
+ pr_debug("uncompressed UDP length: src = %d", uh->len);
} else {
pr_debug("ERROR: unsupported NH format\n");
goto err;
@@ -944,8 +954,31 @@ lowpan_process_data(struct sk_buff *skb)
/* UDP data uncompression */
if (iphc0 & LOWPAN_IPHC_NH_C) {
- if (lowpan_uncompress_udp_header(skb))
+ struct udphdr uh;
+ struct sk_buff *new;
+ if (lowpan_uncompress_udp_header(skb, &uh))
goto drop;
+
+ /*
+ * replace the compressed UDP head by the uncompressed UDP
+ * header
+ */
+ new = skb_copy_expand(skb, sizeof(struct udphdr),
+ skb_tailroom(skb), GFP_ATOMIC);
+ kfree_skb(skb);
+
+ if (!new)
+ return -ENOMEM;
+
+ skb = new;
+
+ skb_push(skb, sizeof(struct udphdr));
+ skb_reset_transport_header(skb);
+ skb_copy_to_linear_data(skb, &uh, sizeof(struct udphdr));
+
+ lowpan_raw_dump_table(__func__, "raw UDP header dump",
+ (u8 *)&uh, sizeof(uh));
+
hdr.nexthdr = UIP_PROTO_UDP;
}
--
1.7.12.4
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
^ permalink raw reply related
* Re: Atheros Communications Inc. AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0) 1.0.0.7 md5/sha1 corrupted using NFS and samba (updated) Version 2
From: Hannes Frederic Sowa @ 2013-03-26 4:27 UTC (permalink / raw)
To: Huang, Xiong; +Cc: Sven Hartge, netdev@vger.kernel.org
In-Reply-To: <157393863283F442885425D2C4542856489E7D1E@nasanexd02f.na.qualcomm.com>
Hello!
On Sun, Mar 24, 2013 at 05:42:41AM +0000, Huang, Xiong wrote:
> 2. try to set hw->dmaw_block = atl1e_dma_req_128
> 3. can you print reg15C0 content when the NIC is in normal tx/rx status ?
> 4. other possible may be related the diff register configuration, but it's very difficult to compare with Windows driver :(
I just wanted to share some more debug information. Perhaps it can help.
Thanks,
Hannes
cat /proc/iomem | grep -i atl1e
fbfc0000-fbffffff : ATL1E
grep -i atl1e /proc/ioports
ec80-ecff : ATL1E
This is a mmiotrace while loading the atl1e module (I switched addresses with
register names):
VERSION 20070824
PCIDEV 0000 808627ac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 agpgart-intel
PCIDEV 0010 808627ae 10 f7f00000 dc81 d0000008 f7ec0000 0 0 2 80000 8 10000000 40000 0 0 0 i915
PCIDEV 0011 808627a6 0 f7f80000 0 0 0 0 0 0 80000 0 0 0 0 0 0
PCIDEV 00d8 808627d8 2c f7eb8004 0 0 0 0 0 0 4000 0 0 0 0 0 0 snd_hda_intel
PCIDEV 00e0 808627d0 28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pcieport
PCIDEV 00e1 808627d2 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pcieport
PCIDEV 00e2 808627d4 2a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pcieport
PCIDEV 00e3 808627d6 2b 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pcieport
PCIDEV 00e8 808627c8 17 0 0 0 0 d481 0 0 0 0 0 0 20 0 0 uhci_hcd
PCIDEV 00e9 808627c9 13 0 0 0 0 d801 0 0 0 0 0 0 20 0 0 uhci_hcd
PCIDEV 00ea 808627ca 12 0 0 0 0 d881 0 0 0 0 0 0 20 0 0 uhci_hcd
PCIDEV 00eb 808627cb 10 0 0 0 0 dc01 0 0 0 0 0 0 20 0 0 uhci_hcd
PCIDEV 00ef 808627cc 17 f7eb7c00 0 0 0 0 0 0 400 0 0 0 0 0 0 ehci-pci
PCIDEV 00f0 80862448 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PCIDEV 00f8 808627b9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 lpc_ich
PCIDEV 00fa 808627c4 13 1f0 3f6 170 376 ffa1 0 0 8 0 8 0 10 0 0 ata_piix
PCIDEV 00fb 808627da 13 0 0 0 0 401 0 0 0 0 0 0 20 0 0
PCIDEV 0400 19691026 11 fbfc0004 0 ec81 0 0 0 0 40000 0 80 0 0 0 0
PCIDEV 0100 18140781 13 fbef0000 0 0 0 0 0 0 10000 0 0 0 0 0 0 rt2800pci
MAP 92.014984 1 0xfbfc0000 0xf8800000 0x40000 0x0 0
R 4 92.016677 1 REG_PHY_STATUS 0x84050000 0x0 0
R 4 92.016695 1 REG_PHY_STATUS 0x84050000 0x0 0
W 2 92.016700 1 REG_GPHY_CTRL 0x3c00 0x0 0
W 2 92.019695 1 REG_GPHY_CTRL 0x3c01 0x0 0
W 4 92.022635 1 REG_MDIO_CTRL 0xdd000b 0x0 0
R 4 92.022654 1 REG_MDIO_CTRL 0x5d000b 0x0 0
W 4 92.022658 1 REG_MDIO_CTRL 0xdebc00 0x0 0
R 4 92.022666 1 REG_MDIO_CTRL 0x5ebc00 0x0 0
W 4 92.022670 1 REG_MDIO_CTRL 0xdd0000 0x0 0
R 4 92.022678 1 REG_MDIO_CTRL 0x5d0000 0x0 0
W 4 92.022682 1 REG_MDIO_CTRL 0xde02ef 0x0 0
R 4 92.022690 1 REG_MDIO_CTRL 0x5e02ef 0x0 0
W 4 92.022694 1 REG_MDIO_CTRL 0xdd0012 0x0 0
R 4 92.022701 1 REG_MDIO_CTRL 0x85d0012 0x0 0
R 4 92.022709 1 REG_MDIO_CTRL 0x5d0012 0x0 0
W 4 92.022713 1 REG_MDIO_CTRL 0xde4c04 0x0 0
R 4 92.022721 1 REG_MDIO_CTRL 0x5e4c04 0x0 0
W 4 92.022725 1 REG_MDIO_CTRL 0xdd0004 0x0 0
R 4 92.022732 1 REG_MDIO_CTRL 0x85d0004 0x0 0
R 4 92.022740 1 REG_MDIO_CTRL 0x5d0004 0x0 0
W 4 92.022744 1 REG_MDIO_CTRL 0xde8bbb 0x0 0
R 4 92.022752 1 REG_MDIO_CTRL 0x85e8bbb 0x0 0
R 4 92.022759 1 REG_MDIO_CTRL 0x5e8bbb 0x0 0
W 4 92.022763 1 REG_MDIO_CTRL 0xdd0005 0x0 0
R 4 92.022771 1 REG_MDIO_CTRL 0x5d0005 0x0 0
W 4 92.022775 1 REG_MDIO_CTRL 0xde2c46 0x0 0
R 4 92.022782 1 REG_MDIO_CTRL 0x85e2c46 0x0 0
R 4 92.022790 1 REG_MDIO_CTRL 0x5e2c46 0x0 0
W 4 92.024634 1 REG_MDIO_CTRL 0xd20c00 0x0 0
R 4 92.024652 1 REG_MDIO_CTRL 0x520c00 0x0 0
W 4 92.024656 1 REG_MDIO_CTRL 0xc40de0 0x0 0
R 4 92.024664 1 REG_MDIO_CTRL 0x440de0 0x0 0
W 4 92.024668 1 REG_MDIO_CTRL 0xc90000 0x0 0
R 4 92.024676 1 REG_MDIO_CTRL 0x490000 0x0 0
W 4 92.024680 1 REG_MDIO_CTRL 0xc09200 0x0 0
R 4 92.024687 1 REG_MDIO_CTRL 0x409200 0x0 0
W 4 92.024698 1 REG_MASTER_CTRL 0x201 0x0 0
R 4 92.026635 1 REG_IDLE_STATUS 0x0 0x0 0
R 4 92.026651 1 REG_SPI_FLASH_CTRL 0x0 0x0 0
R 2 92.026657 1 REG_PCIE_CAP_LIST 0x6c10 0x0 0
R 4 92.026663 1 REG_TWSI_CTRL 0x3e82000 0x0 0
W 4 92.026667 1 REG_TWSI_CTRL 0x3e82800 0x0 0
R 4 92.037681 1 REG_TWSI_CTRL 0x3e82000 0x0 0
R 4 92.037707 1 REG_MAC_STA_ADDR 0x1570b1bc 0x0 0
R 4 92.037716 1 0xfbfc148c 0x22 0x0 0 <--- i don't about this register, no explicit write in source
R 4 92.080874 1 REG_SPI_FLASH_CTRL 0x0 0x0 0
R 2 92.080898 1 REG_PCIE_CAP_LIST 0x6c10 0x0 0
R 4 92.080903 1 REG_SPI_FLASH_CTRL 0x0 0x0 0
R 2 92.080909 1 REG_PCIE_CAP_LIST 0x6c10 0x0 0
R 4 92.103867 1 REG_SPI_FLASH_CTRL 0x0 0x0 0
R 2 92.103889 1 REG_PCIE_CAP_LIST 0x6c10 0x0 0
R 4 92.103895 1 REG_SPI_FLASH_CTRL 0x0 0x0 0
R 2 92.103900 1 REG_PCIE_CAP_LIST 0x6c10 0x0 0
R 4 92.121833 1 0xfbfc1008 0xbffa49c 0x0 0 <--- this register is used without DEFINE
W 4 92.121855 1 0xfbfc1008 0xbffa49c 0x0 0
W 4 92.121859 1 REG_RX_HASH_TABLE 0x0 0x0 0
W 4 92.121862 1 0xfbfc1494 0x0 0x0 0 <--- don't know either
R 4 92.121868 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.121871 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.121874 1 REG_RX_HASH_TABLE 0x0 0x0 0
W 4 92.121877 1 0xfbfc1494 0x0 0x0 0 <--- ?
R 4 92.121884 1 0xfbfc1494 0x0 0x0 0
W 4 92.121887 1 0xfbfc1494 0x40000000 0x0 0
W 4 92.121891 1 REG_IMR 0x0 0x0 0
R 4 92.121896 1 0xfbfc0000 0x10261969 0x0 0
R 4 92.121901 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.121904 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.121908 1 REG_ISR 0xffffffff 0x0 0
W 4 92.121911 1 REG_MAC_STA_ADDR 0x1570b1bc 0x0 0
W 4 92.121914 1 0xfbfc148c 0x22 0x0 0
W 4 92.121917 1 REG_WOL_CTRL 0x0 0x0 0
W 4 92.121921 1 0xfbfc1540 0x0 0x0 0 <--- could be REG_DESC_BASE_ADDR_HI or REG_RXF0_BASE_ADDR_HI
W 4 92.121924 1 REG_TPD_BASE_ADDR_LO 0x33900000 0x0 0
W 4 92.121927 1 REG_TPD_RING_SIZE 0x80 0x0 0
W 4 92.121930 1 REG_HOST_TX_CMB_LO 0x33981400 0x0 0
W 4 92.121933 1 0xfbfc1540 0x0 0x0 0
W 4 92.121936 1 REG_HOST_RXF0_PAGE0_LO 0x33900800 0x0 0
W 4 92.121940 1 REG_HOST_RXF0_MB0_LO 0x33981404 0x0 0
W 1 92.121943 1 REG_HOST_RXF0_MB0_LO 0x1 0x0 0
W 4 92.121946 1 REG_HOST_RXF0_PAGE1_LO 0x33940e00 0x0 0
W 4 92.121949 1 REG_HOST_RXF0_MB1_LO 0x33981408 0x0 0
W 1 92.121952 1 REG_HOST_RXF0_PAGE1_VLD 0x1 0x0 0
W 4 92.121955 1 REG_RXF1_BASE_ADDR_HI 0x0 0x0 0
W 4 92.121958 1 REG_HOST_RXF1_PAGE0_LO 0x0 0x0 0
W 4 92.121961 1 REG_HOST_RXF1_MB0_LO 0x0 0x0 0
W 1 92.121965 1 REG_HOST_RXF1_PAGE0_VLD 0x1 0x0 0
W 4 92.121968 1 REG_HOST_RXF1_PAGE1_LO 0x0 0x0 0
W 4 92.121971 1 REG_HOST_RXF1_MB1_LO 0x0 0x0 0
W 1 92.121974 1 REG_HOST_RXF1_PAGE1_VLD 0x1 0x0 0
W 4 92.121977 1 REG_RXF2_BASE_ADDR_HI 0x0 0x0 0
W 4 92.121980 1 REG_HOST_RXF2_PAGE0_LO 0x0 0x0 0
W 4 92.121983 1 REG_HOST_RXF2_MB0_LO 0x0 0x0 0
W 1 92.121986 1 REG_HOST_RXF2_PAGE0_VLD 0x1 0x0 0
W 4 92.121989 1 REG_HOST_RXF2_PAGE1_LO 0x0 0x0 0
W 4 92.121992 1 REG_HOST_RXF2_MB1_LO 0x0 0x0 0
W 1 92.121995 1 REG_HOST_RXF2_PAGE1_VLD 0x1 0x0 0
W 4 92.121998 1 REG_RXF3_BASE_ADDR_HI 0x0 0x0 0
W 4 92.122002 1 REG_HOST_RXF3_PAGE0_LO 0x0 0x0 0
W 4 92.122005 1 REG_HOST_RXF3_MB0_LO 0x0 0x0 0
W 1 92.122008 1 REG_HOST_RXF3_PAGE0_VLD 0x1 0x0 0
W 4 92.122012 1 REG_HOST_RXF3_PAGE1_LO 0x0 0x0 0
W 4 92.122016 1 REG_HOST_RXF3_MB1_LO 0x0 0x0 0
W 1 92.122019 1 REG_HOST_RXF3_PAGE1_VLD 0x1 0x0 0
W 4 92.122022 1 REG_HOST_RXFPAGE_SIZE 0x40000 0x0 0
W 4 92.122025 1 REG_LOAD_PTR 0x1 0x0 0
W 2 92.122029 1 REG_IRQ_MODU_TIMER_INIT 0x64 0x0 0
W 2 92.122032 1 REG_IRQ_MODU_TIMER2_INIT 0x64 0x0 0
W 4 92.122035 1 REG_MASTER_CTRL 0x224 0x0 0
W 2 92.122039 1 REG_TRIG_RRD_THRESH 0x1 0x0 0
W 2 92.122042 1 REG_TRIG_TPD_THRESH 0x40 0x0 0
W 2 92.122045 1 REG_TRIG_RXTIMER 0x4 0x0 0
W 2 92.122049 1 REG_TRIG_TXTIMER 0x85 0x0 0
W 2 92.122052 1 REG_CMBDISDMA_TIMER 0xc350 0x0 0
W 4 92.122055 1 REG_MTU 0x5f2 0x0 0
W 4 92.122058 1 REG_TX_EARLY_TH 0xbf 0x0 0
R 4 92.122063 1 REG_DEVICE_CTRL 0x1a2000 0x0 0
W 2 92.122067 1 0xfbfc1582 0x200 0x0 0 <--- no idea
W 2 92.122070 1 REG_TXQ_CTRL 0x65 0x0 0
W 2 92.122073 1 REG_RXQ_JMBOSZ_RRDTIM 0x8bf 0x0 0
R 4 92.122078 1 REG_SRAM_RXF_LEN 0x400 0x0 0
W 4 92.122081 1 REG_RXQ_RXF_PAUSE_THRESH 0xcc0333 0x0 0
W 4 92.122085 1 REG_IDT_TABLE0 0x0 0x0 0
W 4 92.122088 1 REG_BASE_CPU_NUMBER 0x0 0x0 0
W 4 92.122091 1 REG_RXQ_CTRL 0xc0000080 0x0 0
W 4 92.122094 1 REG_DMA_CTRL 0x247c24 0x0 0
W 4 92.122097 1 REG_SMB_STAT_TIMER 0x30d40 0x0 0
R 4 92.122102 1 REG_ISR 0x85000000 0x0 0
W 4 92.122105 1 REG_ISR 0x7fffffff 0x0 0
W 4 92.122108 1 REG_ISR 0x0 0x0 0
W 4 92.122111 1 REG_IMR 0x10035d1d 0x0 0
R 4 92.122116 1 0xfbfc0000 0x10261969 0x0 0
R 4 92.122121 1 REG_MASTER_CTRL 0xb0020224 0x0 0
W 4 92.122124 1 REG_MASTER_CTRL 0xb002022c 0x0 0
R 4 92.122133 1 REG_ISR 0x5000004 0x0 0
W 4 92.122137 1 REG_ISR 0x85000004 0x0 0
W 4 92.122140 1 REG_MDIO_CTRL 0xe10000 0x0 0
R 4 92.122148 1 REG_MDIO_CTRL 0x8610000 0x0 0
R 4 92.122155 1 REG_MDIO_CTRL 0x617949 0x0 0
W 4 92.122158 1 REG_MDIO_CTRL 0xe10000 0x0 0
R 4 92.122165 1 REG_MDIO_CTRL 0x8617949 0x0 0
R 4 92.122172 1 REG_MDIO_CTRL 0x617949 0x0 0
W 4 92.122184 1 REG_ISR 0x0 0x0 0
R 4 92.122193 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.122197 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.122200 1 REG_RX_HASH_TABLE 0x0 0x0 0
W 4 92.122203 1 0xfbfc1494 0x0 0x0 0
R 4 92.122208 1 0xfbfc1494 0x0 0x0 0
W 4 92.122211 1 0xfbfc1494 0x40000000 0x0 0
W 4 92.122758 1 REG_MDIO_CTRL 0xe10000 0x0 0
R 4 92.122769 1 REG_MDIO_CTRL 0x617949 0x0 0
W 4 92.122772 1 REG_MDIO_CTRL 0xe10000 0x0 0
R 4 92.122779 1 REG_MDIO_CTRL 0x8617949 0x0 0
R 4 92.122786 1 REG_MDIO_CTRL 0x617949 0x0 0
R 4 92.123005 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.123017 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.123021 1 REG_RX_HASH_TABLE 0x0 0x0 0
W 4 92.123024 1 0xfbfc1494 0x0 0x0 0
R 4 92.123030 1 0xfbfc1494 0x0 0x0 0
W 4 92.123034 1 0xfbfc1494 0x40000000 0x0 0
R 4 92.123240 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.123252 1 REG_MAC_CTRL 0x105c20 0x0 0
W 4 92.123255 1 REG_RX_HASH_TABLE 0x0 0x0 0
W 4 92.123258 1 0xfbfc1494 0x0 0x0 0
R 4 92.123264 1 0xfbfc1494 0x0 0x0 0
W 4 92.123267 1 0xfbfc1494 0x40000000 0x0 0
R 4 92.123272 1 REG_RX_HASH_TABLE 0x0 0x0 0
W 4 92.123276 1 REG_RX_HASH_TABLE 0x80000000 0x0 0
lspci info:
04:00.0 Ethernet controller: Atheros Communications Inc. AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0)
Subsystem: ASUSTeK Computer Inc. Device 8324
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: 32 bytes
Interrupt: pin A routed to IRQ 45
Region 0: Memory at fbfc0000 (64-bit, non-prefetchable) [size=256K]
Region 2: I/O ports at ec80 [size=128]
Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [48] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee0100c Data: 4122
Capabilities: [58] Express (v1) Endpoint, MSI 00
DevCap: MaxPayload 4096 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited
ExtTag- AttnBtn+ AttnInd+ PwrInd+ RBE- FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- UncorrErr+ FatalErr- UnsuppReq+ AuxPwr+ TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s, Latency L0 unlimited, L1 unlimited
ClockPM- Surprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
Capabilities: [6c] Vital Product Data
Unknown small resource type 0b, will not decode more.
Capabilities: [100 v1] 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: 14, GenCap+ CGenEn- ChkCap+ ChkEn-
Capabilities: [180 v1] Device Serial Number ff-70-b1-bc-00-22-15-ff
Kernel driver in use: ATL1E
00: 69 19 26 10 07 04 10 00 b0 00 00 02 08 00 00 00
10: 04 00 fc fb 00 00 00 00 81 ec 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 43 10 24 83
30: 00 00 00 00 40 00 00 00 00 00 00 00 05 01 00 00
40: 01 48 02 c0 00 00 00 00 05 58 81 00 0c 10 e0 fe
50: 00 00 00 00 22 41 00 00 10 6c 01 00 85 7f 00 00
60: 00 20 1a 00 11 f4 03 00 40 00 11 10 03 00 03 90
70: 5a ff 88 14 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 69 19 26 10 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
100: 01 00 01 18 00 00 10 00 00 00 00 00 11 20 06 00
110: 00 00 00 00 00 00 00 00 b4 00 00 00 01 00 00 00
120: 03 04 00 00 00 c0 fb fb 00 00 00 00 00 00 00 00
130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
180: 03 00 01 00 ff 15 22 00 bc b1 70 ff 00 00 00 00
190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
210: 00 00 00 00 00 00 00 00 00 20 e8 03 00 0c 00 00
220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
4f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
7f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
810: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
820: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
860: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
890: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
920: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
940: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
960: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
9f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
aa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ac0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
af0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ba0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
be0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ca0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
cb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
cc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
cd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ce0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
cf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
da0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
db0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
dc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
dd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
de0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
df0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ea0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^ permalink raw reply
* Re: [Eulerkernel] [PATCH] af_unix: dont send SCM_CREDENTIAL when dest socket is NULL
From: Eric Dumazet @ 2013-03-26 4:32 UTC (permalink / raw)
To: dingtianhong; +Cc: David S. Miller, Eric Dumazet, netdev, Li Zefan, Xinwei Hu
In-Reply-To: <51511148.4000804@huawei.com>
On Tue, 2013-03-26 at 11:08 +0800, dingtianhong wrote:
> On 2013/3/25 22:04, Eric Dumazet wrote:
> > On Mon, 2013-03-25 at 18:28 +0800, dingtianhong wrote:
> >> SCM_SCREDENTIALS should apply to write() syscalls only either source or destination
> >> socket asserted SOCK_PASSCRED. The original implememtation in maybe_add_creds is wrong,
> >> and breaks several LSB testcases ( i.e. /tset/LSB.os/netowkr/recvfrom/T.recvfrom).
> >>
> >> Origionally-authored-by: Karel Srot <ksrot@redhat.com>
> >> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> >> ---
> >> net/unix/af_unix.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> >> index 51be64f..99189fd 100644
> >> --- a/net/unix/af_unix.c
> >> +++ b/net/unix/af_unix.c
> >> @@ -1413,8 +1413,8 @@ static void maybe_add_creds(struct sk_buff *skb, const struct socket *sock,
> >> if (UNIXCB(skb).cred)
> >> return;
> >> if (test_bit(SOCK_PASSCRED, &sock->flags) ||
> >> - !other->sk_socket ||
> >> - test_bit(SOCK_PASSCRED, &other->sk_socket->flags)) {
> >> + (other->sk_socket &&
> >> + test_bit(SOCK_PASSCRED, &other->sk_socket->flags))) {
> >> UNIXCB(skb).pid = get_pid(task_tgid(current));
> >> UNIXCB(skb).cred = get_current_cred();
> >> }
> >
> > I am not sure why adding credentials if other->sk_socket is NULL could
> > break an application ?
> The bugzilla has report the bug:https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3523
>
OK
> >
> > This was the case before commit introducing this code.
>
> The commit 16e5726269(af_unix: dont send SCM_CREDENTIALS by default) may introducing the problem.
>
So the problem is that two messages have different credentials,
because other->sk_socket changed between first and second message.
and unix_stream_recvmsg() has the following check :
if (check_creds) {
/* Never glue messages from different writers */
if ((UNIXCB(skb).pid != siocb->scm->pid) ||
(UNIXCB(skb).cred != siocb->scm->cred))
break;
} else {
/* Copy credentials */
scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred);
check_creds = 1;
}
In the case the receiver doesnt care at all (using recvfrom(), not recvmsg()),
we probably should not even call scm_set_creds() and avoid extra refcounting.
^ permalink raw reply
* RE: Atheros Communications Inc. AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0) 1.0.0.7 md5/sha1 corrupted using NFS and samba (updated) Version 2
From: Huang, Xiong @ 2013-03-26 4:34 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: Sven Hartge, netdev@vger.kernel.org
In-Reply-To: <20130326042700.GC29705@order.stressinduktion.org>
Are you sure the NIC is ok for windows driver ? it might be an HW bug, if it’s the case, your checksum verificated by protocol is a workaround.
Thanks
Xiong
^ permalink raw reply
* Re: [PATCH Resend] af_unix: dont send SCM_CREDENTIAL when dest socket is NULL
From: Eric Dumazet @ 2013-03-26 4:38 UTC (permalink / raw)
To: dingtianhong; +Cc: David S. Miller, Eric Dumazet, Li Zefan, Xinwei Hu, netdev
In-Reply-To: <51510FAC.5090605@huawei.com>
On Tue, 2013-03-26 at 11:02 +0800, dingtianhong wrote:
> SCM_SCREDENTIALS should apply to write() syscalls only either source or destination
> socket asserted SOCK_PASSCRED. The original implememtation in maybe_add_creds is wrong,
> and breaks several LSB testcases ( i.e. /tset/LSB.os/netowkr/recvfrom/T.recvfrom).
>
> Origionally-authored-by: Karel Srot <ksrot@redhat.com>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> ---
> net/unix/af_unix.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 51be64f..99189fd 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -1413,8 +1413,8 @@ static void maybe_add_creds(struct sk_buff *skb, const struct socket *sock,
> if (UNIXCB(skb).cred)
> return;
> if (test_bit(SOCK_PASSCRED, &sock->flags) ||
> - !other->sk_socket ||
> - test_bit(SOCK_PASSCRED, &other->sk_socket->flags)) {
> + (other->sk_socket &&
> + test_bit(SOCK_PASSCRED, &other->sk_socket->flags))) {
> UNIXCB(skb).pid = get_pid(task_tgid(current));
> UNIXCB(skb).cred = get_current_cred();
> }
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply
* Re: Atheros Communications Inc. AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0) 1.0.0.7 md5/sha1 corrupted using NFS and samba (updated) Version 2
From: Hannes Frederic Sowa @ 2013-03-26 4:40 UTC (permalink / raw)
To: Huang, Xiong; +Cc: Sven Hartge, netdev@vger.kernel.org
In-Reply-To: <157393863283F442885425D2C4542856489E821B@nasanexd02f.na.qualcomm.com>
On Tue, Mar 26, 2013 at 04:34:36AM +0000, Huang, Xiong wrote:
> Are you sure the NIC is ok for windows driver ? it might be an HW bug, if it’s the case, your checksum verificated by protocol is a workaround.
Yes, the NIC is ok in Windows.
^ permalink raw reply
* RE: Atheros Communications Inc. AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0) 1.0.0.7 md5/sha1 corrupted using NFS and samba (updated) Version 2
From: Huang, Xiong @ 2013-03-26 4:44 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: Sven Hartge, netdev@vger.kernel.org
In-Reply-To: <20130326044025.GD29705@order.stressinduktion.org>
You can try to get windows register setting by
Pci config space register 0x80/0x84
For example, to read register 0x1480
Pci configure write 0x1480 to [0x80] (32bit)
Pci configure read [0x84]
Only 32 bit read/write is allowed.
Thanks
Xiong
> -----Original Message-----
> From: Hannes Frederic Sowa [mailto:hannes@stressinduktion.org]
> Sent: Tuesday, March 26, 2013 12:40 PM
> To: Huang, Xiong
> Cc: Sven Hartge; netdev@vger.kernel.org
> Subject: Re: Atheros Communications Inc. AR8121/AR8113/AR8114 Gigabit or
> Fast Ethernet (rev b0) 1.0.0.7 md5/sha1 corrupted using NFS and samba
> (updated) Version 2
>
> On Tue, Mar 26, 2013 at 04:34:36AM +0000, Huang, Xiong wrote:
> > Are you sure the NIC is ok for windows driver ? it might be an HW bug, if it’s
> the case, your checksum verificated by protocol is a workaround.
>
> Yes, the NIC is ok in Windows.
^ permalink raw reply
* [PATCH net-next] netlink: remove duplicated NLMSG_ALIGN
From: Hong Zhiguo @ 2013-03-26 5:04 UTC (permalink / raw)
To: netdev; +Cc: davem, stephen, zhiguo.hong
NLMSG_HDRLEN is already aligned value. It's for directly reference
without extra alignment.
The redundant alignment here may confuse the API users.
Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
---
include/uapi/linux/netlink.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
index 78d5b8a..32a354f 100644
--- a/include/uapi/linux/netlink.h
+++ b/include/uapi/linux/netlink.h
@@ -78,7 +78,7 @@ struct nlmsghdr {
#define NLMSG_ALIGNTO 4U
#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
-#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
+#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)
#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
--
1.7.10.4
^ permalink raw reply related
* [net-next 1/5] macvtap: set transport header before passing skb to lower device
From: Jason Wang @ 2013-03-26 6:19 UTC (permalink / raw)
To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet
In-Reply-To: <1364278799-37285-1-git-send-email-jasowang@redhat.com>
Set the transport header for 1) some drivers (e.g ixgbe) needs l4 header 2)
precise packet length estimation (introduced in 1def9238) needs l4 header to
compute header length.
For the packets with partial checksum, the patch just set the transport header
to csum_start. Otherwise tries to use skb_flow_dissect() to get l4 offset, if it
fails, just pretend no l4 header.
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/macvtap.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index a449439..acf6450 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -21,6 +21,7 @@
#include <net/rtnetlink.h>
#include <net/sock.h>
#include <linux/virtio_net.h>
+#include <net/flow_keys.h>
/*
* A macvtap queue is the central object of this driver, it connects
@@ -645,6 +646,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
int vnet_hdr_len = 0;
int copylen = 0;
bool zerocopy = false;
+ struct flow_keys keys;
if (q->flags & IFF_VNET_HDR) {
vnet_hdr_len = q->vnet_hdr_sz;
@@ -725,6 +727,13 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
goto err_kfree;
}
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ skb_set_transport_header(skb, skb_checksum_start_offset(skb));
+ else if (skb_flow_dissect(skb, &keys))
+ skb_set_transport_header(skb, keys.thoff);
+ else
+ skb_set_transport_header(skb, ETH_HLEN);
+
rcu_read_lock_bh();
vlan = rcu_dereference_bh(q->vlan);
/* copy skb_ubuf_info for callback when skb has no error */
--
1.7.1
^ permalink raw reply related
* [net-next 2/5] tuntap: set transport header before passing it to kernel
From: Jason Wang @ 2013-03-26 6:19 UTC (permalink / raw)
To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet
In-Reply-To: <1364278799-37285-1-git-send-email-jasowang@redhat.com>
Currently, for the packets receives from tuntap, before doing header check,
kernel just reset the transport header in netif_receive_skb() which pretends no
l4 header. This is suboptimal for precise packet length estimation (introduced
in 1def9238) which needs correct l4 header for gso packets.
So this patch set the transport header to csum_start for partial checksum
packets, otherwise it first try skb_flow_dissect(), if it fails, just reset the
transport header.
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/tun.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 95837c1..48cd73a 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -70,6 +70,7 @@
#include <net/sock.h>
#include <asm/uaccess.h>
+#include <net/flow_keys.h>
/* Uncomment to enable debugging */
/* #define TUN_DEBUG 1 */
@@ -1049,6 +1050,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
bool zerocopy = false;
int err;
u32 rxhash;
+ struct flow_keys keys;
if (!(tun->flags & TUN_NO_PI)) {
if ((len -= sizeof(pi)) > total_len)
@@ -1203,6 +1205,14 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
}
skb_reset_network_header(skb);
+
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ skb_set_transport_header(skb, skb_checksum_start_offset(skb));
+ else if (skb_flow_dissect(skb, &keys))
+ skb_set_transport_header(skb, keys.thoff);
+ else
+ skb_reset_transport_header(skb);
+
rxhash = skb_get_rxhash(skb);
netif_rx_ni(skb);
--
1.7.1
^ permalink raw reply related
* [net-next 3/5] packet: set transport header before doing xmit
From: Jason Wang @ 2013-03-26 6:19 UTC (permalink / raw)
To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet
In-Reply-To: <1364278799-37285-1-git-send-email-jasowang@redhat.com>
Set the transport header for 1) some drivers (e.g ixgbe needs l4 header to do
atr) 2) precise packet length estimation (introduced in 1def9238) needs l4
header to compute header length.
So this patch first tries to get l4 header for packet socket through
skb_flow_dissect(), and pretend no l4 header if skb_flow_dissect() fails.
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/packet/af_packet.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index bd0d14c..83fdd0a 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -88,6 +88,7 @@
#include <linux/virtio_net.h>
#include <linux/errqueue.h>
#include <linux/net_tstamp.h>
+#include <net/flow_keys.h>
#ifdef CONFIG_INET
#include <net/inet_common.h>
@@ -1412,6 +1413,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
__be16 proto = 0;
int err;
int extra_len = 0;
+ struct flow_keys keys;
/*
* Get and verify the address.
@@ -1512,6 +1514,11 @@ retry:
if (unlikely(extra_len == 4))
skb->no_fcs = 1;
+ if (skb_flow_dissect(skb, &keys))
+ skb_set_transport_header(skb, keys.thoff);
+ else
+ skb_reset_transport_header(skb);
+
dev_queue_xmit(skb);
rcu_read_unlock();
return len;
@@ -1918,6 +1925,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
struct page *page;
void *data;
int err;
+ struct flow_keys keys;
ph.raw = frame;
@@ -1943,6 +1951,11 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
skb_reserve(skb, hlen);
skb_reset_network_header(skb);
+ if (skb_flow_dissect(skb, &keys))
+ skb_set_transport_header(skb, keys.thoff);
+ else
+ skb_reset_transport_header(skb);
+
if (po->tp_tx_has_off) {
int off_min, off_max, off;
off_min = po->tp_hdrlen - sizeof(struct sockaddr_ll);
@@ -2199,6 +2212,7 @@ static int packet_snd(struct socket *sock,
unsigned short gso_type = 0;
int hlen, tlen;
int extra_len = 0;
+ struct flow_keys keys;
/*
* Get and verify the address.
@@ -2351,6 +2365,13 @@ static int packet_snd(struct socket *sock,
len += vnet_hdr_len;
}
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ skb_set_transport_header(skb, skb_checksum_start_offset(skb));
+ else if (skb_flow_dissect(skb, &keys))
+ skb_set_transport_header(skb, keys.thoff);
+ else
+ skb_set_transport_header(skb, reserve);
+
if (unlikely(extra_len == 4))
skb->no_fcs = 1;
--
1.7.1
^ permalink raw reply related
* [net-next 4/5] netback: set transport header before passing it to kernel
From: Jason Wang @ 2013-03-26 6:19 UTC (permalink / raw)
To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet, Ian Campbell
In-Reply-To: <1364278799-37285-1-git-send-email-jasowang@redhat.com>
Currently, for the packets receives from netback, before doing header check,
kernel just reset the transport header in netif_receive_skb() which pretends non
l4 header. This is suboptimal for precise packet length estimation (introduced
in 1def9238: net_sched: more precise pkt_len computation) which needs correct l4
header for gso packets.
The patch just reuse the header probed by netback for partial checksum packets
and tries to use skb_flow_dissect() for other cases, if both fail, just pretend
no l4 header.
Cc: Eric Dumazet <edumazet@google.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/xen-netback/netback.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index aa28550..fc8faa7 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -39,6 +39,7 @@
#include <linux/udp.h>
#include <net/tcp.h>
+#include <net/flow_keys.h>
#include <xen/xen.h>
#include <xen/events.h>
@@ -1184,6 +1185,7 @@ static int checksum_setup(struct xenvif *vif, struct sk_buff *skb)
if (th >= skb_tail_pointer(skb))
goto out;
+ skb_set_transport_header(skb, 4 * iph->ihl);
skb->csum_start = th - skb->head;
switch (iph->protocol) {
case IPPROTO_TCP:
@@ -1495,6 +1497,7 @@ static void xen_netbk_tx_submit(struct xen_netbk *netbk)
skb->dev = vif->dev;
skb->protocol = eth_type_trans(skb, skb->dev);
+ skb_reset_network_header(skb);
if (checksum_setup(vif, skb)) {
netdev_dbg(vif->dev,
@@ -1503,6 +1506,15 @@ static void xen_netbk_tx_submit(struct xen_netbk *netbk)
continue;
}
+ if (!skb_transport_header_was_set(skb)) {
+ struct flow_keys keys;
+
+ if (skb_flow_dissect(skb, &keys))
+ skb_set_transport_header(skb, keys.thoff);
+ else
+ skb_reset_transport_header(skb);
+ }
+
vif->dev->stats.rx_bytes += skb->len;
vif->dev->stats.rx_packets++;
--
1.7.1
^ permalink raw reply related
* [net-next 5/5] net_sched: better precise estimation on packet length for untrusted packets
From: Jason Wang @ 2013-03-26 6:19 UTC (permalink / raw)
To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet
In-Reply-To: <1364278799-37285-1-git-send-email-jasowang@redhat.com>
gso_segs were reset to zero when kernel receive packets from untrusted
source. But we use this zero value to estimate precise packet len which is
wrong. So this patch tries to estimate the correct gso_segs value before using
it in qdisc_pkt_len_init().
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/core/dev.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index de930b7..f5ad23b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2588,6 +2588,7 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
*/
if (shinfo->gso_size) {
unsigned int hdr_len;
+ u16 gso_segs = shinfo->gso_segs;
/* mac layer + network layer */
hdr_len = skb_transport_header(skb) - skb_mac_header(skb);
@@ -2597,7 +2598,12 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
hdr_len += tcp_hdrlen(skb);
else
hdr_len += sizeof(struct udphdr);
- qdisc_skb_cb(skb)->pkt_len += (shinfo->gso_segs - 1) * hdr_len;
+
+ if (shinfo->gso_type & SKB_GSO_DODGY)
+ gso_segs = DIV_ROUND_UP(skb->len - hdr_len,
+ shinfo->gso_size);
+
+ qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len;
}
}
--
1.7.1
^ permalink raw reply related
* [net-next 0/5] set transport header for untrusted packets
From: Jason Wang @ 2013-03-26 6:19 UTC (permalink / raw)
To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang
We don't set transport header for untrusted packets in the past, but for the
follwoing reasons, we need to do it now.
- Better packet length estimation (introduced in 1def9238) needs l4 header for
gso packets to compute the header length.
- Some driver needs l4 header (e.g. ixgbe needs tcp header to do atr).
So this patches tries to set transport header for packets from untrusted source
(netback, packet, tuntap, macvtap). Plus a fix for better estimation on packet
length for DODGY packet.
Tested on tun/macvtap/packet, compile test on netback.
Jason Wang (5):
macvtap: set transport header before passing skb to lower device
tuntap: set transport header before passing it to kernel
packet: set transport header before doing xmit
netback: set transport header before passing it to kernel
net_sched: better precise estimation on packet length for untrusted
packets
drivers/net/macvtap.c | 9 +++++++++
drivers/net/tun.c | 10 ++++++++++
drivers/net/xen-netback/netback.c | 12 ++++++++++++
net/core/dev.c | 8 +++++++-
net/packet/af_packet.c | 21 +++++++++++++++++++++
5 files changed, 59 insertions(+), 1 deletions(-)
^ permalink raw reply
* [PATCH 1/3] net: ethernet: wiznet: add CONFIG_PM_SLEEP to suspend/resume functions
From: Jingoo Han @ 2013-03-26 7:02 UTC (permalink / raw)
To: 'David S. Miller'; +Cc: netdev, 'Jingoo Han'
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
build warning when CONFIG_PM_SLEEP is not selected. This is because
sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
the CONFIG_PM_SLEEP is enabled.
drivers/net/ethernet/wiznet/w5100.c:758:12: warning: 'w5100_suspend' defined but not used [-Wunused-function]
drivers/net/ethernet/wiznet/w5100.c:773:12: warning: 'w5100_resume' defined but not used [-Wunused-function]
drivers/net/ethernet/wiznet/w5300.c:670:12: warning: 'w5300_suspend' defined but not used [-Wunused-function]
drivers/net/ethernet/wiznet/w5300.c:685:12: warning: 'w5300_resume' defined but not used [-Wunused-function]
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/net/ethernet/wiznet/w5100.c | 4 ++--
drivers/net/ethernet/wiznet/w5300.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c
index 545043c..a518dca 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -754,7 +754,7 @@ static int w5100_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int w5100_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
@@ -787,7 +787,7 @@ static int w5100_resume(struct device *dev)
}
return 0;
}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
static SIMPLE_DEV_PM_OPS(w5100_pm_ops, w5100_suspend, w5100_resume);
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c
index 7cbd0e6..6e00e3f 100644
--- a/drivers/net/ethernet/wiznet/w5300.c
+++ b/drivers/net/ethernet/wiznet/w5300.c
@@ -666,7 +666,7 @@ static int w5300_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int w5300_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
@@ -699,7 +699,7 @@ static int w5300_resume(struct device *dev)
}
return 0;
}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
static SIMPLE_DEV_PM_OPS(w5300_pm_ops, w5300_suspend, w5300_resume);
--
1.7.2.5
^ permalink raw reply related
* [PATCH 2/3] net: ethernet: atheros: add CONFIG_PM_SLEEP to suspend/resume functions
From: Jingoo Han @ 2013-03-26 7:03 UTC (permalink / raw)
To: 'David S. Miller'; +Cc: netdev, 'Jingoo Han'
In-Reply-To: <001b01ce29ef$f09cbf10$d1d63d30$%han@samsung.com>
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
build warning when CONFIG_PM_SLEEP is not selected. This is because
sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
the CONFIG_PM_SLEEP is enabled.
drivers/net/ethernet/atheros/atlx/atl1.c:2861:12: warning: 'atl1_resume' defined but not used [-Wunused-function]
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/net/ethernet/atheros/atlx/atl1.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index 5b0d993..9948fee 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -2774,7 +2774,7 @@ static int atl1_close(struct net_device *netdev)
return 0;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int atl1_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
--
1.7.2.5
^ permalink raw reply related
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