summaryrefslogtreecommitdiff
path: root/net/tls
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-07-23 06:47:56 +0300
committerDavid S. Miller <davem@davemloft.net>2019-07-23 06:47:56 +0300
commitd5c3a62d0bb9b763e9378fe8f4cd79502e16cce8 (patch)
tree6f73341cd726d15b3c39df2583b22a268c47f1f2 /net/tls
parent7e24b4ed5ac4321e41415b0c6f0f8a8ac14852b2 (diff)
parent8842d285bafa9ff7719f4107b6545a11dcd41995 (diff)
downloadlinux-d5c3a62d0bb9b763e9378fe8f4cd79502e16cce8.tar.xz
Merge branch 'Convert-skb_frag_t-to-bio_vec'
Matthew Wilcox says: ==================== Convert skb_frag_t to bio_vec The skb_frag_t and bio_vec are fundamentally the same (page, offset, length) tuple. This patch series unifies the two, leaving the skb_frag_t typedef in place. This has the immediate advantage that we already have iov_iter support for bvecs and don't need to add support for iterating skbuffs. It enables a long-term plan to use bvecs more broadly within the kernel and should make network-storage drivers able to do less work converting between skbuffs and biovecs. It will consume more memory on 32-bit kernels. If that proves problematic, we can look at ways of addressing it. v3: Rebase on latest Linus with net-next merged. - Reorder the uncontroversial 'Use skb accessors' patches first so you can apply just those two if you want to hold off on the full conversion. - Convert all the users of 'struct skb_frag_struct' to skb_frag_t. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_device.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index 7c0b2b778703..4ec8a06fa5d1 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -243,14 +243,14 @@ static void tls_append_frag(struct tls_record_info *record,
skb_frag_t *frag;
frag = &record->frags[record->num_frags - 1];
- if (frag->page.p == pfrag->page &&
- frag->page_offset + frag->size == pfrag->offset) {
- frag->size += size;
+ if (skb_frag_page(frag) == pfrag->page &&
+ frag->page_offset + skb_frag_size(frag) == pfrag->offset) {
+ skb_frag_size_add(frag, size);
} else {
++frag;
- frag->page.p = pfrag->page;
+ __skb_frag_set_page(frag, pfrag->page);
frag->page_offset = pfrag->offset;
- frag->size = size;
+ skb_frag_size_set(frag, size);
++record->num_frags;
get_page(pfrag->page);
}
@@ -301,8 +301,8 @@ static int tls_push_record(struct sock *sk,
frag = &record->frags[i];
sg_unmark_end(&offload_ctx->sg_tx_data[i]);
sg_set_page(&offload_ctx->sg_tx_data[i], skb_frag_page(frag),
- frag->size, frag->page_offset);
- sk_mem_charge(sk, frag->size);
+ skb_frag_size(frag), frag->page_offset);
+ sk_mem_charge(sk, skb_frag_size(frag));
get_page(skb_frag_page(frag));
}
sg_mark_end(&offload_ctx->sg_tx_data[record->num_frags - 1]);