diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /net/xfrm/xfrm_ipcomp.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'net/xfrm/xfrm_ipcomp.c')
-rw-r--r-- | net/xfrm/xfrm_ipcomp.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index 2906d520eea..fc91ad7ee26 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c | |||
@@ -70,29 +70,26 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb) | |||
70 | 70 | ||
71 | while ((scratch += len, dlen -= len) > 0) { | 71 | while ((scratch += len, dlen -= len) > 0) { |
72 | skb_frag_t *frag; | 72 | skb_frag_t *frag; |
73 | struct page *page; | ||
74 | 73 | ||
75 | err = -EMSGSIZE; | 74 | err = -EMSGSIZE; |
76 | if (WARN_ON(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) | 75 | if (WARN_ON(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) |
77 | goto out; | 76 | goto out; |
78 | 77 | ||
79 | frag = skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags; | 78 | frag = skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags; |
80 | page = alloc_page(GFP_ATOMIC); | 79 | frag->page = alloc_page(GFP_ATOMIC); |
81 | 80 | ||
82 | err = -ENOMEM; | 81 | err = -ENOMEM; |
83 | if (!page) | 82 | if (!frag->page) |
84 | goto out; | 83 | goto out; |
85 | 84 | ||
86 | __skb_frag_set_page(frag, page); | ||
87 | |||
88 | len = PAGE_SIZE; | 85 | len = PAGE_SIZE; |
89 | if (dlen < len) | 86 | if (dlen < len) |
90 | len = dlen; | 87 | len = dlen; |
91 | 88 | ||
92 | frag->page_offset = 0; | 89 | memcpy(page_address(frag->page), scratch, len); |
93 | skb_frag_size_set(frag, len); | ||
94 | memcpy(skb_frag_address(frag), scratch, len); | ||
95 | 90 | ||
91 | frag->page_offset = 0; | ||
92 | frag->size = len; | ||
96 | skb->truesize += len; | 93 | skb->truesize += len; |
97 | skb->data_len += len; | 94 | skb->data_len += len; |
98 | skb->len += len; | 95 | skb->len += len; |
@@ -276,16 +273,18 @@ static struct crypto_comp * __percpu *ipcomp_alloc_tfms(const char *alg_name) | |||
276 | struct crypto_comp * __percpu *tfms; | 273 | struct crypto_comp * __percpu *tfms; |
277 | int cpu; | 274 | int cpu; |
278 | 275 | ||
276 | /* This can be any valid CPU ID so we don't need locking. */ | ||
277 | cpu = raw_smp_processor_id(); | ||
279 | 278 | ||
280 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { | 279 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { |
281 | struct crypto_comp *tfm; | 280 | struct crypto_comp *tfm; |
282 | 281 | ||
283 | /* This can be any valid CPU ID so we don't need locking. */ | 282 | tfms = pos->tfms; |
284 | tfm = __this_cpu_read(*pos->tfms); | 283 | tfm = *per_cpu_ptr(tfms, cpu); |
285 | 284 | ||
286 | if (!strcmp(crypto_comp_name(tfm), alg_name)) { | 285 | if (!strcmp(crypto_comp_name(tfm), alg_name)) { |
287 | pos->users++; | 286 | pos->users++; |
288 | return pos->tfms; | 287 | return tfms; |
289 | } | 288 | } |
290 | } | 289 | } |
291 | 290 | ||