Commit cc5724ce authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  Revert "tcp: Always set urgent pointer if it's beyond snd_nxt"
  ipv6: Copy cork options in ip6_append_data
  udp: Fix UDP short packet false positive
  gianfar: Fix potential soft reset race
  gianfar: Fix BD_LENGTH_MASK definition
  cxgb3: Fix lro switch
  iwlwifi: save PCI state before suspend, restore after resume
  iwlwifi: clean key table in iwl_clear_stations_table
parents f01d1d54 a23f4bbd
...@@ -2276,8 +2276,7 @@ static int process_responses(struct adapter *adap, struct sge_qset *qs, ...@@ -2276,8 +2276,7 @@ static int process_responses(struct adapter *adap, struct sge_qset *qs,
} else if ((len = ntohl(r->len_cq)) != 0) { } else if ((len = ntohl(r->len_cq)) != 0) {
struct sge_fl *fl; struct sge_fl *fl;
if (eth) lro &= eth && is_eth_tcp(rss_hi);
lro = qs->lro_enabled && is_eth_tcp(rss_hi);
fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0]; fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0];
if (fl->use_pages) { if (fl->use_pages) {
......
...@@ -351,6 +351,9 @@ static int gfar_probe(struct of_device *ofdev, ...@@ -351,6 +351,9 @@ static int gfar_probe(struct of_device *ofdev,
/* Reset MAC layer */ /* Reset MAC layer */
gfar_write(&priv->regs->maccfg1, MACCFG1_SOFT_RESET); gfar_write(&priv->regs->maccfg1, MACCFG1_SOFT_RESET);
/* We need to delay at least 3 TX clocks */
udelay(2);
tempval = (MACCFG1_TX_FLOW | MACCFG1_RX_FLOW); tempval = (MACCFG1_TX_FLOW | MACCFG1_RX_FLOW);
gfar_write(&priv->regs->maccfg1, tempval); gfar_write(&priv->regs->maccfg1, tempval);
......
...@@ -312,7 +312,7 @@ extern const char gfar_driver_version[]; ...@@ -312,7 +312,7 @@ extern const char gfar_driver_version[];
#define ATTRELI_EI(x) (x) #define ATTRELI_EI(x) (x)
#define BD_LFLAG(flags) ((flags) << 16) #define BD_LFLAG(flags) ((flags) << 16)
#define BD_LENGTH_MASK 0x00ff #define BD_LENGTH_MASK 0x0000ffff
/* TxBD status field bits */ /* TxBD status field bits */
#define TXBD_READY 0x8000 #define TXBD_READY 0x8000
......
...@@ -4042,6 +4042,7 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -4042,6 +4042,7 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
priv->is_open = 1; priv->is_open = 1;
} }
pci_save_state(pdev);
pci_set_power_state(pdev, PCI_D3hot); pci_set_power_state(pdev, PCI_D3hot);
return 0; return 0;
...@@ -4052,6 +4053,7 @@ static int iwl_pci_resume(struct pci_dev *pdev) ...@@ -4052,6 +4053,7 @@ static int iwl_pci_resume(struct pci_dev *pdev)
struct iwl_priv *priv = pci_get_drvdata(pdev); struct iwl_priv *priv = pci_get_drvdata(pdev);
pci_set_power_state(pdev, PCI_D0); pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
if (priv->is_open) if (priv->is_open)
iwl_mac_start(priv->hw); iwl_mac_start(priv->hw);
......
...@@ -480,6 +480,9 @@ void iwl_clear_stations_table(struct iwl_priv *priv) ...@@ -480,6 +480,9 @@ void iwl_clear_stations_table(struct iwl_priv *priv)
priv->num_stations = 0; priv->num_stations = 0;
memset(priv->stations, 0, sizeof(priv->stations)); memset(priv->stations, 0, sizeof(priv->stations));
/* clean ucode key table bit map */
priv->ucode_key_table = 0;
spin_unlock_irqrestore(&priv->sta_lock, flags); spin_unlock_irqrestore(&priv->sta_lock, flags);
} }
EXPORT_SYMBOL(iwl_clear_stations_table); EXPORT_SYMBOL(iwl_clear_stations_table);
......
...@@ -8143,6 +8143,7 @@ static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -8143,6 +8143,7 @@ static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state)
priv->is_open = 1; priv->is_open = 1;
} }
pci_save_state(pdev);
pci_set_power_state(pdev, PCI_D3hot); pci_set_power_state(pdev, PCI_D3hot);
return 0; return 0;
...@@ -8153,6 +8154,7 @@ static int iwl3945_pci_resume(struct pci_dev *pdev) ...@@ -8153,6 +8154,7 @@ static int iwl3945_pci_resume(struct pci_dev *pdev)
struct iwl3945_priv *priv = pci_get_drvdata(pdev); struct iwl3945_priv *priv = pci_get_drvdata(pdev);
pci_set_power_state(pdev, PCI_D0); pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
if (priv->is_open) if (priv->is_open)
iwl3945_mac_start(priv->hw); iwl3945_mac_start(priv->hw);
......
...@@ -663,14 +663,10 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, ...@@ -663,14 +663,10 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
th->urg_ptr = 0; th->urg_ptr = 0;
/* The urg_mode check is necessary during a below snd_una win probe */ /* The urg_mode check is necessary during a below snd_una win probe */
if (unlikely(tcp_urg_mode(tp))) { if (unlikely(tcp_urg_mode(tp) &&
if (between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF)) { between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF))) {
th->urg_ptr = htons(tp->snd_up - tcb->seq); th->urg_ptr = htons(tp->snd_up - tcb->seq);
th->urg = 1; th->urg = 1;
} else if (after(tcb->seq + 0xFFFF, tp->snd_nxt)) {
th->urg_ptr = 0xFFFF;
th->urg = 1;
}
} }
tcp_options_write((__be32 *)(th + 1), tp, &opts, &md5_hash_location); tcp_options_write((__be32 *)(th + 1), tp, &opts, &md5_hash_location);
......
...@@ -1231,7 +1231,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, ...@@ -1231,7 +1231,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
int proto) int proto)
{ {
struct sock *sk; struct sock *sk;
struct udphdr *uh = udp_hdr(skb); struct udphdr *uh;
unsigned short ulen; unsigned short ulen;
struct rtable *rt = (struct rtable*)skb->dst; struct rtable *rt = (struct rtable*)skb->dst;
__be32 saddr = ip_hdr(skb)->saddr; __be32 saddr = ip_hdr(skb)->saddr;
...@@ -1244,6 +1244,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, ...@@ -1244,6 +1244,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
if (!pskb_may_pull(skb, sizeof(struct udphdr))) if (!pskb_may_pull(skb, sizeof(struct udphdr)))
goto drop; /* No space for header. */ goto drop; /* No space for header. */
uh = udp_hdr(skb);
ulen = ntohs(uh->len); ulen = ntohs(uh->len);
if (ulen > skb->len) if (ulen > skb->len)
goto short_packet; goto short_packet;
......
...@@ -1105,6 +1105,18 @@ static inline int ip6_ufo_append_data(struct sock *sk, ...@@ -1105,6 +1105,18 @@ static inline int ip6_ufo_append_data(struct sock *sk,
return err; return err;
} }
static inline struct ipv6_opt_hdr *ip6_opt_dup(struct ipv6_opt_hdr *src,
gfp_t gfp)
{
return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL;
}
static inline struct ipv6_rt_hdr *ip6_rthdr_dup(struct ipv6_rt_hdr *src,
gfp_t gfp)
{
return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL;
}
int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
int offset, int len, int odd, struct sk_buff *skb), int offset, int len, int odd, struct sk_buff *skb),
void *from, int length, int transhdrlen, void *from, int length, int transhdrlen,
...@@ -1130,17 +1142,37 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, ...@@ -1130,17 +1142,37 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
* setup for corking * setup for corking
*/ */
if (opt) { if (opt) {
if (np->cork.opt == NULL) { if (WARN_ON(np->cork.opt))
np->cork.opt = kmalloc(opt->tot_len,
sk->sk_allocation);
if (unlikely(np->cork.opt == NULL))
return -ENOBUFS;
} else if (np->cork.opt->tot_len < opt->tot_len) {
printk(KERN_DEBUG "ip6_append_data: invalid option length\n");
return -EINVAL; return -EINVAL;
}
memcpy(np->cork.opt, opt, opt->tot_len); np->cork.opt = kmalloc(opt->tot_len, sk->sk_allocation);
inet->cork.flags |= IPCORK_OPT; if (unlikely(np->cork.opt == NULL))
return -ENOBUFS;
np->cork.opt->tot_len = opt->tot_len;
np->cork.opt->opt_flen = opt->opt_flen;
np->cork.opt->opt_nflen = opt->opt_nflen;
np->cork.opt->dst0opt = ip6_opt_dup(opt->dst0opt,
sk->sk_allocation);
if (opt->dst0opt && !np->cork.opt->dst0opt)
return -ENOBUFS;
np->cork.opt->dst1opt = ip6_opt_dup(opt->dst1opt,
sk->sk_allocation);
if (opt->dst1opt && !np->cork.opt->dst1opt)
return -ENOBUFS;
np->cork.opt->hopopt = ip6_opt_dup(opt->hopopt,
sk->sk_allocation);
if (opt->hopopt && !np->cork.opt->hopopt)
return -ENOBUFS;
np->cork.opt->srcrt = ip6_rthdr_dup(opt->srcrt,
sk->sk_allocation);
if (opt->srcrt && !np->cork.opt->srcrt)
return -ENOBUFS;
/* need source address above miyazawa*/ /* need source address above miyazawa*/
} }
dst_hold(&rt->u.dst); dst_hold(&rt->u.dst);
...@@ -1167,8 +1199,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, ...@@ -1167,8 +1199,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
} else { } else {
rt = (struct rt6_info *)inet->cork.dst; rt = (struct rt6_info *)inet->cork.dst;
fl = &inet->cork.fl; fl = &inet->cork.fl;
if (inet->cork.flags & IPCORK_OPT) opt = np->cork.opt;
opt = np->cork.opt;
transhdrlen = 0; transhdrlen = 0;
exthdrlen = 0; exthdrlen = 0;
mtu = inet->cork.fragsize; mtu = inet->cork.fragsize;
...@@ -1407,9 +1438,15 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, ...@@ -1407,9 +1438,15 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
static void ip6_cork_release(struct inet_sock *inet, struct ipv6_pinfo *np) static void ip6_cork_release(struct inet_sock *inet, struct ipv6_pinfo *np)
{ {
inet->cork.flags &= ~IPCORK_OPT; if (np->cork.opt) {
kfree(np->cork.opt); kfree(np->cork.opt->dst0opt);
np->cork.opt = NULL; kfree(np->cork.opt->dst1opt);
kfree(np->cork.opt->hopopt);
kfree(np->cork.opt->srcrt);
kfree(np->cork.opt);
np->cork.opt = NULL;
}
if (inet->cork.dst) { if (inet->cork.dst) {
dst_release(inet->cork.dst); dst_release(inet->cork.dst);
inet->cork.dst = NULL; inet->cork.dst = NULL;
......
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