diff mbox series

[net-next,v7,02/14] net: skb: introduce skb_data_area_size()

Message ID 20220506011616.1774805-3-ricardo.martinez@linux.intel.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: wwan: t7xx: PCIe driver for MediaTek M.2 modem | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/apply fail Patch does not apply to net-next

Commit Message

Ricardo Martinez May 6, 2022, 1:16 a.m. UTC
Helper to calculate the linear data space in the skb.

Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
---
 include/linux/skbuff.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Sergey Ryazanov May 6, 2022, 1:40 p.m. UTC | #1
On Fri, May 6, 2022 at 4:16 AM Ricardo Martinez
<ricardo.martinez@linux.intel.com> wrote:
>
> Helper to calculate the linear data space in the skb.
>
> Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>

Please refresh the patch, it does not apply to the current net-next tree.

Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
diff mbox series

Patch

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3270cb72e4d8..bd667c0129ad 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1665,6 +1665,11 @@  static inline void skb_set_end_offset(struct sk_buff *skb, unsigned int offset)
 }
 #endif
 
+static inline unsigned int skb_data_area_size(struct sk_buff *skb)
+{
+	return skb_end_pointer(skb) - skb->data;
+}
+
 struct ubuf_info *msg_zerocopy_alloc(struct sock *sk, size_t size);
 struct ubuf_info *msg_zerocopy_realloc(struct sock *sk, size_t size,
 				       struct ubuf_info *uarg);