* Re: [3.0.y, 3.2.y, 3.4.y] Re: [PATCH 2/2] [sky2] Fix for interrupt handler
From: Jonathan Nieder @ 2012-11-12 8:24 UTC (permalink / raw)
To: David S. Miller
Cc: Julian Gilbey, Mirko Lindner, Stephen Hemminger, netdev, stable
In-Reply-To: <20121103100447.GA2003@elie.Belkin>
On November 3, Jonathan Nieder wrote:
> On October 25, Jonathan Nieder wrote:
>> Mirko Lindner wrote:
>>> Re-enable interrupts if it is not our interrupt
[...]
>> Tested-by: Julian Gilbey <jdg@debian.org> # 3.2.y, Inspiron 1545
>
> Ping. Dave, is
>
> d663d181b9e9 sky2: Fix for interrupt handler
>
> a candidate for inclusion in 3.0-, 3.2-, and 3.4-stable? (It was
> applied upstream during the 3.6 merge window.)
Please confirm or object so I know you've received this message.
Thanks for maintaining netdev-stable with such attention to quality,
by the way.
Sincerely,
Jonathan
^ permalink raw reply
* Re: [PATCH] kaweth:BQL support
From: David Miller @ 2012-11-12 7:59 UTC (permalink / raw)
To: oliver; +Cc: eric.dumazet, netdev
In-Reply-To: <5350156.Kb3Hv9rKLR@linux-lqwf.site>
From: Oliver Neukum <oliver@neukum.org>
Date: Mon, 12 Nov 2012 08:38:57 +0100
> On Friday 09 November 2012 05:15:44 Eric Dumazet wrote:
>> I am curious to know if it changes anything on the behavior of this
>> network adapter ?
>>
>> Because it seems queue is stopped anyway when a packet is in transmit.
>
> True, I'd need to also do more changes on the tx path.
>
> Dave, for now please disregard the patch.
Ok.
^ permalink raw reply
* [PATCH net-next 2/2] net: unify for_each_ip_tunnel_rcu()
From: Cong Wang @ 2012-11-12 7:52 UTC (permalink / raw)
To: netdev; +Cc: Cong Wang, David S. Miller
In-Reply-To: <1352706754-16594-1-git-send-email-amwang@redhat.com>
The defitions of for_each_ip_tunnel_rcu() are same,
so unify it. Also, don't hide the parameter 't'.
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
include/linux/if_tunnel.h | 7 +++++++
net/ipv4/ip_gre.c | 14 ++++----------
net/ipv4/ip_vti.c | 13 ++++---------
net/ipv4/ipip.c | 13 +++----------
net/ipv6/ip6_gre.c | 14 ++++----------
net/ipv6/sit.c | 13 +++----------
6 files changed, 25 insertions(+), 49 deletions(-)
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 06d1d5b..f4e56ec 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -6,6 +6,13 @@
#include <uapi/linux/if_tunnel.h>
#include <linux/u64_stats_sync.h>
+/*
+ * Locking : hash tables are protected by RCU and RTNL
+ */
+
+#define for_each_ip_tunnel_rcu(pos, start) \
+ for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next))
+
/* often modified stats are per cpu, other are shared (netdev->stats) */
struct pcpu_tstats {
u64 rx_packets;
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 37000ae..127f2a1 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -164,12 +164,6 @@ struct ipgre_net {
#define tunnels_r tunnels[2]
#define tunnels_l tunnels[1]
#define tunnels_wc tunnels[0]
-/*
- * Locking : hash tables are protected by RCU and RTNL
- */
-
-#define for_each_ip_tunnel_rcu(start) \
- for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
static struct rtnl_link_stats64 *ipgre_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot)
@@ -241,7 +235,7 @@ static struct ip_tunnel *ipgre_tunnel_lookup(struct net_device *dev,
ARPHRD_ETHER : ARPHRD_IPGRE;
int score, cand_score = 4;
- for_each_ip_tunnel_rcu(ign->tunnels_r_l[h0 ^ h1]) {
+ for_each_ip_tunnel_rcu(t, ign->tunnels_r_l[h0 ^ h1]) {
if (local != t->parms.iph.saddr ||
remote != t->parms.iph.daddr ||
!(t->dev->flags & IFF_UP))
@@ -268,7 +262,7 @@ static struct ip_tunnel *ipgre_tunnel_lookup(struct net_device *dev,
}
}
- for_each_ip_tunnel_rcu(ign->tunnels_r[h0 ^ h1]) {
+ for_each_ip_tunnel_rcu(t, ign->tunnels_r[h0 ^ h1]) {
if (remote != t->parms.iph.daddr ||
!(t->dev->flags & IFF_UP))
continue;
@@ -294,7 +288,7 @@ static struct ip_tunnel *ipgre_tunnel_lookup(struct net_device *dev,
}
}
- for_each_ip_tunnel_rcu(ign->tunnels_l[h1]) {
+ for_each_ip_tunnel_rcu(t, ign->tunnels_l[h1]) {
if ((local != t->parms.iph.saddr &&
(local != t->parms.iph.daddr ||
!ipv4_is_multicast(local))) ||
@@ -322,7 +316,7 @@ static struct ip_tunnel *ipgre_tunnel_lookup(struct net_device *dev,
}
}
- for_each_ip_tunnel_rcu(ign->tunnels_wc[h1]) {
+ for_each_ip_tunnel_rcu(t, ign->tunnels_wc[h1]) {
if (t->parms.i_key != key ||
!(t->dev->flags & IFF_UP))
continue;
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index e0f2c88..516188b 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -66,11 +66,6 @@ static void vti_tunnel_setup(struct net_device *dev);
static void vti_dev_free(struct net_device *dev);
static int vti_tunnel_bind_dev(struct net_device *dev);
-/* Locking : hash tables are protected by RCU and RTNL */
-
-#define for_each_ip_tunnel_rcu(start) \
- for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
-
#define VTI_XMIT(stats1, stats2) do { \
int err; \
int pkt_len = skb->len; \
@@ -133,19 +128,19 @@ static struct ip_tunnel *vti_tunnel_lookup(struct net *net,
struct ip_tunnel *t;
struct vti_net *ipn = net_generic(net, vti_net_id);
- for_each_ip_tunnel_rcu(ipn->tunnels_r_l[h0 ^ h1])
+ for_each_ip_tunnel_rcu(t, ipn->tunnels_r_l[h0 ^ h1])
if (local == t->parms.iph.saddr &&
remote == t->parms.iph.daddr && (t->dev->flags&IFF_UP))
return t;
- for_each_ip_tunnel_rcu(ipn->tunnels_r[h0])
+ for_each_ip_tunnel_rcu(t, ipn->tunnels_r[h0])
if (remote == t->parms.iph.daddr && (t->dev->flags&IFF_UP))
return t;
- for_each_ip_tunnel_rcu(ipn->tunnels_l[h1])
+ for_each_ip_tunnel_rcu(t, ipn->tunnels_l[h1])
if (local == t->parms.iph.saddr && (t->dev->flags&IFF_UP))
return t;
- for_each_ip_tunnel_rcu(ipn->tunnels_wc[0])
+ for_each_ip_tunnel_rcu(t, ipn->tunnels_wc[0])
if (t && (t->dev->flags&IFF_UP))
return t;
return NULL;
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 3a4ad7d..099fc1c 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -140,13 +140,6 @@ static void ipip_tunnel_setup(struct net_device *dev);
static void ipip_dev_free(struct net_device *dev);
static struct rtnl_link_ops ipip_link_ops __read_mostly;
-/*
- * Locking : hash tables are protected by RCU and RTNL
- */
-
-#define for_each_ip_tunnel_rcu(start) \
- for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
-
static struct rtnl_link_stats64 *ipip_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot)
{
@@ -189,16 +182,16 @@ static struct ip_tunnel *ipip_tunnel_lookup(struct net *net,
struct ip_tunnel *t;
struct ipip_net *ipn = net_generic(net, ipip_net_id);
- for_each_ip_tunnel_rcu(ipn->tunnels_r_l[h0 ^ h1])
+ for_each_ip_tunnel_rcu(t, ipn->tunnels_r_l[h0 ^ h1])
if (local == t->parms.iph.saddr &&
remote == t->parms.iph.daddr && (t->dev->flags&IFF_UP))
return t;
- for_each_ip_tunnel_rcu(ipn->tunnels_r[h0])
+ for_each_ip_tunnel_rcu(t, ipn->tunnels_r[h0])
if (remote == t->parms.iph.daddr && (t->dev->flags&IFF_UP))
return t;
- for_each_ip_tunnel_rcu(ipn->tunnels_l[h1])
+ for_each_ip_tunnel_rcu(t, ipn->tunnels_l[h1])
if (local == t->parms.iph.saddr && (t->dev->flags&IFF_UP))
return t;
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 672101d..823fd64 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -109,12 +109,6 @@ static u32 HASH_ADDR(const struct in6_addr *addr)
#define tunnels_r tunnels[2]
#define tunnels_l tunnels[1]
#define tunnels_wc tunnels[0]
-/*
- * Locking : hash tables are protected by RCU and RTNL
- */
-
-#define for_each_ip_tunnel_rcu(start) \
- for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
static struct rtnl_link_stats64 *ip6gre_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot)
@@ -172,7 +166,7 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
ARPHRD_ETHER : ARPHRD_IP6GRE;
int score, cand_score = 4;
- for_each_ip_tunnel_rcu(ign->tunnels_r_l[h0 ^ h1]) {
+ for_each_ip_tunnel_rcu(t, ign->tunnels_r_l[h0 ^ h1]) {
if (!ipv6_addr_equal(local, &t->parms.laddr) ||
!ipv6_addr_equal(remote, &t->parms.raddr) ||
key != t->parms.i_key ||
@@ -197,7 +191,7 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
}
}
- for_each_ip_tunnel_rcu(ign->tunnels_r[h0 ^ h1]) {
+ for_each_ip_tunnel_rcu(t, ign->tunnels_r[h0 ^ h1]) {
if (!ipv6_addr_equal(remote, &t->parms.raddr) ||
key != t->parms.i_key ||
!(t->dev->flags & IFF_UP))
@@ -221,7 +215,7 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
}
}
- for_each_ip_tunnel_rcu(ign->tunnels_l[h1]) {
+ for_each_ip_tunnel_rcu(t, ign->tunnels_l[h1]) {
if ((!ipv6_addr_equal(local, &t->parms.laddr) &&
(!ipv6_addr_equal(local, &t->parms.raddr) ||
!ipv6_addr_is_multicast(local))) ||
@@ -247,7 +241,7 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
}
}
- for_each_ip_tunnel_rcu(ign->tunnels_wc[h1]) {
+ for_each_ip_tunnel_rcu(t, ign->tunnels_wc[h1]) {
if (t->parms.i_key != key ||
!(t->dev->flags & IFF_UP))
continue;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index ffe83ef..5bce2f6 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -81,13 +81,6 @@ struct sit_net {
struct net_device *fb_tunnel_dev;
};
-/*
- * Locking : hash tables are protected by RCU and RTNL
- */
-
-#define for_each_ip_tunnel_rcu(start) \
- for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
-
static struct rtnl_link_stats64 *ipip6_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot)
{
@@ -133,20 +126,20 @@ static struct ip_tunnel *ipip6_tunnel_lookup(struct net *net,
struct ip_tunnel *t;
struct sit_net *sitn = net_generic(net, sit_net_id);
- for_each_ip_tunnel_rcu(sitn->tunnels_r_l[h0 ^ h1]) {
+ for_each_ip_tunnel_rcu(t, sitn->tunnels_r_l[h0 ^ h1]) {
if (local == t->parms.iph.saddr &&
remote == t->parms.iph.daddr &&
(!dev || !t->parms.link || dev->iflink == t->parms.link) &&
(t->dev->flags & IFF_UP))
return t;
}
- for_each_ip_tunnel_rcu(sitn->tunnels_r[h0]) {
+ for_each_ip_tunnel_rcu(t, sitn->tunnels_r[h0]) {
if (remote == t->parms.iph.daddr &&
(!dev || !t->parms.link || dev->iflink == t->parms.link) &&
(t->dev->flags & IFF_UP))
return t;
}
- for_each_ip_tunnel_rcu(sitn->tunnels_l[h1]) {
+ for_each_ip_tunnel_rcu(t, sitn->tunnels_l[h1]) {
if (local == t->parms.iph.saddr &&
(!dev || !t->parms.link || dev->iflink == t->parms.link) &&
(t->dev->flags & IFF_UP))
--
1.7.7.6
^ permalink raw reply related
* [PATCH net-next 1/2] net: convert __IPTUNNEL_XMIT() to an inline function
From: Cong Wang @ 2012-11-12 7:52 UTC (permalink / raw)
To: netdev; +Cc: Cong Wang, David S. Miller
__IPTUNNEL_XMIT() is an ugly macro, convert it to a static
inline function, so make it more readable.
IPTUNNEL_XMIT() is unused, just remove it.
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
drivers/net/vxlan.c | 2 +-
include/linux/if_tunnel.h | 10 ++++++++++
include/net/ipip.h | 40 +++++++++++++++++++++-------------------
net/ipv4/ip_gre.c | 14 +-------------
net/ipv4/ip_vti.c | 9 ---------
net/ipv4/ipip.c | 14 +-------------
net/ipv6/ip6_gre.c | 9 ---------
net/ipv6/ip6_tunnel.c | 8 --------
net/ipv6/sit.c | 14 +-------------
9 files changed, 35 insertions(+), 85 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 8aca888..9814d67 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -769,7 +769,7 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
vxlan_set_owner(dev, skb);
- /* See __IPTUNNEL_XMIT */
+ /* See iptunnel_xmit() */
skb->ip_summed = CHECKSUM_NONE;
ip_select_ident(iph, &rt->dst, NULL);
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 1cc595a..06d1d5b 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -4,5 +4,15 @@
#include <linux/ip.h>
#include <linux/in6.h>
#include <uapi/linux/if_tunnel.h>
+#include <linux/u64_stats_sync.h>
+
+/* often modified stats are per cpu, other are shared (netdev->stats) */
+struct pcpu_tstats {
+ u64 rx_packets;
+ u64 rx_bytes;
+ u64 tx_packets;
+ u64 tx_bytes;
+ struct u64_stats_sync syncp;
+};
#endif /* _IF_TUNNEL_H_ */
diff --git a/include/net/ipip.h b/include/net/ipip.h
index ddc077c..21947cf 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -48,25 +48,27 @@ struct ip_tunnel_prl_entry {
struct rcu_head rcu_head;
};
-#define __IPTUNNEL_XMIT(stats1, stats2) do { \
- int err; \
- int pkt_len = skb->len - skb_transport_offset(skb); \
- \
- skb->ip_summed = CHECKSUM_NONE; \
- ip_select_ident(iph, &rt->dst, NULL); \
- \
- err = ip_local_out(skb); \
- if (likely(net_xmit_eval(err) == 0)) { \
- u64_stats_update_begin(&(stats1)->syncp); \
- (stats1)->tx_bytes += pkt_len; \
- (stats1)->tx_packets++; \
- u64_stats_update_end(&(stats1)->syncp); \
- } else { \
- (stats2)->tx_errors++; \
- (stats2)->tx_aborted_errors++; \
- } \
-} while (0)
+static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ int err;
+ struct iphdr *iph = ip_hdr(skb);
+ int pkt_len = skb->len - skb_transport_offset(skb);
+ struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats);
-#define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats)
+ nf_reset(skb);
+ skb->ip_summed = CHECKSUM_NONE;
+ ip_select_ident(iph, skb_dst(skb), NULL);
+
+ err = ip_local_out(skb);
+ if (likely(net_xmit_eval(err) == 0)) {
+ u64_stats_update_begin(&tstats->syncp);
+ tstats->tx_bytes += pkt_len;
+ tstats->tx_packets++;
+ u64_stats_update_end(&tstats->syncp);
+ } else {
+ dev->stats.tx_errors++;
+ dev->stats.tx_aborted_errors++;
+ }
+}
#endif
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 7240f8e..37000ae 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -171,15 +171,6 @@ struct ipgre_net {
#define for_each_ip_tunnel_rcu(start) \
for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
-/* often modified stats are per cpu, other are shared (netdev->stats) */
-struct pcpu_tstats {
- u64 rx_packets;
- u64 rx_bytes;
- u64 tx_packets;
- u64 tx_bytes;
- struct u64_stats_sync syncp;
-};
-
static struct rtnl_link_stats64 *ipgre_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot)
{
@@ -753,7 +744,6 @@ drop:
static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
- struct pcpu_tstats *tstats;
const struct iphdr *old_iph = ip_hdr(skb);
const struct iphdr *tiph;
struct flowi4 fl4;
@@ -977,9 +967,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
}
}
- nf_reset(skb);
- tstats = this_cpu_ptr(dev->tstats);
- __IPTUNNEL_XMIT(tstats, &dev->stats);
+ iptunnel_xmit(skb, dev);
return NETDEV_TX_OK;
#if IS_ENABLED(CONFIG_IPV6)
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index 1831092..e0f2c88 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -71,15 +71,6 @@ static int vti_tunnel_bind_dev(struct net_device *dev);
#define for_each_ip_tunnel_rcu(start) \
for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
-/* often modified stats are per cpu, other are shared (netdev->stats) */
-struct pcpu_tstats {
- u64 rx_packets;
- u64 rx_bytes;
- u64 tx_packets;
- u64 tx_bytes;
- struct u64_stats_sync syncp;
-};
-
#define VTI_XMIT(stats1, stats2) do { \
int err; \
int pkt_len = skb->len; \
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 720855e..3a4ad7d 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -147,15 +147,6 @@ static struct rtnl_link_ops ipip_link_ops __read_mostly;
#define for_each_ip_tunnel_rcu(start) \
for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
-/* often modified stats are per cpu, other are shared (netdev->stats) */
-struct pcpu_tstats {
- u64 rx_packets;
- u64 rx_bytes;
- u64 tx_packets;
- u64 tx_bytes;
- struct u64_stats_sync syncp;
-};
-
static struct rtnl_link_stats64 *ipip_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot)
{
@@ -465,7 +456,6 @@ drop:
static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
- struct pcpu_tstats *tstats;
const struct iphdr *tiph = &tunnel->parms.iph;
u8 tos = tunnel->parms.iph.tos;
__be16 df = tiph->frag_off;
@@ -592,9 +582,7 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
if ((iph->ttl = tiph->ttl) == 0)
iph->ttl = old_iph->ttl;
- nf_reset(skb);
- tstats = this_cpu_ptr(dev->tstats);
- __IPTUNNEL_XMIT(tstats, &dev->stats);
+ iptunnel_xmit(skb, dev);
return NETDEV_TX_OK;
tx_error_icmp:
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 12aa473..672101d 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -116,15 +116,6 @@ static u32 HASH_ADDR(const struct in6_addr *addr)
#define for_each_ip_tunnel_rcu(start) \
for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
-/* often modified stats are per cpu, other are shared (netdev->stats) */
-struct pcpu_tstats {
- u64 rx_packets;
- u64 rx_bytes;
- u64 tx_packets;
- u64 tx_bytes;
- struct u64_stats_sync syncp;
-};
-
static struct rtnl_link_stats64 *ip6gre_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot)
{
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 424ed45..8db4d9b 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -95,14 +95,6 @@ struct ip6_tnl_net {
struct ip6_tnl __rcu **tnls[2];
};
-/* often modified stats are per cpu, other are shared (netdev->stats) */
-struct pcpu_tstats {
- unsigned long rx_packets;
- unsigned long rx_bytes;
- unsigned long tx_packets;
- unsigned long tx_bytes;
-} __attribute__((aligned(4*sizeof(unsigned long))));
-
static struct net_device_stats *ip6_get_stats(struct net_device *dev)
{
struct pcpu_tstats sum = { 0 };
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index b543c56..ffe83ef 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -88,15 +88,6 @@ struct sit_net {
#define for_each_ip_tunnel_rcu(start) \
for (t = rcu_dereference(start); t; t = rcu_dereference(t->next))
-/* often modified stats are per cpu, other are shared (netdev->stats) */
-struct pcpu_tstats {
- u64 rx_packets;
- u64 rx_bytes;
- u64 tx_packets;
- u64 tx_bytes;
- struct u64_stats_sync syncp;
-};
-
static struct rtnl_link_stats64 *ipip6_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot)
{
@@ -685,7 +676,6 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
- struct pcpu_tstats *tstats;
const struct iphdr *tiph = &tunnel->parms.iph;
const struct ipv6hdr *iph6 = ipv6_hdr(skb);
u8 tos = tunnel->parms.iph.tos;
@@ -866,9 +856,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
if ((iph->ttl = tiph->ttl) == 0)
iph->ttl = iph6->hop_limit;
- nf_reset(skb);
- tstats = this_cpu_ptr(dev->tstats);
- __IPTUNNEL_XMIT(tstats, &dev->stats);
+ iptunnel_xmit(skb, dev);
return NETDEV_TX_OK;
tx_error_icmp:
--
1.7.7.6
^ permalink raw reply related
* Re: [PATCH] kaweth:BQL support
From: Oliver Neukum @ 2012-11-12 7:38 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, netdev
In-Reply-To: <1352466944.19779.556.camel@edumazet-glaptop>
On Friday 09 November 2012 05:15:44 Eric Dumazet wrote:
> I am curious to know if it changes anything on the behavior of this
> network adapter ?
>
> Because it seems queue is stopped anyway when a packet is in transmit.
True, I'd need to also do more changes on the tx path.
Dave, for now please disregard the patch.
Regards
Oliver
^ permalink raw reply
* Re: [PATCH] usbnet: ratelimit kevent may have been dropped warnings
From: Oliver Neukum @ 2012-11-12 7:16 UTC (permalink / raw)
To: Steve Glendinning; +Cc: netdev
In-Reply-To: <1352391981-15692-1-git-send-email-steve.glendinning@shawell.net>
On Thursday 08 November 2012 16:26:21 Steve Glendinning wrote:
> There's an underlying problem in usbnet's kevent deferral
This is imported from schedule_work().
> mechanism which needs fixing, specifically that events *can*
> get dropped and not handled. This patch doesn't address this,
> but just mitigates fallout caused by the current implemention.
All is not lost, as the flag is still set. How about starting a timer
in the failure case? It feels kind of dirty, but a solution with locks would
leave open a window to a race in any case.
Regards
Oliver
^ permalink raw reply
* KONTO UPPDATERING
From: WEBMAIL @ 2012-11-12 7:03 UTC (permalink / raw)
En DGTFX Virus har upptäckts i vår webb tjänsteleverantör. Ditt e-postkonto måste uppgraderas till vår nya Secured DGTFX antivirusprogram 2011/2012 version för att förhindra skador på vår webb leverantör och dina viktiga filer. Klicka på nedan länk, Fyll kolumnerna och skicka tillbaka till oss eller ditt e-postkonto kommer att avslutas för att undvika spridning av viruset.
aktiveringslänk
http://www.formstack.com/forms/?1326104-EUKetyz1zD
Tack för ditt samarbete.
konto Support
Varning Kod: ID67565453
^ permalink raw reply
* Re: [PATCH] usbnet: ratelimit kevent may have been dropped warnings
From: Oliver Neukum @ 2012-11-12 7:11 UTC (permalink / raw)
To: Steve Glendinning; +Cc: netdev
In-Reply-To: <1352391981-15692-1-git-send-email-steve.glendinning@shawell.net>
On Thursday 08 November 2012 16:26:21 Steve Glendinning wrote:
> when something goes wrong, a flood of these messages can be
> generated by usbnet (thousands per second). This doesn't
> generally *help* the condition so this patch ratelimits the
> rate of their generation.
>
> There's an underlying problem in usbnet's kevent deferral
> mechanism which needs fixing, specifically that events *can*
> get dropped and not handled. This patch doesn't address this,
> but just mitigates fallout caused by the current implemention.
>
> Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
Acked-by: Oliver Neukum <oneukum@suse.de>
^ permalink raw reply
* [PATCH net-next] ipv6: remove obsolete comments in route.c
From: roy.qing.li @ 2012-11-12 6:16 UTC (permalink / raw)
To: netdev
From: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
net/ipv6/route.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c1cfcb7..226aeda 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1385,12 +1385,6 @@ out:
return entries > rt_max_size;
}
-/* Clean host part of a prefix. Not necessary in radix tree,
- but results in cleaner routing tables.
-
- Remove it only when all the things will work!
- */
-
int ip6_dst_hoplimit(struct dst_entry *dst)
{
int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT);
--
1.7.4.1
^ permalink raw reply related
* Re: Pull request for 'davem-next.r8169' branch
From: David Miller @ 2012-11-12 5:27 UTC (permalink / raw)
To: romieu; +Cc: netdev, kirr, dayanidhi.sreenivasan, hayeswang
In-Reply-To: <20121111230128.GA1848@electric-eye.fr.zoreil.com>
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Mon, 12 Nov 2012 00:01:28 +0100
> Please pull from branch 'davem-next.r8169' in repository
>
> git://violet.fr.zoreil.com/romieu/linux davem-next.r8169
>
> to get the changes below.
Pulled, thanks a lot Francois.
^ permalink raw reply
* Re: [PATCH v2 3/3] ipgre: capture inner headers during encapsulation
From: Joseph Gasparakis @ 2012-11-12 3:17 UTC (permalink / raw)
To: David Miller
Cc: joseph.gasparakis, shemminger, chrisw, netdev, linux-kernel,
peter.p.waskiewicz.jr
In-Reply-To: <20121111.220652.1964621381859974031.davem@davemloft.net>
On Sun, 11 Nov 2012, David Miller wrote:
>
> Please post the entire series again when making updates to any of
> the patches, thank you.
>
Will do. Thanks Dave.
^ permalink raw reply
* Re: [PATCH v2 3/3] ipgre: capture inner headers during encapsulation
From: David Miller @ 2012-11-12 3:06 UTC (permalink / raw)
To: joseph.gasparakis
Cc: shemminger, chrisw, netdev, linux-kernel, peter.p.waskiewicz.jr
In-Reply-To: <1352689450-4092-1-git-send-email-joseph.gasparakis@intel.com>
Please post the entire series again when making updates to any of
the patches, thank you.
^ permalink raw reply
* [PATCH v2 3/3] ipgre: capture inner headers during encapsulation
From: Joseph Gasparakis @ 2012-11-12 3:04 UTC (permalink / raw)
To: davem, shemminger, chrisw
Cc: Joseph Gasparakis, netdev, linux-kernel, Peter P Waskiewicz Jr
Populating the inner header pointers of skb for ipgre
This patch has been compile-tested only.
v2 Makes sure that checksumming does not take place if the offload flag is set in the skb's netdev features
Signed-off-by: Joseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---
net/ipv4/ip_gre.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 7240f8e..e35ed52 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -766,8 +766,10 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
int gre_hlen;
__be32 dst;
int mtu;
+ unsigned int offset;
- if (skb->ip_summed == CHECKSUM_PARTIAL &&
+ if (!(skb->dev->features & NETIF_F_HW_CSUM_ENC_BIT) &&
+ skb->ip_summed == CHECKSUM_PARTIAL &&
skb_checksum_help(skb))
goto tx_error;
@@ -902,6 +904,17 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
tunnel->err_count = 0;
}
+ offset = skb->data - skb->head;
+
+ skb_reset_inner_mac_header(skb);
+
+ if (skb->network_header)
+ skb_set_inner_network_header(skb, skb->network_header - offset);
+
+ if (skb->transport_header)
+ skb_set_inner_transport_header(skb, skb->transport_header -
+ offset);
+
max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->dst.header_len;
if (skb_headroom(skb) < max_headroom || skb_shared(skb)||
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH 3/3] ipgre: capture inner headers during encapsulation
From: Joseph Gasparakis @ 2012-11-12 1:47 UTC (permalink / raw)
To: Dmitry Kravkov
Cc: Joseph Gasparakis, davem, shemminger, chrisw, netdev,
linux-kernel, Peter P Waskiewicz Jr
In-Reply-To: <1352647110.5201.4.camel@lb-tlvb-dmitry.il.broadcom.com>
On Sun, 11 Nov 2012, Dmitry Kravkov wrote:
> On Thu, 2012-11-08 at 18:18 -0800, Joseph Gasparakis wrote:
> >
> > if (skb->ip_summed == CHECKSUM_PARTIAL &&
> > skb_checksum_help(skb))
> > @@ -902,6 +903,17 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
> > tunnel->err_count = 0;
> > }
> >
> > + offset = skb->data - skb->head;
> > +
> > + skb_reset_inner_mac_header(skb);
> > +
> > + if (skb->network_header)
> > + skb_set_inner_network_header(skb, skb->network_header - offset);
> > +
> > + if (skb->transport_header)
> > + skb_set_inner_transport_header(skb, skb->transport_header -
> > + offset);
> > +
> > max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->dst.header_len;
> >
> > if (skb_headroom(skb) < max_headroom || skb_shared(skb)||
>
> How it will be useful if skb_checksum_help(skb) will calculate csum? And
> leaves nothing to offload
>
Thanks for catching this Dmitry. Will fix it in v2
^ permalink raw reply
* Re: [PATCH v3 3/9] net: xfrm: use __this_cpu_read per-cpu helper
From: Shan Wei @ 2012-11-12 1:45 UTC (permalink / raw)
To: Christoph Lameter
Cc: steffen.klassert, David Miller, NetDev, Herbert Xu,
Kernel-Maillist
In-Reply-To: <0000013ae6ccff86-695eb9f4-23b6-4196-a575-e12d05e1a659-000000@email.amazonses.com>
Christoph Lameter said, at 2012/11/10 4:12:
> On Fri, 9 Nov 2012, Shan Wei wrote:
>
>> v3 fix compile warning:
>> net/xfrm/xfrm_ipcomp.c: In function 'ipcomp_alloc_tfms':
>> net/xfrm/xfrm_ipcomp.c:285: warning: assignment from incompatible pointer type
>
> Why exactly is the pointer type not compatible? Looks like we have a
> problem here.
>
pos->tfms(struct crypto_comp **tfms) is a double pointer that point to struct crypto_comp.
returned value is a pointer that point to struct crypto_comp;
So, we need to dereference and then read.
+ tfm = __this_cpu_read(*pos->tfms);
I will update this patch in v4 to fix it.
Thanks~
^ permalink raw reply
* Re: [PATCH] iproute2: avoid errors from double-installing manpages
From: Stephen Hemminger @ 2012-11-12 0:23 UTC (permalink / raw)
To: Andreas Henriksson; +Cc: netdev
In-Reply-To: <20121109154241.GA29156@amd64.fatal.se>
On Fri, 9 Nov 2012 16:42:41 +0100
Andreas Henriksson <andreas@fatal.se> wrote:
> Three manpages in man8 are listed twice in MAN8PAGES (both directly and
> in TARGETS) which causes the install command to spit our a couple of
> warnings as below and exiting with non-zero exit code....
>
Applied
^ permalink raw reply
* Re: [PATCH] allow pkg-config to be customized
From: Stephen Hemminger @ 2012-11-12 0:21 UTC (permalink / raw)
To: Mike Frysinger; +Cc: stephen.hemminger, netdev
In-Reply-To: <1352392877-22300-1-git-send-email-vapier@gentoo.org>
On Thu, 8 Nov 2012 11:41:17 -0500
Mike Frysinger <vapier@gentoo.org> wrote:
> Rather than hard coding `pkg-config`, use ${PKG_CONFIG} so people can
> override it to their specific version (like when cross-compiling).
>
> This is the same way the upstream pkg-config code works.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] ipv6: setsockopt(IPIPPROTO_IPV6,IPV6_MINHOPCOUNT) forgot to set return value
From: Stephen Hemminger @ 2012-11-12 0:20 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: netdev
In-Reply-To: <20121111055234.GA28043@order.stressinduktion.org>
Wonder if this ever worked? The patch should go
to stable as well.
The original coding style was prone to these kind of errors
because of the use of "goto e_inval" to do the unlock, and fall through
is prone to these kind of errors.
^ permalink raw reply
* [PATCH v2 2/3] net/macb: add support for phy irq via gpio pin
From: Joachim Eastwood @ 2012-11-11 23:56 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352678188-18647-1-git-send-email-manabian@gmail.com>
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/ethernet/cadence/macb.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 1fac769..ca34efc 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -16,6 +16,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/init.h>
+#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
@@ -261,7 +262,9 @@ static void macb_handle_link_change(struct net_device *dev)
static int macb_mii_probe(struct net_device *dev)
{
struct macb *bp = netdev_priv(dev);
+ struct macb_platform_data *pdata;
struct phy_device *phydev;
+ int phy_irq;
int ret;
phydev = phy_find_first(bp->mii_bus);
@@ -270,7 +273,14 @@ static int macb_mii_probe(struct net_device *dev)
return -1;
}
- /* TODO : add pin_irq */
+ pdata = dev_get_platdata(&bp->pdev->dev);
+ if (pdata && gpio_is_valid(pdata->phy_irq_pin)) {
+ ret = devm_gpio_request(&bp->pdev->dev, pdata->phy_irq_pin, "phy int");
+ if (!ret) {
+ phy_irq = gpio_to_irq(pdata->phy_irq_pin);
+ phydev->irq = (phy_irq < 0) ? PHY_POLL : phy_irq;
+ }
+ }
/* attach the mac to the phy */
ret = phy_connect_direct(dev, phydev, &macb_handle_link_change, 0,
--
1.8.0
^ permalink raw reply related
* [PATCH v2 3/3] net/macb: clear unused address register
From: Joachim Eastwood @ 2012-11-11 23:56 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352678188-18647-1-git-send-email-manabian@gmail.com>
Only the first register set is used for matching but
we support getting the initial hw addr from any of
the registers.
To prevent stale entries and false matches clear unused
register sets. This most important for the at91_ether
driver where u-boot always uses the 2nd register set.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/ethernet/cadence/macb.c | 8 ++++++++
drivers/net/ethernet/cadence/macb.h | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index ca34efc..edb2aba 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -108,6 +108,14 @@ void macb_set_hwaddr(struct macb *bp)
macb_or_gem_writel(bp, SA1B, bottom);
top = cpu_to_le16(*((u16 *)(bp->dev->dev_addr + 4)));
macb_or_gem_writel(bp, SA1T, top);
+
+ /* Clear unused address register sets */
+ macb_or_gem_writel(bp, SA2B, 0);
+ macb_or_gem_writel(bp, SA2T, 0);
+ macb_or_gem_writel(bp, SA3B, 0);
+ macb_or_gem_writel(bp, SA3T, 0);
+ macb_or_gem_writel(bp, SA4B, 0);
+ macb_or_gem_writel(bp, SA4T, 0);
}
EXPORT_SYMBOL_GPL(macb_set_hwaddr);
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 864e380..4414421 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -74,6 +74,12 @@
#define GEM_HRT 0x0084
#define GEM_SA1B 0x0088
#define GEM_SA1T 0x008C
+#define GEM_SA2B 0x0090
+#define GEM_SA2T 0x0094
+#define GEM_SA3B 0x0098
+#define GEM_SA3T 0x009C
+#define GEM_SA4B 0x00A0
+#define GEM_SA4T 0x00A4
#define GEM_OTX 0x0100
#define GEM_DCFG1 0x0280
#define GEM_DCFG2 0x0284
--
1.8.0
^ permalink raw reply related
* [PATCH v2 1/3] net/phy/davicom: add irq functions to DM9161E and DM9161A
From: Joachim Eastwood @ 2012-11-11 23:56 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352678188-18647-1-git-send-email-manabian@gmail.com>
Both these PHYs support interrupt generation on IC pin 32.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/phy/davicom.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index 81c7bc0..383e833 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -150,18 +150,24 @@ static struct phy_driver dm91xx_driver[] = {
.name = "Davicom DM9161E",
.phy_id_mask = 0x0ffffff0,
.features = PHY_BASIC_FEATURES,
+ .flags = PHY_HAS_INTERRUPT,
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
.read_status = genphy_read_status,
+ .ack_interrupt = dm9161_ack_interrupt,
+ .config_intr = dm9161_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = 0x0181b8a0,
.name = "Davicom DM9161A",
.phy_id_mask = 0x0ffffff0,
.features = PHY_BASIC_FEATURES,
+ .flags = PHY_HAS_INTERRUPT,
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
.read_status = genphy_read_status,
+ .ack_interrupt = dm9161_ack_interrupt,
+ .config_intr = dm9161_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = 0x00181b80,
--
1.8.0
^ permalink raw reply related
* [PATCH v2 0/3] macb add support for phy gpio interrupt
From: Joachim Eastwood @ 2012-11-11 23:56 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
Main feature of this patch set is phy gpio interrupt for macb.
There is a couple of concerns about this patch series.
* PHY interrupt support has never been supported with macb before but many board have set phy_irq_pin variable. These board will be swapped over to interrupt handing now and while this should work but one can never be 100% certain.
* at91_ether driver supported interrupt on some PHYs which does not have PHY drivers in phylib or doesn't have interrupt support hooked up.
Patch 1 add interrupt handing to a couple of Davicom PHY that is used on most (all?) Atmel eval boards and was also popular on custom boards.
If the 2nd patch breaks any boards there are 2 possible ways to fix the issue. One would be to go back to polling by setting phy_irq_pin to EINVAL. The other would be add a proper PHY driver with interrupt support for the PHY in question.
I would be grateful if anyone can test the 2 first patches on any AT91 boards that they might have access to. If there is any breakage I am more than willing to help out.
Patch series was tested on a custom board with DM9161AEP and AT91RM9200 EMAC.
Last patch in this series is unrelated to the phy stuff. It's is a small fix for macb hw set addr functions when used in at91_ether.
v2: set PHY_HAS_INTERRUPT in phy_driver flags.
Joachim Eastwood (3):
net/phy/davicom: add irq functions to DM9161E and DM9161A
net/macb: add support for phy irq via gpio pin
net/macb: clear unused address register
drivers/net/ethernet/cadence/macb.c | 20 +++++++++++++++++++-
drivers/net/ethernet/cadence/macb.h | 6 ++++++
drivers/net/phy/davicom.c | 6 ++++++
3 files changed, 31 insertions(+), 1 deletion(-)
--
1.8.0
^ permalink raw reply
* Pull request for 'davem-next.r8169' branch
From: Francois Romieu @ 2012-11-11 23:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Kirill Smelkov, Dayanidhi Sreenivasan, Hayes Wang
Please pull from branch 'davem-next.r8169' in repository
git://violet.fr.zoreil.com/romieu/linux davem-next.r8169
to get the changes below.
Distance from 'davem-next' (d4185bbf62a5d8d777ee445db1581beb17882a07)
---------------------------------------------------------------------
810f4893e93b4e074be6b7a7cc6a36a1f2c51aa8
ac50974b37f2763aa8c6e6626e17694af468b9ad
Diffstat
--------
drivers/net/ethernet/realtek/r8169.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
Shortlog
--------
Dayanidhi Sreenivasan (1):
r8169: remove unused macros.
Kirill Smelkov (1):
r8169: Drop tp arg from rtl8169_tx_vlan_tag()
Patch
-----
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 50a55fb..248f883 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -84,17 +84,12 @@ static const int multicast_filter_limit = 32;
#define R8169_NAPI_WEIGHT 64
#define NUM_TX_DESC 64 /* Number of Tx descriptor registers */
#define NUM_RX_DESC 256 /* Number of Rx descriptor registers */
-#define RX_BUF_SIZE 1536 /* Rx Buffer size */
#define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc))
#define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc))
#define RTL8169_TX_TIMEOUT (6*HZ)
#define RTL8169_PHY_TIMEOUT (10*HZ)
-#define RTL_EEPROM_SIG cpu_to_le32(0x8129)
-#define RTL_EEPROM_SIG_MASK cpu_to_le32(0xffff)
-#define RTL_EEPROM_SIG_ADDR 0x0000
-
/* write/read MMIO register */
#define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg))
#define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg))
@@ -1819,8 +1814,7 @@ static int rtl8169_set_features(struct net_device *dev,
}
-static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp,
- struct sk_buff *skb)
+static inline u32 rtl8169_tx_vlan_tag(struct sk_buff *skb)
{
return (vlan_tx_tag_present(skb)) ?
TxVlanTag | swab16(vlan_tx_tag_get(skb)) : 0x00;
@@ -5821,7 +5815,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
tp->tx_skb[entry].len = len;
txd->addr = cpu_to_le64(mapping);
- opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(tp, skb));
+ opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(skb));
opts[0] = DescOwn;
rtl8169_tso_csum(tp, skb, opts);
--
Ueimor
^ permalink raw reply related
* Re: [PATCH v3 8/7] pppoatm: fix missing wakeup in pppoatm_send()
From: Chas Williams (CONTRACTOR) @ 2012-11-11 22:57 UTC (permalink / raw)
To: David Woodhouse; +Cc: Krzysztof Mazur, netdev, linux-kernel, davem
In-Reply-To: <1352667081.9449.135.camel@shinybook.infradead.org>
In message <1352667081.9449.135.camel@shinybook.infradead.org>,David Woodhouse writes:
>Acked-by: David Woodhouse <David.Woodhouse@intel.com> for your new
>version of patch #6 (returning DROP_PACKET for !VF_READY), and your
>followup to my patch #8, adding the 'need_wakeup' flag. Which we might
>as well merge into (the pppoatm part of) my patch.
>
>Chas, are you happy with the generic ATM part of that? And the
>nomenclature? I didn't want to call it 'release_cb' like the core socket
>code does, because we use 'release' to mean something different in ATM.
>So I called it 'unlock_cb' instead...
i really would prefer not to use a strange name since it might confuse
larger group of people who are more familiar with the traditional meaning
of this function. vcc_release() isnt exported so we could rename it if
things get too confusing.
i have to look at this a bit more but we might be able to use release_cb
to get rid of the null push to detach the underlying protocol. that would
be somewhat nice.
^ permalink raw reply
* Re: [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt()
From: David Miller @ 2012-11-11 22:50 UTC (permalink / raw)
To: xi.wang; +Cc: netdev
In-Reply-To: <50A0244F.1070302@gmail.com>
From: Xi Wang <xi.wang@gmail.com>
Date: Sun, 11 Nov 2012 17:18:55 -0500
> On 11/11/12 5:02 PM, David Miller wrote:
>>
>> This code is a fast bit test on purpose. You're making the
>> code slower.
>
> No, it's the opposite. All modern compilers optimize switch cases
> into a fast bit test.
Indeed, I even checked sparc64 with gcc-4.6 and it looks good.
Thanks for the clarification, I'll apply this, thanks.
^ 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