summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-10-21 13:16:34 +0200
committerKevin Traynor <ktraynor@redhat.com>2019-10-22 14:01:59 +0100
commitbfeb0ca97244a574522e7a152ab1780f50a3dc16 (patch)
tree01e12499fcaa887b12fd44c7b5dd9a8195cb5521
parentce6dbecb12d3bbcf33162cda669b6e4bbd3214b2 (diff)
downloaddpdk-stable-bfeb0ca97244a574522e7a152ab1780f50a3dc16.zip
dpdk-stable-bfeb0ca97244a574522e7a152ab1780f50a3dc16.tar.gz
dpdk-stable-bfeb0ca97244a574522e7a152ab1780f50a3dc16.tar.xz
kni: fix kernel 5.4 build - skb_frag_t to bio_vec
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@canonical.com> Acked-by: Luca Boccassi <bluca@debian.org>
-rw-r--r--kernel/linux/kni/ethtool/igb/igb_main.c12
1 files 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 cda2b06..69d3ea5 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;
}