diff options
author | Mina Almasry <almasrymina@google.com> | 2024-04-10 12:05:02 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-04-11 19:29:23 -0700 |
commit | a580ea994fd37f4105028f5a85c38ff6508a2b25 (patch) | |
tree | 1cf42254477023e515e9ab8287988b3c0deba39f /net/tls/tls_device_fallback.c | |
parent | f6d827b180bda01f8805bf5e85307419b0d6f890 (diff) | |
download | linux-stable-a580ea994fd37f4105028f5a85c38ff6508a2b25.tar.gz linux-stable-a580ea994fd37f4105028f5a85c38ff6508a2b25.tar.bz2 linux-stable-a580ea994fd37f4105028f5a85c38ff6508a2b25.zip |
net: mirror skb frag ref/unref helpers
Refactor some of the skb frag ref/unref helpers for improved clarity.
Implement napi_pp_get_page() to be the mirror counterpart of
napi_pp_put_page().
Implement skb_page_ref() to be the mirror of skb_page_unref().
Improve __skb_frag_ref() to become a mirror counterpart of
__skb_frag_unref(). Previously unref could handle pp & non-pp pages,
while the ref could only handle non-pp pages. Now both the ref & unref
helpers can correctly handle both pp & non-pp pages.
Now that __skb_frag_ref() can handle both pp & non-pp pages, remove
skb_pp_frag_ref(), and use __skb_frag_ref() instead. This lets us
remove pp specific handling from skb_try_coalesce.
Additionally, since __skb_frag_ref() can now handle both pp & non-pp
pages, a latent issue in skb_shift() should now be fixed. Previously
this function would do a non-pp ref & pp unref on potential pp frags
(fragfrom). After this patch, skb_shift() should correctly do a pp
ref/unref on pp frags.
Signed-off-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20240410190505.1225848-3-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/tls/tls_device_fallback.c')
-rw-r--r-- | net/tls/tls_device_fallback.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tls/tls_device_fallback.c b/net/tls/tls_device_fallback.c index f9e3d3d90dcf..9237dded4467 100644 --- a/net/tls/tls_device_fallback.c +++ b/net/tls/tls_device_fallback.c @@ -278,7 +278,7 @@ static int fill_sg_in(struct scatterlist *sg_in, for (i = 0; remaining > 0; i++) { skb_frag_t *frag = &record->frags[i]; - __skb_frag_ref(frag); + __skb_frag_ref(frag, false); sg_set_page(sg_in + i, skb_frag_page(frag), skb_frag_size(frag), skb_frag_off(frag)); |