Commit e8f3645c authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] kNFSd: Release udp socket for next nfs request to arrive earlier

From: Mark Hemment <markhe@veritas.com>

  For RPC over UDP, after receiving a packet kick another thread as soon
as possible.  This helps NFS performance.
parent b50ca02a
...@@ -592,8 +592,14 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) ...@@ -592,8 +592,14 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
/* possibly an icmp error */ /* possibly an icmp error */
dprintk("svc: recvfrom returned error %d\n", -err); dprintk("svc: recvfrom returned error %d\n", -err);
} }
svsk->sk_sk->sk_stamp = skb->stamp;
set_bit(SK_DATA, &svsk->sk_flags); /* there may be more data... */ set_bit(SK_DATA, &svsk->sk_flags); /* there may be more data... */
/*
* Maybe more packets - kick another thread ASAP.
*/
svc_sock_received(svsk);
len = skb->len - sizeof(struct udphdr); len = skb->len - sizeof(struct udphdr);
rqstp->rq_arg.len = len; rqstp->rq_arg.len = len;
...@@ -605,8 +611,6 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) ...@@ -605,8 +611,6 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
rqstp->rq_addr.sin_addr.s_addr = skb->nh.iph->saddr; rqstp->rq_addr.sin_addr.s_addr = skb->nh.iph->saddr;
rqstp->rq_daddr = skb->nh.iph->daddr; rqstp->rq_daddr = skb->nh.iph->daddr;
svsk->sk_sk->sk_stamp = skb->stamp;
if (skb_is_nonlinear(skb)) { if (skb_is_nonlinear(skb)) {
/* we have to copy */ /* we have to copy */
local_bh_disable(); local_bh_disable();
...@@ -614,7 +618,6 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) ...@@ -614,7 +618,6 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
local_bh_enable(); local_bh_enable();
/* checksum error */ /* checksum error */
skb_free_datagram(svsk->sk_sk, skb); skb_free_datagram(svsk->sk_sk, skb);
svc_sock_received(svsk);
return 0; return 0;
} }
local_bh_enable(); local_bh_enable();
...@@ -626,7 +629,6 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) ...@@ -626,7 +629,6 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
if (skb->ip_summed != CHECKSUM_UNNECESSARY) { if (skb->ip_summed != CHECKSUM_UNNECESSARY) {
if ((unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum))) { if ((unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum))) {
skb_free_datagram(svsk->sk_sk, skb); skb_free_datagram(svsk->sk_sk, skb);
svc_sock_received(svsk);
return 0; return 0;
} }
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
...@@ -646,9 +648,6 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) ...@@ -646,9 +648,6 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
if (serv->sv_stats) if (serv->sv_stats)
serv->sv_stats->netudpcnt++; serv->sv_stats->netudpcnt++;
/* One down, maybe more to go... */
svc_sock_received(svsk);
return len; return len;
} }
......
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