[dpdk-stable] [PATCH 3/3] kni: fix kernel 5.4 build - skb_frag_t to bio_vec
Christian Ehrhardt
christian.ehrhardt at canonical.com
Mon Oct 21 13:16:34 CEST 2019
The kernel changed [1] skb_frag_struct to unify things with bio_vec in
the block layer. Due to that access to those elements needs to be
modified.
Former 'struct skb_frag_struct *' always were actually 'skb_frag_t *'
just behind a typedef. Since it now appears as bio_vec lets use that
type to have working access again.
Bio_vec carries the ofset under a different name so the element access
of skb_frag_t also changes from page_offset to bv_offset with kernel
5.4.
Not applying to master branch due to kni ethtool being removed in [2]
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8842d285
[2]: https://git.dpdk.org/dpdk/commit/?id=ea6b39b5
Signed-off-by: Christian Ehrhardt <christian.ehrhardt at canonical.com>
---
kernel/linux/kni/ethtool/igb/igb_main.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/kernel/linux/kni/ethtool/igb/igb_main.c b/kernel/linux/kni/ethtool/igb/igb_main.c
index cda2b063d..69d3ea5fa 100644
--- a/kernel/linux/kni/ethtool/igb/igb_main.c
+++ b/kernel/linux/kni/ethtool/igb/igb_main.c
@@ -5331,7 +5331,7 @@ static void igb_tx_map(struct igb_ring *tx_ring,
struct sk_buff *skb = first->skb;
struct igb_tx_buffer *tx_buffer;
union e1000_adv_tx_desc *tx_desc;
- struct skb_frag_struct *frag;
+ skb_frag_t *frag;
dma_addr_t dma;
unsigned int data_len, size;
u32 tx_flags = first->tx_flags;
@@ -8231,7 +8231,7 @@ static void igb_pull_tail(struct igb_ring *rx_ring,
union e1000_adv_rx_desc *rx_desc,
struct sk_buff *skb)
{
- struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];
+ skb_frag_t *frag = &skb_shinfo(skb)->frags[0];
unsigned char *va;
unsigned int pull_len;
@@ -8249,7 +8249,11 @@ static void igb_pull_tail(struct igb_ring *rx_ring,
/* update pointers to remove timestamp header */
skb_frag_size_sub(frag, IGB_TS_HDR_LEN);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
frag->page_offset += IGB_TS_HDR_LEN;
+#else
+ frag->bv_offset += pull_len;
+#endif
skb->data_len -= IGB_TS_HDR_LEN;
skb->len -= IGB_TS_HDR_LEN;
@@ -8269,7 +8273,11 @@ static void igb_pull_tail(struct igb_ring *rx_ring,
/* update all of the pointers */
skb_frag_size_sub(frag, pull_len);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
frag->page_offset += pull_len;
+#else
+ frag->bv_offset += pull_len;
+#endif
skb->data_len -= pull_len;
skb->tail += pull_len;
}
--
2.23.0
More information about the stable
mailing list