From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: Luca Boccassi <bluca@debian.org>, dpdk stable <stable@dpdk.org>
Cc: Thomas Monjalon <thomas@monjalon.net>,
Christian Ehrhardt <christian.ehrhardt@canonical.com>
Subject: [dpdk-stable] [PATCH 3/3] kni: fix kernel 5.4 build - skb_frag_t to bio_vec
Date: Mon, 21 Oct 2019 13:16:34 +0200 [thread overview]
Message-ID: <20191021111634.15500-4-christian.ehrhardt@canonical.com> (raw)
In-Reply-To: <20191021111634.15500-1-christian.ehrhardt@canonical.com>
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>
---
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
next prev parent reply other threads:[~2019-10-21 11:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 11:16 [dpdk-stable] [PATCH 0/3] kni: fix kernel 5.4 builds Christian Ehrhardt
2019-10-21 11:16 ` [dpdk-stable] [PATCH 1/3] kni: fix kernel 5.4 build - merged pci_aspm.h Christian Ehrhardt
2019-10-21 11:16 ` [dpdk-stable] [PATCH 2/3] kni: fix kernel 5.4 build - num_online_cpus Christian Ehrhardt
2019-10-21 11:16 ` Christian Ehrhardt [this message]
2019-10-21 17:30 ` [dpdk-stable] [PATCH 0/3] kni: fix kernel 5.4 builds Luca Boccassi
2019-10-24 15:58 ` Kevin Traynor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191021111634.15500-4-christian.ehrhardt@canonical.com \
--to=christian.ehrhardt@canonical.com \
--cc=bluca@debian.org \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).