From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8FB40A320B for ; Mon, 21 Oct 2019 13:16:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7C7561BEC9; Mon, 21 Oct 2019 13:16:38 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id A459D1BEA0 for ; Mon, 21 Oct 2019 13:16:37 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iMVfx-0006Ac-Hx; Mon, 21 Oct 2019 11:16:37 +0000 From: Christian Ehrhardt To: Luca Boccassi , dpdk stable Cc: Thomas Monjalon , Christian Ehrhardt Date: Mon, 21 Oct 2019 13:16:34 +0200 Message-Id: <20191021111634.15500-4-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191021111634.15500-1-christian.ehrhardt@canonical.com> References: <20191021111634.15500-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 3/3] kni: fix kernel 5.4 build - skb_frag_t to bio_vec X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- 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