diff options
| author | David S. Miller <davem@kernel.bkbits.net> | 2005-02-05 10:49:13 -0800 |
|---|---|---|
| committer | David S. Miller <davem@kernel.bkbits.net> | 2005-02-05 10:49:13 -0800 |
| commit | 077a63ea307ab78be154e6491a779794cc80cc18 (patch) | |
| tree | 82647081a7e544d59a782f374f77027ba069829c | |
| parent | b8a743970378fc8e3206b1b4fcdbecc5f37732f5 (diff) | |
| parent | 9eabad0207272c6cc0d50a067732ffc8d9a22f6f (diff) | |
Merge davem@nuts.davemloft.net:/disk1/BK/net-2.6
into kernel.bkbits.net:/home/davem/net-2.6
| -rw-r--r-- | Documentation/filesystems/proc.txt | 9 | ||||
| -rw-r--r-- | drivers/net/tg3.c | 40 | ||||
| -rw-r--r-- | drivers/net/tg3.h | 1 | ||||
| -rw-r--r-- | include/linux/skbuff.h | 14 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 1 | ||||
| -rw-r--r-- | include/net/dst.h | 1 | ||||
| -rw-r--r-- | net/core/dst.c | 2 | ||||
| -rw-r--r-- | net/ipv4/route.c | 11 | ||||
| -rw-r--r-- | net/sched/sch_ingress.c | 20 | ||||
| -rw-r--r-- | net/xfrm/xfrm_algo.c | 2 |
10 files changed, 72 insertions, 29 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 2c3fc3a2745b..f3f69ad01a87 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt @@ -1709,12 +1709,13 @@ flush Writing to this file results in a flush of the routing cache. -gc_elasticity, gc_interval, gc_min_interval, gc_tresh, gc_timeout, -gc_thresh, gc_thresh1, gc_thresh2, gc_thresh3 --------------------------------------------------------------- +gc_elasticity, gc_interval, gc_min_interval_ms, gc_timeout, gc_thresh +--------------------------------------------------------------------- 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 -------- diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 5fd1f14aed99..0a09d933a770 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -60,8 +60,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.19" -#define DRV_MODULE_RELDATE "January 26, 2005" +#define DRV_MODULE_VERSION "3.20" +#define DRV_MODULE_RELDATE "February 2, 2005" #define TG3_DEF_MAC_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) if (tr32(TG3PCI_DUAL_MAC_CTRL) & DUAL_MAC_CTRL_ID) port_a = 0; - serdes_cfg = tr32(MAC_SERDES_CFG) & - ((1 << 23) | (1 << 22) | (1 << 21) | (1 << 20)); + /* preserve bits 0-11,13,14 for signal pre-emphasis */ + /* preserve bits 20-23 for voltage regulator */ + serdes_cfg = tr32(MAC_SERDES_CFG) & 0x00f06fff; } sg_dig_ctrl = tr32(SG_DIG_CTRL); @@ -2158,9 +2159,9 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) u32 val = serdes_cfg; if (port_a) - val |= 0xc010880; + val |= 0xc010000; else - val |= 0x4010880; + val |= 0x4010000; tw32_f(MAC_SERDES_CFG, val); } tw32_f(SG_DIG_CTRL, 0x01388400); @@ -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 (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)); udelay(5); 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) u32 val = serdes_cfg; if (port_a) - val |= 0xc010880; + val |= 0xc010000; else - val |= 0x4010880; + val |= 0x4010000; tw32_f(MAC_SERDES_CFG, val); } @@ -2234,8 +2235,12 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) tw32_f(SG_DIG_CTRL, 0x01388400); 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); - 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); current_link_up = 1; } @@ -5416,8 +5421,10 @@ static int tg3_reset_hw(struct tg3 *tp) udelay(10); 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 */ + /* only if the signal pre-emphasis bit is not set */ val = tr32(MAC_SERDES_CFG); val &= 0xfffff000; val |= 0x880; @@ -7513,6 +7520,8 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) tg3_read_mem(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; if ((nic_cfg & NIC_SRAM_DATA_CFG_PHY_TYPE_MASK) == @@ -7531,8 +7540,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) eeprom_phy_id = 0; 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 &= (NIC_SRAM_DATA_CFG_LED_MODE_MASK | + led_cfg = cfg2 & (NIC_SRAM_DATA_CFG_LED_MODE_MASK | SHASTA_EXT_LED_MODE_MASK); } else led_cfg = nic_cfg & NIC_SRAM_DATA_CFG_LED_MODE_MASK; @@ -7590,9 +7598,13 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) if (nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL) tp->tg3_flags |= TG3_FLAG_SERDES_WOL_CAP; - tg3_read_mem(tp, NIC_SRAM_DATA_PHY_ID, &cfg2); if (cfg2 & (1 << 17)) 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 diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index f91cb0aa6f8b..02b75de37af8 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h @@ -2106,6 +2106,7 @@ struct tg3 { #define TG3_FLG2_CAPACITIVE_COUPLING 0x00004000 #define TG3_FLG2_FLASH 0x00008000 #define TG3_FLG2_HW_TSO 0x00010000 +#define TG3_FLG2_SERDES_PREEMPHASIS 0x00020000 u32 split_mode_max_reqs; #define SPLIT_MODE_5704_MAX_REQ 3 diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a6b744bccdc8..23e0b48b79a4 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -353,15 +353,11 @@ static inline struct sk_buff *skb_get(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)) - __kfree_skb(skb); -} - -/* Use this if you didn't touch the skb state [for fast switching] */ -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); + if (likely(atomic_read(&skb->users) == 1)) + smp_rmb(); + else if (likely(!atomic_dec_and_test(&skb->users))) + return; + __kfree_skb(skb); } /** diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 86488d26260a..06bdf80154fb 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -365,6 +365,7 @@ enum { NET_IPV4_ROUTE_MIN_PMTU=16, NET_IPV4_ROUTE_MIN_ADVMSS=17, NET_IPV4_ROUTE_SECRET_INTERVAL=18, + NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19, }; enum diff --git a/include/net/dst.h b/include/net/dst.h index 7ffb470d0e9a..d214a5781c17 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -147,6 +147,7 @@ void dst_release(struct dst_entry * dst) { if (dst) { WARN_ON(atomic_read(&dst->__refcnt) < 1); + smp_mb__before_atomic_dec(); atomic_dec(&dst->__refcnt); } } diff --git a/net/core/dst.c b/net/core/dst.c index f1c95a538e3b..bca63465b0f1 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -169,6 +169,8 @@ struct dst_entry *dst_destroy(struct dst_entry * dst) struct neighbour *neigh; struct hh_cache *hh; + smp_rmb(); + again: neigh = dst->neighbour; hh = dst->hh; diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 0c5619cdce98..8a06923f8451 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2529,6 +2529,8 @@ ctl_table ipv4_route_table[] = { .proc_handler = &proc_dointvec, }, { + /* Deprecated. Use gc_min_interval_ms */ + .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL, .procname = "gc_min_interval", .data = &ip_rt_gc_min_interval, @@ -2538,6 +2540,15 @@ ctl_table ipv4_route_table[] = { .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, .procname = "gc_timeout", .data = &ip_rt_gc_timeout, diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c index fd751a57fff1..8edc32a6ad2f 100644 --- a/net/sched/sch_ingress.c +++ b/net/sched/sch_ingress.c @@ -14,6 +14,7 @@ #include <linux/netdevice.h> #include <linux/rtnetlink.h> #include <linux/netfilter_ipv4.h> +#include <linux/netfilter_ipv6.h> #include <linux/netfilter.h> #include <linux/smp.h> #include <net/pkt_sched.h> @@ -271,6 +272,14 @@ static struct nf_hook_ops ing_ops = { .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 @@ -297,6 +306,12 @@ static int ingress_init(struct Qdisc *sch,struct rtattr *opt) return -EINVAL; } nf_registered++; + + if (nf_register_hook(&ing6_ops) < 0) { + printk("IPv6 ingress qdisc registration error, " \ + "disabling IPv6 support.\n"); + } else + nf_registered++; } #endif #endif @@ -408,8 +423,11 @@ static void __exit ingress_module_exit(void) unregister_qdisc(&ingress_qdisc_ops); #ifndef CONFIG_NET_CLS_ACT #ifdef CONFIG_NETFILTER - if (nf_registered) + if (nf_registered) { nf_unregister_hook(&ing_ops); + if (nf_registered > 1) + nf_unregister_hook(&ing6_ops); + } #endif #endif } diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c index 40e41ab847ff..74e995aed022 100644 --- a/net/xfrm/xfrm_algo.c +++ b/net/xfrm/xfrm_algo.c @@ -357,7 +357,7 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list, return NULL; for (i = 0; i < entries; i++) { - if (!strcmp(name, list[i].name)) + if (strcmp(name, list[i].name)) continue; if (list[i].available) |
