aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi RongQing <roy.qing.li@gmail.com>2013-03-14 18:50:07 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-15 09:12:24 -0400
commit1bcac3b08e2f13c31f798ac46897e33f08cfbd53 (patch)
tree18faf40ea66e17d850acd456f56430dc3b86448b
parentb66c66dc5cc8f8f8d68ea1177b9672f91e1e7a19 (diff)
driver/qlogic: replace ip_fast_csum with csum_replace2
replace ip_fast_csum with csum_replace2 to save cpu cycles Signed-off-by: Li RongQing <roy.qing.li@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c4
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
index 4782dcfde736..7692dfd4f262 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
@@ -27,6 +27,7 @@
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/if_vlan.h> 29#include <linux/if_vlan.h>
30#include <net/checksum.h>
30#include "netxen_nic.h" 31#include "netxen_nic.h"
31#include "netxen_nic_hw.h" 32#include "netxen_nic_hw.h"
32 33
@@ -1641,9 +1642,8 @@ netxen_process_lro(struct netxen_adapter *adapter,
1641 th = (struct tcphdr *)((skb->data + vhdr_len) + (iph->ihl << 2)); 1642 th = (struct tcphdr *)((skb->data + vhdr_len) + (iph->ihl << 2));
1642 1643
1643 length = (iph->ihl << 2) + (th->doff << 2) + lro_length; 1644 length = (iph->ihl << 2) + (th->doff << 2) + lro_length;
1645 csum_replace2(&iph->check, iph->tot_len, htons(length));
1644 iph->tot_len = htons(length); 1646 iph->tot_len = htons(length);
1645 iph->check = 0;
1646 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
1647 th->psh = push; 1647 th->psh = push;
1648 th->seq = htonl(seq_number); 1648 th->seq = htonl(seq_number);
1649 1649
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index 0e630061bff3..891f12d47c9c 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -9,6 +9,7 @@
9#include <linux/if_vlan.h> 9#include <linux/if_vlan.h>
10#include <net/ip.h> 10#include <net/ip.h>
11#include <linux/ipv6.h> 11#include <linux/ipv6.h>
12#include <net/checksum.h>
12 13
13#include "qlcnic.h" 14#include "qlcnic.h"
14 15
@@ -1132,9 +1133,8 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,
1132 iph = (struct iphdr *)skb->data; 1133 iph = (struct iphdr *)skb->data;
1133 th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); 1134 th = (struct tcphdr *)(skb->data + (iph->ihl << 2));
1134 length = (iph->ihl << 2) + (th->doff << 2) + lro_length; 1135 length = (iph->ihl << 2) + (th->doff << 2) + lro_length;
1136 csum_replace2(&iph->check, iph->tot_len, htons(length));
1135 iph->tot_len = htons(length); 1137 iph->tot_len = htons(length);
1136 iph->check = 0;
1137 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
1138 } 1138 }
1139 1139
1140 th->psh = push; 1140 th->psh = push;
@@ -1595,9 +1595,8 @@ qlcnic_83xx_process_lro(struct qlcnic_adapter *adapter,
1595 iph = (struct iphdr *)skb->data; 1595 iph = (struct iphdr *)skb->data;
1596 th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); 1596 th = (struct tcphdr *)(skb->data + (iph->ihl << 2));
1597 length = (iph->ihl << 2) + (th->doff << 2) + lro_length; 1597 length = (iph->ihl << 2) + (th->doff << 2) + lro_length;
1598 csum_replace2(&iph->check, iph->tot_len, htons(length));
1598 iph->tot_len = htons(length); 1599 iph->tot_len = htons(length);
1599 iph->check = 0;
1600 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
1601 } 1600 }
1602 1601
1603 th->psh = push; 1602 th->psh = push;