net: neterion: replace ip_fast_csum with csum_replace2
Subsystems (2)
PATCH 1/1 net: neterion: replace ip_fast_csum with csum_replace2
From: Li RongQing <[email protected]>
replace ip_fast_csum with csum_replace2 to save cpu cycles
Signed-off-by Li RongQing <[email protected]>
--- drivers/net/ethernet/neterion/s2io.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/neterion/s2io.c +2 -4
@@ -80,6 +80,7 @@#include <linux/slab.h> #include <linux/prefetch.h> #include <net/tcp.h> +#include <net/checksum.h> #include <asm/div64.h> #include <asm/irq.h>
@@ -8337,16 +8338,13 @@ static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro) {struct iphdr *ip = lro->iph;struct tcphdr *tcp = lro->tcph; -__sum16 nchk;struct swStat *swstats = &sp->mac_control.stats_info->sw_stat;DBG_PRINT (INFO_DBG ,"%s: Been here...\n" , __func__);/* Update L3 header */ +csum_replace2 (&ip->check, ip->tot_len,htons (lro->total_len)); ip->tot_len =htons (lro->total_len); - ip->check =0 ; - nchk =ip_fast_csum ((u8 *)lro->iph, ip->ihl); - ip->check = nchk;/* Update L4 header */ tcp->ack_seq = lro->tcp_ack;
Signature · 1 line
1.7.10.4
From: [email protected]
Date: Mon, 18 Mar 2013 16:34:48 +0800
Quoted 5 lines
From: Li RongQing <[email protected]>
replace
ip_fast_csumwithcsum_replace2to save cpu cyclesSigned-off-by Li RongQing <[email protected]>
Applied.