[05/11] backports: skbuf.h: Add skb_frag_off()
diff mbox series

Message ID 20191003155642.14909-6-hauke@hauke-m.de
State New
Headers show
Series
  • backports: Update to kernel 5.4-rc1
Related show

Commit Message

Hauke Mehrtens Oct. 3, 2019, 3:56 p.m. UTC
Add skb_frag_off() Which was added in upstream commit 7240b60c98d6
("linux: Add skb_frag_t page_offset accessors") which is used by the
usbnet driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/skbuff.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch
diff mbox series

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index de943916..589d2499 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -380,4 +380,16 @@  static inline struct sk_buff *__skb_peek(const struct sk_buff_head *list_)
 }
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,4,0)
+/**
+ * skb_frag_off() - Returns the offset of a skb fragment
+ * @frag: the paged fragment
+ */
+#define skb_frag_off LINUX_BACKPORT(skb_frag_off)
+static inline unsigned int skb_frag_off(const skb_frag_t *frag)
+{
+	return frag->page_offset;
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */