Commit fb412d40 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 80b8bedf 077a63ea
...@@ -1709,12 +1709,13 @@ flush ...@@ -1709,12 +1709,13 @@ flush
Writing to this file results in a flush of the routing cache. Writing to this file results in a flush of the routing cache.
gc_elasticity, gc_interval, gc_min_interval, gc_tresh, gc_timeout, gc_elasticity, gc_interval, gc_min_interval_ms, gc_timeout, gc_thresh
gc_thresh, gc_thresh1, gc_thresh2, gc_thresh3 ---------------------------------------------------------------------
--------------------------------------------------------------
Values to control the frequency and behavior of the garbage collection Values to control the frequency and behavior of the garbage collection
algorithm for the routing cache. algorithm for the routing cache. gc_min_interval is deprecated and replaced
by gc_min_interval_ms.
max_size max_size
-------- --------
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
#define DRV_MODULE_NAME "tg3" #define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.19" #define DRV_MODULE_VERSION "3.20"
#define DRV_MODULE_RELDATE "January 26, 2005" #define DRV_MODULE_RELDATE "February 2, 2005"
#define TG3_DEF_MAC_MODE 0 #define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0 #define TG3_DEF_RX_MODE 0
...@@ -2146,8 +2146,9 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) ...@@ -2146,8 +2146,9 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
if (tr32(TG3PCI_DUAL_MAC_CTRL) & DUAL_MAC_CTRL_ID) if (tr32(TG3PCI_DUAL_MAC_CTRL) & DUAL_MAC_CTRL_ID)
port_a = 0; port_a = 0;
serdes_cfg = tr32(MAC_SERDES_CFG) & /* preserve bits 0-11,13,14 for signal pre-emphasis */
((1 << 23) | (1 << 22) | (1 << 21) | (1 << 20)); /* preserve bits 20-23 for voltage regulator */
serdes_cfg = tr32(MAC_SERDES_CFG) & 0x00f06fff;
} }
sg_dig_ctrl = tr32(SG_DIG_CTRL); sg_dig_ctrl = tr32(SG_DIG_CTRL);
...@@ -2158,9 +2159,9 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) ...@@ -2158,9 +2159,9 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
u32 val = serdes_cfg; u32 val = serdes_cfg;
if (port_a) if (port_a)
val |= 0xc010880; val |= 0xc010000;
else else
val |= 0x4010880; val |= 0x4010000;
tw32_f(MAC_SERDES_CFG, val); tw32_f(MAC_SERDES_CFG, val);
} }
tw32_f(SG_DIG_CTRL, 0x01388400); tw32_f(SG_DIG_CTRL, 0x01388400);
...@@ -2183,7 +2184,7 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) ...@@ -2183,7 +2184,7 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
if (sg_dig_ctrl != expected_sg_dig_ctrl) { if (sg_dig_ctrl != expected_sg_dig_ctrl) {
if (workaround) if (workaround)
tw32_f(MAC_SERDES_CFG, serdes_cfg | 0xc011880); tw32_f(MAC_SERDES_CFG, serdes_cfg | 0xc011000);
tw32_f(SG_DIG_CTRL, expected_sg_dig_ctrl | (1 << 30)); tw32_f(SG_DIG_CTRL, expected_sg_dig_ctrl | (1 << 30));
udelay(5); udelay(5);
tw32_f(SG_DIG_CTRL, expected_sg_dig_ctrl); tw32_f(SG_DIG_CTRL, expected_sg_dig_ctrl);
...@@ -2224,9 +2225,9 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) ...@@ -2224,9 +2225,9 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
u32 val = serdes_cfg; u32 val = serdes_cfg;
if (port_a) if (port_a)
val |= 0xc010880; val |= 0xc010000;
else else
val |= 0x4010880; val |= 0x4010000;
tw32_f(MAC_SERDES_CFG, val); tw32_f(MAC_SERDES_CFG, val);
} }
...@@ -2234,8 +2235,12 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) ...@@ -2234,8 +2235,12 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
tw32_f(SG_DIG_CTRL, 0x01388400); tw32_f(SG_DIG_CTRL, 0x01388400);
udelay(40); udelay(40);
/* Link parallel detection - link is up */
/* only if we have PCS_SYNC and not */
/* receiving config code words */
mac_status = tr32(MAC_STATUS); mac_status = tr32(MAC_STATUS);
if (mac_status & MAC_STATUS_PCS_SYNCED) { if ((mac_status & MAC_STATUS_PCS_SYNCED) &&
!(mac_status & MAC_STATUS_RCVD_CFG)) {
tg3_setup_flow_control(tp, 0, 0); tg3_setup_flow_control(tp, 0, 0);
current_link_up = 1; current_link_up = 1;
} }
...@@ -5416,8 +5421,10 @@ static int tg3_reset_hw(struct tg3 *tp) ...@@ -5416,8 +5421,10 @@ static int tg3_reset_hw(struct tg3 *tp)
udelay(10); udelay(10);
if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) { if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) &&
!(tp->tg3_flags2 & TG3_FLG2_SERDES_PREEMPHASIS)) {
/* Set drive transmission level to 1.2V */ /* Set drive transmission level to 1.2V */
/* only if the signal pre-emphasis bit is not set */
val = tr32(MAC_SERDES_CFG); val = tr32(MAC_SERDES_CFG);
val &= 0xfffff000; val &= 0xfffff000;
val |= 0x880; val |= 0x880;
...@@ -7513,6 +7520,8 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) ...@@ -7513,6 +7520,8 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
tg3_read_mem(tp, NIC_SRAM_DATA_CFG, &nic_cfg); tg3_read_mem(tp, NIC_SRAM_DATA_CFG, &nic_cfg);
tp->nic_sram_data_cfg = nic_cfg; tp->nic_sram_data_cfg = nic_cfg;
tg3_read_mem(tp, NIC_SRAM_DATA_CFG_2, &cfg2);
eeprom_signature_found = 1; eeprom_signature_found = 1;
if ((nic_cfg & NIC_SRAM_DATA_CFG_PHY_TYPE_MASK) == if ((nic_cfg & NIC_SRAM_DATA_CFG_PHY_TYPE_MASK) ==
...@@ -7531,8 +7540,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) ...@@ -7531,8 +7540,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
eeprom_phy_id = 0; eeprom_phy_id = 0;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) { if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
tg3_read_mem(tp, NIC_SRAM_DATA_CFG_2, &led_cfg); led_cfg = cfg2 & (NIC_SRAM_DATA_CFG_LED_MODE_MASK |
led_cfg &= (NIC_SRAM_DATA_CFG_LED_MODE_MASK |
SHASTA_EXT_LED_MODE_MASK); SHASTA_EXT_LED_MODE_MASK);
} else } else
led_cfg = nic_cfg & NIC_SRAM_DATA_CFG_LED_MODE_MASK; led_cfg = nic_cfg & NIC_SRAM_DATA_CFG_LED_MODE_MASK;
...@@ -7590,9 +7598,13 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) ...@@ -7590,9 +7598,13 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
if (nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL) if (nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL)
tp->tg3_flags |= TG3_FLAG_SERDES_WOL_CAP; tp->tg3_flags |= TG3_FLAG_SERDES_WOL_CAP;
tg3_read_mem(tp, NIC_SRAM_DATA_PHY_ID, &cfg2);
if (cfg2 & (1 << 17)) if (cfg2 & (1 << 17))
tp->tg3_flags2 |= TG3_FLG2_CAPACITIVE_COUPLING; tp->tg3_flags2 |= TG3_FLG2_CAPACITIVE_COUPLING;
/* serdes signal pre-emphasis in register 0x590 set by */
/* bootcode if bit 18 is set */
if (cfg2 & (1 << 18))
tp->tg3_flags2 |= TG3_FLG2_SERDES_PREEMPHASIS;
} }
/* Reading the PHY ID register can conflict with ASF /* Reading the PHY ID register can conflict with ASF
......
...@@ -2106,6 +2106,7 @@ struct tg3 { ...@@ -2106,6 +2106,7 @@ struct tg3 {
#define TG3_FLG2_CAPACITIVE_COUPLING 0x00004000 #define TG3_FLG2_CAPACITIVE_COUPLING 0x00004000
#define TG3_FLG2_FLASH 0x00008000 #define TG3_FLG2_FLASH 0x00008000
#define TG3_FLG2_HW_TSO 0x00010000 #define TG3_FLG2_HW_TSO 0x00010000
#define TG3_FLG2_SERDES_PREEMPHASIS 0x00020000
u32 split_mode_max_reqs; u32 split_mode_max_reqs;
#define SPLIT_MODE_5704_MAX_REQ 3 #define SPLIT_MODE_5704_MAX_REQ 3
......
...@@ -353,15 +353,11 @@ static inline struct sk_buff *skb_get(struct sk_buff *skb) ...@@ -353,15 +353,11 @@ static inline struct sk_buff *skb_get(struct sk_buff *skb)
*/ */
static inline void kfree_skb(struct sk_buff *skb) static inline void kfree_skb(struct sk_buff *skb)
{ {
if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users)) if (likely(atomic_read(&skb->users) == 1))
__kfree_skb(skb); smp_rmb();
} else if (likely(!atomic_dec_and_test(&skb->users)))
return;
/* Use this if you didn't touch the skb state [for fast switching] */ __kfree_skb(skb);
static inline void kfree_skb_fast(struct sk_buff *skb)
{
if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
kfree_skbmem(skb);
} }
/** /**
......
...@@ -365,6 +365,7 @@ enum { ...@@ -365,6 +365,7 @@ enum {
NET_IPV4_ROUTE_MIN_PMTU=16, NET_IPV4_ROUTE_MIN_PMTU=16,
NET_IPV4_ROUTE_MIN_ADVMSS=17, NET_IPV4_ROUTE_MIN_ADVMSS=17,
NET_IPV4_ROUTE_SECRET_INTERVAL=18, NET_IPV4_ROUTE_SECRET_INTERVAL=18,
NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
}; };
enum enum
......
...@@ -147,6 +147,7 @@ void dst_release(struct dst_entry * dst) ...@@ -147,6 +147,7 @@ void dst_release(struct dst_entry * dst)
{ {
if (dst) { if (dst) {
WARN_ON(atomic_read(&dst->__refcnt) < 1); WARN_ON(atomic_read(&dst->__refcnt) < 1);
smp_mb__before_atomic_dec();
atomic_dec(&dst->__refcnt); atomic_dec(&dst->__refcnt);
} }
} }
......
...@@ -169,6 +169,8 @@ struct dst_entry *dst_destroy(struct dst_entry * dst) ...@@ -169,6 +169,8 @@ struct dst_entry *dst_destroy(struct dst_entry * dst)
struct neighbour *neigh; struct neighbour *neigh;
struct hh_cache *hh; struct hh_cache *hh;
smp_rmb();
again: again:
neigh = dst->neighbour; neigh = dst->neighbour;
hh = dst->hh; hh = dst->hh;
......
...@@ -2529,6 +2529,8 @@ ctl_table ipv4_route_table[] = { ...@@ -2529,6 +2529,8 @@ ctl_table ipv4_route_table[] = {
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
/* Deprecated. Use gc_min_interval_ms */
.ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL, .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL,
.procname = "gc_min_interval", .procname = "gc_min_interval",
.data = &ip_rt_gc_min_interval, .data = &ip_rt_gc_min_interval,
...@@ -2537,6 +2539,15 @@ ctl_table ipv4_route_table[] = { ...@@ -2537,6 +2539,15 @@ ctl_table ipv4_route_table[] = {
.proc_handler = &proc_dointvec_jiffies, .proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies, .strategy = &sysctl_jiffies,
}, },
{
.ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
.procname = "gc_min_interval_ms",
.data = &ip_rt_gc_min_interval,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = &proc_doulongvec_ms_jiffies_minmax,
.strategy = &sysctl_jiffies,
},
{ {
.ctl_name = NET_IPV4_ROUTE_GC_TIMEOUT, .ctl_name = NET_IPV4_ROUTE_GC_TIMEOUT,
.procname = "gc_timeout", .procname = "gc_timeout",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/netfilter_ipv4.h> #include <linux/netfilter_ipv4.h>
#include <linux/netfilter_ipv6.h>
#include <linux/netfilter.h> #include <linux/netfilter.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <net/pkt_sched.h> #include <net/pkt_sched.h>
...@@ -271,6 +272,14 @@ static struct nf_hook_ops ing_ops = { ...@@ -271,6 +272,14 @@ static struct nf_hook_ops ing_ops = {
.priority = NF_IP_PRI_FILTER + 1, .priority = NF_IP_PRI_FILTER + 1,
}; };
static struct nf_hook_ops ing6_ops = {
.hook = ing_hook,
.owner = THIS_MODULE,
.pf = PF_INET6,
.hooknum = NF_IP6_PRE_ROUTING,
.priority = NF_IP6_PRI_FILTER + 1,
};
#endif #endif
#endif #endif
...@@ -297,6 +306,12 @@ static int ingress_init(struct Qdisc *sch,struct rtattr *opt) ...@@ -297,6 +306,12 @@ static int ingress_init(struct Qdisc *sch,struct rtattr *opt)
return -EINVAL; return -EINVAL;
} }
nf_registered++; nf_registered++;
if (nf_register_hook(&ing6_ops) < 0) {
printk("IPv6 ingress qdisc registration error, " \
"disabling IPv6 support.\n");
} else
nf_registered++;
} }
#endif #endif
#endif #endif
...@@ -408,8 +423,11 @@ static void __exit ingress_module_exit(void) ...@@ -408,8 +423,11 @@ static void __exit ingress_module_exit(void)
unregister_qdisc(&ingress_qdisc_ops); unregister_qdisc(&ingress_qdisc_ops);
#ifndef CONFIG_NET_CLS_ACT #ifndef CONFIG_NET_CLS_ACT
#ifdef CONFIG_NETFILTER #ifdef CONFIG_NETFILTER
if (nf_registered) if (nf_registered) {
nf_unregister_hook(&ing_ops); nf_unregister_hook(&ing_ops);
if (nf_registered > 1)
nf_unregister_hook(&ing6_ops);
}
#endif #endif
#endif #endif
} }
......
...@@ -357,7 +357,7 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list, ...@@ -357,7 +357,7 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list,
return NULL; return NULL;
for (i = 0; i < entries; i++) { for (i = 0; i < entries; i++) {
if (!strcmp(name, list[i].name)) if (strcmp(name, list[i].name))
continue; continue;
if (list[i].available) if (list[i].available)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment