aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorShirley Ma <xma@us.ibm.com>2011-07-09 05:55:27 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-09 05:55:27 -0400
commita48332f803093d5e3d431a5a1f595698911d1145 (patch)
treec493ee69295c8a282e4a69a34cb86131e9f63ff5 /net/core/skbuff.c
parenta05e42c27f80d341a5ec2053b041e24231a002e2 (diff)
skbuff: clear tx zero-copy flag
This patch clears tx zero-copy flag as needed. Signed-off-by: Shirley Ma <xma@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index a9577a2f3a43..d220119f13ab 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -677,6 +677,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
677 if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) { 677 if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
678 if (skb_copy_ubufs(skb, gfp_mask)) 678 if (skb_copy_ubufs(skb, gfp_mask))
679 return NULL; 679 return NULL;
680 skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
680 } 681 }
681 682
682 n = skb + 1; 683 n = skb + 1;
@@ -801,6 +802,7 @@ struct sk_buff *pskb_copy(struct sk_buff *skb, gfp_t gfp_mask)
801 kfree(n); 802 kfree(n);
802 goto out; 803 goto out;
803 } 804 }
805 skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
804 } 806 }
805 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 807 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
806 skb_shinfo(n)->frags[i] = skb_shinfo(skb)->frags[i]; 808 skb_shinfo(n)->frags[i] = skb_shinfo(skb)->frags[i];
@@ -893,6 +895,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
893 if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) { 895 if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
894 if (skb_copy_ubufs(skb, gfp_mask)) 896 if (skb_copy_ubufs(skb, gfp_mask))
895 goto nofrags; 897 goto nofrags;
898 skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
896 } 899 }
897 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) 900 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
898 get_page(skb_shinfo(skb)->frags[i].page); 901 get_page(skb_shinfo(skb)->frags[i].page);