aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-08-03 01:22:46 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-03 01:22:46 -0400
commit00dad5e479531e379aba7358600cc768725d4f1f (patch)
tree652199eacee32c2cf317f5a54da8265973d29978
parentc477d0447db08068a497e7beb892b2b2a7bff64b (diff)
parent3a3dfb062c2e086c202d34f09ce29634515ad256 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/e1000e/hw.h net/bridge/br_device.c net/bridge/br_input.c
-rw-r--r--drivers/net/e1000e/hw.h2
-rw-r--r--net/bridge/br_device.c8
-rw-r--r--net/bridge/br_fdb.c2
-rw-r--r--net/bridge/br_input.c7
-rw-r--r--net/bridge/br_stp_bpdu.c2
-rw-r--r--net/ipv4/tcp.c7
-rw-r--r--net/sched/act_nat.c3
7 files changed, 19 insertions, 12 deletions
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index 0cd569a57f6d..a419b0715985 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -312,7 +312,7 @@ enum e1e_registers {
312#define E1000_KMRNCTRLSTA_INBAND_PARAM 0x9 /* Kumeran InBand Parameters */ 312#define E1000_KMRNCTRLSTA_INBAND_PARAM 0x9 /* Kumeran InBand Parameters */
313#define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */ 313#define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */
314#define E1000_KMRNCTRLSTA_K1_CONFIG 0x7 314#define E1000_KMRNCTRLSTA_K1_CONFIG 0x7
315#define E1000_KMRNCTRLSTA_K1_ENABLE 0x140E 315#define E1000_KMRNCTRLSTA_K1_ENABLE 0x0002
316#define E1000_KMRNCTRLSTA_HD_CTRL 0x0002 316#define E1000_KMRNCTRLSTA_HD_CTRL 0x0002
317 317
318#define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10 318#define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 075c435ad22d..cf09fe591fc2 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -22,7 +22,7 @@
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23#include "br_private.h" 23#include "br_private.h"
24 24
25/* net device transmit always called with no BH (preempt_disabled) */ 25/* net device transmit always called with BH disabled */
26netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev) 26netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
27{ 27{
28 struct net_bridge *br = netdev_priv(dev); 28 struct net_bridge *br = netdev_priv(dev);
@@ -48,13 +48,16 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
48 skb_reset_mac_header(skb); 48 skb_reset_mac_header(skb);
49 skb_pull(skb, ETH_HLEN); 49 skb_pull(skb, ETH_HLEN);
50 50
51 rcu_read_lock();
51 if (is_multicast_ether_addr(dest)) { 52 if (is_multicast_ether_addr(dest)) {
52 if (unlikely(netpoll_tx_running(dev))) { 53 if (unlikely(netpoll_tx_running(dev))) {
53 br_flood_deliver(br, skb); 54 br_flood_deliver(br, skb);
54 goto out; 55 goto out;
55 } 56 }
56 if (br_multicast_rcv(br, NULL, skb)) 57 if (br_multicast_rcv(br, NULL, skb)) {
58 kfree_skb(skb);
57 goto out; 59 goto out;
60 }
58 61
59 mdst = br_mdb_get(br, skb); 62 mdst = br_mdb_get(br, skb);
60 if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) 63 if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb))
@@ -67,6 +70,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
67 br_flood_deliver(br, skb); 70 br_flood_deliver(br, skb);
68 71
69out: 72out:
73 rcu_read_unlock();
70 return NETDEV_TX_OK; 74 return NETDEV_TX_OK;
71} 75}
72 76
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index a744296fc675..90512ccfd3e9 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -214,7 +214,7 @@ void br_fdb_delete_by_port(struct net_bridge *br,
214 spin_unlock_bh(&br->hash_lock); 214 spin_unlock_bh(&br->hash_lock);
215} 215}
216 216
217/* No locking or refcounting, assumes caller has no preempt (rcu_read_lock) */ 217/* No locking or refcounting, assumes caller has rcu_read_lock */
218struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br, 218struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br,
219 const unsigned char *addr) 219 const unsigned char *addr)
220{ 220{
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 5fc1c5b1c360..826cd5221536 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -39,7 +39,7 @@ static int br_pass_frame_up(struct sk_buff *skb)
39 netif_receive_skb); 39 netif_receive_skb);
40} 40}
41 41
42/* note: already called with rcu_read_lock (preempt_disabled) */ 42/* note: already called with rcu_read_lock */
43int br_handle_frame_finish(struct sk_buff *skb) 43int br_handle_frame_finish(struct sk_buff *skb)
44{ 44{
45 const unsigned char *dest = eth_hdr(skb)->h_dest; 45 const unsigned char *dest = eth_hdr(skb)->h_dest;
@@ -110,7 +110,7 @@ drop:
110 goto out; 110 goto out;
111} 111}
112 112
113/* note: already called with rcu_read_lock (preempt_disabled) */ 113/* note: already called with rcu_read_lock */
114static int br_handle_local_finish(struct sk_buff *skb) 114static int br_handle_local_finish(struct sk_buff *skb)
115{ 115{
116 struct net_bridge_port *p = br_port_get_rcu(skb->dev); 116 struct net_bridge_port *p = br_port_get_rcu(skb->dev);
@@ -133,8 +133,7 @@ static inline int is_link_local(const unsigned char *dest)
133 133
134/* 134/*
135 * Return NULL if skb is handled 135 * Return NULL if skb is handled
136 * note: already called with rcu_read_lock (preempt_disabled) from 136 * note: already called with rcu_read_lock
137 * netif_receive_skb
138 */ 137 */
139struct sk_buff *br_handle_frame(struct sk_buff *skb) 138struct sk_buff *br_handle_frame(struct sk_buff *skb)
140{ 139{
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
index 70aecb48fb69..35cf27087b56 100644
--- a/net/bridge/br_stp_bpdu.c
+++ b/net/bridge/br_stp_bpdu.c
@@ -131,7 +131,7 @@ void br_send_tcn_bpdu(struct net_bridge_port *p)
131/* 131/*
132 * Called from llc. 132 * Called from llc.
133 * 133 *
134 * NO locks, but rcu_read_lock (preempt_disabled) 134 * NO locks, but rcu_read_lock
135 */ 135 */
136void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb, 136void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
137 struct net_device *dev) 137 struct net_device *dev)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 1a700651600b..176e11aaea77 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2187,6 +2187,8 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
2187 GFP_KERNEL); 2187 GFP_KERNEL);
2188 if (cvp == NULL) 2188 if (cvp == NULL)
2189 return -ENOMEM; 2189 return -ENOMEM;
2190
2191 kref_init(&cvp->kref);
2190 } 2192 }
2191 lock_sock(sk); 2193 lock_sock(sk);
2192 tp->rx_opt.cookie_in_always = 2194 tp->rx_opt.cookie_in_always =
@@ -2201,12 +2203,11 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
2201 */ 2203 */
2202 kref_put(&tp->cookie_values->kref, 2204 kref_put(&tp->cookie_values->kref,
2203 tcp_cookie_values_release); 2205 tcp_cookie_values_release);
2204 kref_init(&cvp->kref);
2205 tp->cookie_values = cvp;
2206 } else { 2206 } else {
2207 cvp = tp->cookie_values; 2207 cvp = tp->cookie_values;
2208 } 2208 }
2209 } 2209 }
2210
2210 if (cvp != NULL) { 2211 if (cvp != NULL) {
2211 cvp->cookie_desired = ctd.tcpct_cookie_desired; 2212 cvp->cookie_desired = ctd.tcpct_cookie_desired;
2212 2213
@@ -2220,6 +2221,8 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
2220 cvp->s_data_desired = ctd.tcpct_s_data_desired; 2221 cvp->s_data_desired = ctd.tcpct_s_data_desired;
2221 cvp->s_data_constant = 0; /* false */ 2222 cvp->s_data_constant = 0; /* false */
2222 } 2223 }
2224
2225 tp->cookie_values = cvp;
2223 } 2226 }
2224 release_sock(sk); 2227 release_sock(sk);
2225 return err; 2228 return err;
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c
index 24e614c495f2..d0386a413e8d 100644
--- a/net/sched/act_nat.c
+++ b/net/sched/act_nat.c
@@ -218,6 +218,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a,
218 if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) 218 if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph)))
219 goto drop; 219 goto drop;
220 220
221 icmph = (void *)(skb_network_header(skb) + ihl);
221 iph = (void *)(icmph + 1); 222 iph = (void *)(icmph + 1);
222 if (egress) 223 if (egress)
223 addr = iph->daddr; 224 addr = iph->daddr;
@@ -246,7 +247,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a,
246 iph->saddr = new_addr; 247 iph->saddr = new_addr;
247 248
248 inet_proto_csum_replace4(&icmph->checksum, skb, addr, new_addr, 249 inet_proto_csum_replace4(&icmph->checksum, skb, addr, new_addr,
249 1); 250 0);
250 break; 251 break;
251 } 252 }
252 default: 253 default: