aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tg3.c73
-rw-r--r--net/ipv4/ip_output.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_ftp.c4
-rw-r--r--net/ipv4/netfilter/ip_conntrack_standalone.c7
-rw-r--r--net/ipv4/tcp_input.c1
-rw-r--r--net/sched/simple.c18
6 files changed, 46 insertions, 59 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 10d476153ee0..903d0ced7ddb 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -426,9 +426,30 @@ static void tg3_enable_ints(struct tg3 *tp)
426 tg3_cond_int(tp); 426 tg3_cond_int(tp);
427} 427}
428 428
429static inline unsigned int tg3_has_work(struct tg3 *tp)
430{
431 struct tg3_hw_status *sblk = tp->hw_status;
432 unsigned int work_exists = 0;
433
434 /* check for phy events */
435 if (!(tp->tg3_flags &
436 (TG3_FLAG_USE_LINKCHG_REG |
437 TG3_FLAG_POLL_SERDES))) {
438 if (sblk->status & SD_STATUS_LINK_CHG)
439 work_exists = 1;
440 }
441 /* check for RX/TX work to do */
442 if (sblk->idx[0].tx_consumer != tp->tx_cons ||
443 sblk->idx[0].rx_producer != tp->rx_rcb_ptr)
444 work_exists = 1;
445
446 return work_exists;
447}
448
429/* tg3_restart_ints 449/* tg3_restart_ints
430 * similar to tg3_enable_ints, but it can return without flushing the 450 * similar to tg3_enable_ints, but it accurately determines whether there
431 * PIO write which reenables interrupts 451 * is new work pending and can return without flushing the PIO write
452 * which reenables interrupts
432 */ 453 */
433static void tg3_restart_ints(struct tg3 *tp) 454static void tg3_restart_ints(struct tg3 *tp)
434{ 455{
@@ -437,7 +458,9 @@ static void tg3_restart_ints(struct tg3 *tp)
437 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000000); 458 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000000);
438 mmiowb(); 459 mmiowb();
439 460
440 tg3_cond_int(tp); 461 if (tg3_has_work(tp))
462 tw32(HOSTCC_MODE, tp->coalesce_mode |
463 (HOSTCC_MODE_ENABLE | HOSTCC_MODE_NOW));
441} 464}
442 465
443static inline void tg3_netif_stop(struct tg3 *tp) 466static inline void tg3_netif_stop(struct tg3 *tp)
@@ -2686,8 +2709,8 @@ static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag)
2686static int tg3_rx(struct tg3 *tp, int budget) 2709static int tg3_rx(struct tg3 *tp, int budget)
2687{ 2710{
2688 u32 work_mask; 2711 u32 work_mask;
2689 u32 rx_rcb_ptr = tp->rx_rcb_ptr; 2712 u32 sw_idx = tp->rx_rcb_ptr;
2690 u16 hw_idx, sw_idx; 2713 u16 hw_idx;
2691 int received; 2714 int received;
2692 2715
2693 hw_idx = tp->hw_status->idx[0].rx_producer; 2716 hw_idx = tp->hw_status->idx[0].rx_producer;
@@ -2696,7 +2719,6 @@ static int tg3_rx(struct tg3 *tp, int budget)
2696 * the opaque cookie. 2719 * the opaque cookie.
2697 */ 2720 */
2698 rmb(); 2721 rmb();
2699 sw_idx = rx_rcb_ptr % TG3_RX_RCB_RING_SIZE(tp);
2700 work_mask = 0; 2722 work_mask = 0;
2701 received = 0; 2723 received = 0;
2702 while (sw_idx != hw_idx && budget > 0) { 2724 while (sw_idx != hw_idx && budget > 0) {
@@ -2801,14 +2823,19 @@ static int tg3_rx(struct tg3 *tp, int budget)
2801next_pkt: 2823next_pkt:
2802 (*post_ptr)++; 2824 (*post_ptr)++;
2803next_pkt_nopost: 2825next_pkt_nopost:
2804 rx_rcb_ptr++; 2826 sw_idx++;
2805 sw_idx = rx_rcb_ptr % TG3_RX_RCB_RING_SIZE(tp); 2827 sw_idx %= TG3_RX_RCB_RING_SIZE(tp);
2828
2829 /* Refresh hw_idx to see if there is new work */
2830 if (sw_idx == hw_idx) {
2831 hw_idx = tp->hw_status->idx[0].rx_producer;
2832 rmb();
2833 }
2806 } 2834 }
2807 2835
2808 /* ACK the status ring. */ 2836 /* ACK the status ring. */
2809 tp->rx_rcb_ptr = rx_rcb_ptr; 2837 tp->rx_rcb_ptr = sw_idx;
2810 tw32_rx_mbox(MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW, 2838 tw32_rx_mbox(MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW, sw_idx);
2811 (rx_rcb_ptr % TG3_RX_RCB_RING_SIZE(tp)));
2812 2839
2813 /* Refill RX ring(s). */ 2840 /* Refill RX ring(s). */
2814 if (work_mask & RXD_OPAQUE_RING_STD) { 2841 if (work_mask & RXD_OPAQUE_RING_STD) {
@@ -2887,26 +2914,6 @@ static int tg3_poll(struct net_device *netdev, int *budget)
2887 return (done ? 0 : 1); 2914 return (done ? 0 : 1);
2888} 2915}
2889 2916
2890static inline unsigned int tg3_has_work(struct net_device *dev, struct tg3 *tp)
2891{
2892 struct tg3_hw_status *sblk = tp->hw_status;
2893 unsigned int work_exists = 0;
2894
2895 /* check for phy events */
2896 if (!(tp->tg3_flags &
2897 (TG3_FLAG_USE_LINKCHG_REG |
2898 TG3_FLAG_POLL_SERDES))) {
2899 if (sblk->status & SD_STATUS_LINK_CHG)
2900 work_exists = 1;
2901 }
2902 /* check for RX/TX work to do */
2903 if (sblk->idx[0].tx_consumer != tp->tx_cons ||
2904 sblk->idx[0].rx_producer != tp->rx_rcb_ptr)
2905 work_exists = 1;
2906
2907 return work_exists;
2908}
2909
2910/* MSI ISR - No need to check for interrupt sharing and no need to 2917/* MSI ISR - No need to check for interrupt sharing and no need to
2911 * flush status block and interrupt mailbox. PCI ordering rules 2918 * flush status block and interrupt mailbox. PCI ordering rules
2912 * guarantee that MSI will arrive after the status block. 2919 * guarantee that MSI will arrive after the status block.
@@ -2930,7 +2937,7 @@ static irqreturn_t tg3_msi(int irq, void *dev_id, struct pt_regs *regs)
2930 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001); 2937 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
2931 sblk->status &= ~SD_STATUS_UPDATED; 2938 sblk->status &= ~SD_STATUS_UPDATED;
2932 2939
2933 if (likely(tg3_has_work(dev, tp))) 2940 if (likely(tg3_has_work(tp)))
2934 netif_rx_schedule(dev); /* schedule NAPI poll */ 2941 netif_rx_schedule(dev); /* schedule NAPI poll */
2935 else { 2942 else {
2936 /* no work, re-enable interrupts 2943 /* no work, re-enable interrupts
@@ -2977,7 +2984,7 @@ static irqreturn_t tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2977 tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW); 2984 tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW);
2978 sblk->status &= ~SD_STATUS_UPDATED; 2985 sblk->status &= ~SD_STATUS_UPDATED;
2979 2986
2980 if (likely(tg3_has_work(dev, tp))) 2987 if (likely(tg3_has_work(tp)))
2981 netif_rx_schedule(dev); /* schedule NAPI poll */ 2988 netif_rx_schedule(dev); /* schedule NAPI poll */
2982 else { 2989 else {
2983 /* no work, shared interrupt perhaps? re-enable 2990 /* no work, shared interrupt perhaps? re-enable
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 30ab7b6ab761..38f69532a029 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -195,6 +195,8 @@ static inline int ip_finish_output2(struct sk_buff *skb)
195 nf_debug_ip_finish_output2(skb); 195 nf_debug_ip_finish_output2(skb);
196#endif /*CONFIG_NETFILTER_DEBUG*/ 196#endif /*CONFIG_NETFILTER_DEBUG*/
197 197
198 nf_reset(skb);
199
198 if (hh) { 200 if (hh) {
199 int hh_alen; 201 int hh_alen;
200 202
diff --git a/net/ipv4/netfilter/ip_conntrack_ftp.c b/net/ipv4/netfilter/ip_conntrack_ftp.c
index 12b88cbb11db..dd86503aa788 100644
--- a/net/ipv4/netfilter/ip_conntrack_ftp.c
+++ b/net/ipv4/netfilter/ip_conntrack_ftp.c
@@ -252,7 +252,7 @@ static int find_pattern(const char *data, size_t dlen,
252} 252}
253 253
254/* Look up to see if we're just after a \n. */ 254/* Look up to see if we're just after a \n. */
255static int find_nl_seq(u16 seq, const struct ip_ct_ftp_master *info, int dir) 255static int find_nl_seq(u32 seq, const struct ip_ct_ftp_master *info, int dir)
256{ 256{
257 unsigned int i; 257 unsigned int i;
258 258
@@ -263,7 +263,7 @@ static int find_nl_seq(u16 seq, const struct ip_ct_ftp_master *info, int dir)
263} 263}
264 264
265/* We don't update if it's older than what we have. */ 265/* We don't update if it's older than what we have. */
266static void update_nl_seq(u16 nl_seq, struct ip_ct_ftp_master *info, int dir) 266static void update_nl_seq(u32 nl_seq, struct ip_ct_ftp_master *info, int dir)
267{ 267{
268 unsigned int i, oldest = NUM_SEQ_TO_REMEMBER; 268 unsigned int i, oldest = NUM_SEQ_TO_REMEMBER;
269 269
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
index 0c29ccf62a89..46ca45f74d85 100644
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -431,13 +431,6 @@ static unsigned int ip_conntrack_defrag(unsigned int hooknum,
431 const struct net_device *out, 431 const struct net_device *out,
432 int (*okfn)(struct sk_buff *)) 432 int (*okfn)(struct sk_buff *))
433{ 433{
434#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
435 /* Previously seen (loopback)? Ignore. Do this before
436 fragment check. */
437 if ((*pskb)->nfct)
438 return NF_ACCEPT;
439#endif
440
441 /* Gather fragments. */ 434 /* Gather fragments. */
442 if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { 435 if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
443 *pskb = ip_ct_gather_frags(*pskb, 436 *pskb = ip_ct_gather_frags(*pskb,
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 250492735902..6984042c0927 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3517,7 +3517,6 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
3517 if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) 3517 if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq)
3518 goto drop; 3518 goto drop;
3519 3519
3520 th = skb->h.th;
3521 __skb_pull(skb, th->doff*4); 3520 __skb_pull(skb, th->doff*4);
3522 3521
3523 TCP_ECN_accept_cwr(tp, skb); 3522 TCP_ECN_accept_cwr(tp, skb);
diff --git a/net/sched/simple.c b/net/sched/simple.c
index b0d3d15848ad..3ab4c675ab5d 100644
--- a/net/sched/simple.c
+++ b/net/sched/simple.c
@@ -10,27 +10,13 @@
10 * 10 *
11 */ 11 */
12 12
13#include <asm/uaccess.h>
14#include <asm/system.h>
15#include <asm/bitops.h>
16#include <linux/config.h> 13#include <linux/config.h>
17#include <linux/types.h> 14#include <linux/module.h>
15#include <linux/init.h>
18#include <linux/kernel.h> 16#include <linux/kernel.h>
19#include <linux/sched.h>
20#include <linux/string.h>
21#include <linux/mm.h>
22#include <linux/socket.h>
23#include <linux/sockios.h>
24#include <linux/in.h>
25#include <linux/errno.h>
26#include <linux/interrupt.h>
27#include <linux/netdevice.h> 17#include <linux/netdevice.h>
28#include <linux/skbuff.h> 18#include <linux/skbuff.h>
29#include <linux/rtnetlink.h> 19#include <linux/rtnetlink.h>
30#include <linux/module.h>
31#include <linux/init.h>
32#include <linux/proc_fs.h>
33#include <net/sock.h>
34#include <net/pkt_sched.h> 20#include <net/pkt_sched.h>
35 21
36#define TCA_ACT_SIMP 22 22#define TCA_ACT_SIMP 22