From patchwork Fri May 28 17:43:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 12287329 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96C71C2B9F7 for ; Fri, 28 May 2021 17:44:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 79B8961248 for ; Fri, 28 May 2021 17:44:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229450AbhE1Rpo (ORCPT ); Fri, 28 May 2021 13:45:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:46386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbhE1Rpn (ORCPT ); Fri, 28 May 2021 13:45:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E6B7B61175; Fri, 28 May 2021 17:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622223848; bh=X+iwczk3Ns0D1hfvBYSxHmdVFdtGvagusy5ToYnndXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fOYhQ11gfcT6BONtbowIRR9ebwGuVIoX1XMAas/2ci3lDtdmd+siBeBfj7Lm3hgDg aIyjtYvRUImt0lGZvHwl25GwkFL3pZBsRplzD+zDhoVAh/jM3YvRj6KBFVlqVjDlwH Gq0DOGuN2yuAOC2DKbPRJ8W++ZXkXXcR+gAZS4isAsqgKlCHYcOUxEXvOw9Qk4rG2P +xU8KSd23rRBtrzD1UNIXYs4Drt42eNbMbf3cM4DGyFtDva1k1fdLWRLBP/vtYSXMV KjWTYoCupqCEEPDEQjy67MYUm/c059Kel6kopA7KfRUXo9eSm/7ihqY9euj3sP/UdO Hj51VTue0HQjA== From: Lorenzo Bianconi To: bpf@vger.kernel.org Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, daniel@iogearbox.net, ast@kernel.org, echaudro@redhat.com, dsahern@gmail.com, magnus.karlsson@intel.com, toke@redhat.com, brouer@redhat.com, bjorn@kernel.org, maciej.fijalkowski@intel.com, john.fastabend@gmail.com Subject: [RFC bpf-next 1/4] net: xdp: introduce flags field in xdp_buff and xdp_frame Date: Fri, 28 May 2021 19:43:41 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net X-Patchwork-State: RFC Introduce flag field in xdp_buff and xdp_frame data structure in order to report xdp_buffer metadata. For the moment just hw checksum hints are defined but flags field will be reused for xdp multi-buffer For the moment just CHECKSUM_UNNECESSARY is supported. CHECKSUM_COMPLETE will need to set csum value in metada space. Co-developed-by: David Ahern Signed-off-by: David Ahern Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/net/xdp.h b/include/net/xdp.h index 5533f0ab2afc..e81ac505752b 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -66,6 +66,13 @@ struct xdp_txq_info { struct net_device *dev; }; +/* xdp metadata bitmask */ +#define XDP_CSUM_MASK GENMASK(1, 0) +enum xdp_flags { + XDP_CSUM_UNNECESSARY = BIT(0), + XDP_CSUM_COMPLETE = BIT(1), +}; + struct xdp_buff { void *data; void *data_end; @@ -74,6 +81,7 @@ struct xdp_buff { struct xdp_rxq_info *rxq; struct xdp_txq_info *txq; u32 frame_sz; /* frame size to deduce data_hard_end/reserved tailroom*/ + u16 flags; /* xdp_flags */ }; static __always_inline void @@ -81,6 +89,7 @@ xdp_init_buff(struct xdp_buff *xdp, u32 frame_sz, struct xdp_rxq_info *rxq) { xdp->frame_sz = frame_sz; xdp->rxq = rxq; + xdp->flags = 0; } static __always_inline void @@ -95,6 +104,18 @@ xdp_prepare_buff(struct xdp_buff *xdp, unsigned char *hard_start, xdp->data_meta = meta_valid ? data : data + 1; } +static __always_inline void +xdp_buff_get_csum(struct xdp_buff *xdp, struct sk_buff *skb) +{ + switch (xdp->flags & XDP_CSUM_MASK) { + case XDP_CSUM_UNNECESSARY: + skb->ip_summed = CHECKSUM_UNNECESSARY; + break; + default: + break; + } +} + /* Reserve memory area at end-of data area. * * This macro reserves tailroom in the XDP buffer by limiting the @@ -122,8 +143,21 @@ struct xdp_frame { */ struct xdp_mem_info mem; struct net_device *dev_rx; /* used by cpumap */ + u16 flags; /* xdp_flags */ }; +static __always_inline void +xdp_frame_get_csum(struct xdp_frame *xdpf, struct sk_buff *skb) +{ + switch (xdpf->flags & XDP_CSUM_MASK) { + case XDP_CSUM_UNNECESSARY: + skb->ip_summed = CHECKSUM_UNNECESSARY; + break; + default: + break; + } +} + #define XDP_BULK_QUEUE_SIZE 16 struct xdp_frame_bulk { int count; @@ -180,6 +214,7 @@ void xdp_convert_frame_to_buff(struct xdp_frame *frame, struct xdp_buff *xdp) xdp->data_end = frame->data + frame->len; xdp->data_meta = frame->data - frame->metasize; xdp->frame_sz = frame->frame_sz; + xdp->flags = frame->flags; } static inline @@ -206,6 +241,7 @@ int xdp_update_frame_from_buff(struct xdp_buff *xdp, xdp_frame->headroom = headroom - sizeof(*xdp_frame); xdp_frame->metasize = metasize; xdp_frame->frame_sz = xdp->frame_sz; + xdp_frame->flags = xdp->flags; return 0; } From patchwork Fri May 28 17:43:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 12287331 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 742FDC2B9F7 for ; Fri, 28 May 2021 17:44:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5255E613DA for ; Fri, 28 May 2021 17:44:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229559AbhE1Rpv (ORCPT ); Fri, 28 May 2021 13:45:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:46428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbhE1Rpq (ORCPT ); Fri, 28 May 2021 13:45:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 62D4E613B5; Fri, 28 May 2021 17:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622223851; bh=vpPbdfyPwSKrlEO/cazA/OQmRGsWg3i09s50a/Ckt6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Aci4mmdJOg2dAy1/JIhMQaxp8p6nPeZDJBDrp990uDMNu2bFzPLnBS5FzSEgzHjki eM6R+U8qMPugwxDqRC16GmWSMCk0hZDrlgCW0Cs/B32eR4XdEbWjmo+T09aUXQWQ38 iWdJK1uOPCx2hcgIZ8AYiQVoBrXFYNBSPqhpL3JRxG+/xhGN5mSarA7FuCoOW0lv4S ABMCTYF66ixBFGyu/EerkaJxjofVh3Z9urMOkeNDgxT9EZXLxmWi1NFh9DZMNiPba6 wRpASag++YVrAFbhFP0BCGLOvxbrDGYt339sO3B7ht6kDrn3ZqjLu1dAQXsvTaI6fO JzbFmIBu/qjKA== From: Lorenzo Bianconi To: bpf@vger.kernel.org Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, daniel@iogearbox.net, ast@kernel.org, echaudro@redhat.com, dsahern@gmail.com, magnus.karlsson@intel.com, toke@redhat.com, brouer@redhat.com, bjorn@kernel.org, maciej.fijalkowski@intel.com, john.fastabend@gmail.com Subject: [RFC bpf-next 2/4] mvneta: return csum computation result from mvneta_rx_csum Date: Fri, 28 May 2021 19:43:42 +0200 Message-Id: <3d89a6af46b4b381256e050f2a02f87db06ceabb.1622222367.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net X-Patchwork-State: RFC This is a preliminary patch to add hw csum hint support to mvneta xdp implementation Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 7d5cd9bc6c99..4a7c153a2666 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -1805,18 +1805,14 @@ static void mvneta_rx_error(struct mvneta_port *pp, } /* Handle RX checksum offload based on the descriptor's status */ -static void mvneta_rx_csum(struct mvneta_port *pp, u32 status, - struct sk_buff *skb) +static int mvneta_rx_csum(struct mvneta_port *pp, u32 status) { if ((pp->dev->features & NETIF_F_RXCSUM) && (status & MVNETA_RXD_L3_IP4) && - (status & MVNETA_RXD_L4_CSUM_OK)) { - skb->csum = 0; - skb->ip_summed = CHECKSUM_UNNECESSARY; - return; - } + (status & MVNETA_RXD_L4_CSUM_OK)) + return CHECKSUM_UNNECESSARY; - skb->ip_summed = CHECKSUM_NONE; + return CHECKSUM_NONE; } /* Return tx queue pointer (find last set bit) according to returned @@ -2335,7 +2331,7 @@ mvneta_swbm_build_skb(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, skb_reserve(skb, xdp->data - xdp->data_hard_start); skb_put(skb, xdp->data_end - xdp->data); - mvneta_rx_csum(pp, desc_status, skb); + skb->ip_summed = mvneta_rx_csum(pp, desc_status); for (i = 0; i < num_frags; i++) { skb_frag_t *frag = &sinfo->frags[i]; @@ -2532,7 +2528,7 @@ static int mvneta_rx_hwbm(struct napi_struct *napi, rx_bytes); skb->protocol = eth_type_trans(skb, dev); - mvneta_rx_csum(pp, rx_status, skb); + skb->ip_summed = mvneta_rx_csum(pp, rx_status); napi_gro_receive(napi, skb); rcvd_pkts++; @@ -2581,8 +2577,7 @@ static int mvneta_rx_hwbm(struct napi_struct *napi, skb_put(skb, rx_bytes); skb->protocol = eth_type_trans(skb, dev); - - mvneta_rx_csum(pp, rx_status, skb); + skb->ip_summed = mvneta_rx_csum(pp, rx_status); napi_gro_receive(napi, skb); } From patchwork Fri May 28 17:43:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 12287333 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D2FFC47087 for ; Fri, 28 May 2021 17:44:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8305861175 for ; Fri, 28 May 2021 17:44:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbhE1Rpx (ORCPT ); Fri, 28 May 2021 13:45:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:46448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhE1Rpu (ORCPT ); Fri, 28 May 2021 13:45:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B0ED960C40; Fri, 28 May 2021 17:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622223855; bh=dc4we71V4NXYR+WdYzLHVbYTBq8QtFZ0VZh7MZX5RA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jBFaZhR7/G/XwTxmZ7kl/BUyKKWMDlTAPftdCV5BzDZNpPtqAsFat+3Tm0gJGjCaP nw6S0so1fg4DPVGfa9YQqmXECl5wSDxVggspswGqBcyxQCH/t9Jfw8qzX6AKd8hWkH gUr1nFh2i3SgstfGWNjCBu+X2IOhJrVsqY/qUtQQhwMWNpEBeWkpmODGByVSXhS15T awj/v9cYiZzIkAiGy8/oPr9mI+J3k0Y285Ahp9wV6foR3qQCT8KY1AVZavuzn7z0Ve wM7Vv+SD1oJFhTMfLQ0AIX6vn5C46BHL7A8blRqQCox8cBmZO+ZOB1YEqcga5uD3LD lc/fNrHU8LGbw== From: Lorenzo Bianconi To: bpf@vger.kernel.org Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, daniel@iogearbox.net, ast@kernel.org, echaudro@redhat.com, dsahern@gmail.com, magnus.karlsson@intel.com, toke@redhat.com, brouer@redhat.com, bjorn@kernel.org, maciej.fijalkowski@intel.com, john.fastabend@gmail.com Subject: [RFC bpf-next 3/4] net: mvneta: report csum result in xdp_buff Date: Fri, 28 May 2021 19:43:43 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net X-Patchwork-State: RFC This patch allows reusing hw rx csum offloading performing XDP_REDIRECT from the mvneta driver Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 4a7c153a2666..95a51c2efa63 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -2263,6 +2263,7 @@ mvneta_swbm_rx_frame(struct mvneta_port *pp, prefetch(data); xdp_prepare_buff(xdp, data, pp->rx_offset_correction + MVNETA_MH_SIZE, data_len, false); + xdp->flags = mvneta_rx_csum(pp, rx_desc->status); sinfo = xdp_get_shared_info_from_buff(xdp); sinfo->nr_frags = 0; @@ -2317,7 +2318,7 @@ mvneta_swbm_add_rx_fragment(struct mvneta_port *pp, static struct sk_buff * mvneta_swbm_build_skb(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, - struct xdp_buff *xdp, u32 desc_status) + struct xdp_buff *xdp) { struct skb_shared_info *sinfo = xdp_get_shared_info_from_buff(xdp); int i, num_frags = sinfo->nr_frags; @@ -2331,7 +2332,7 @@ mvneta_swbm_build_skb(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, skb_reserve(skb, xdp->data - xdp->data_hard_start); skb_put(skb, xdp->data_end - xdp->data); - skb->ip_summed = mvneta_rx_csum(pp, desc_status); + xdp_buff_get_csum(xdp, skb); for (i = 0; i < num_frags; i++) { skb_frag_t *frag = &sinfo->frags[i]; @@ -2355,8 +2356,8 @@ static int mvneta_rx_swbm(struct napi_struct *napi, struct skb_shared_info sinfo; struct mvneta_stats ps = {}; struct bpf_prog *xdp_prog; - u32 desc_status, frame_sz; struct xdp_buff xdp_buf; + u32 frame_sz; xdp_init_buff(&xdp_buf, PAGE_SIZE, &rxq->xdp_rxq); xdp_buf.data_hard_start = NULL; @@ -2392,7 +2393,6 @@ static int mvneta_rx_swbm(struct napi_struct *napi, size = rx_desc->data_size; frame_sz = size - ETH_FCS_LEN; - desc_status = rx_status; mvneta_swbm_rx_frame(pp, rx_desc, rxq, &xdp_buf, &size, page); @@ -2421,7 +2421,7 @@ static int mvneta_rx_swbm(struct napi_struct *napi, mvneta_run_xdp(pp, rxq, xdp_prog, &xdp_buf, frame_sz, &ps)) goto next; - skb = mvneta_swbm_build_skb(pp, rxq, &xdp_buf, desc_status); + skb = mvneta_swbm_build_skb(pp, rxq, &xdp_buf); if (IS_ERR(skb)) { struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); From patchwork Fri May 28 17:43:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 12287335 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FEF7C2B9F7 for ; Fri, 28 May 2021 17:44:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DD6E61108 for ; Fri, 28 May 2021 17:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229585AbhE1Rp4 (ORCPT ); Fri, 28 May 2021 13:45:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:46474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbhE1Rpx (ORCPT ); Fri, 28 May 2021 13:45:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EBABA61248; Fri, 28 May 2021 17:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622223858; bh=U/75aorPZzn/IjooJ9pxtYsQOLtdO7c8hdkxGWaE3UY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q9ErbdE+6bnwgst51xDLni9hqMBCs/foB4jhuyWZbJfzbvo4ktQje6a+YQY1RseVS OL3c1fMJ9ReFWW55Geop16jbPhpwe12PIuD3Q4HaAxtW5pmzrQVj4MR198HgCMTd8y JdadFo7x1VCPQZV9hRCuikeZpqqrCX8SYTfmSa6a33BEIG31BIhbval42Uopt74K7V XcZ9BLJUq07fu44/GrQL/sLWV+a71gfBVDRy5xSdIxS9A0ttsHXEaTqn7Pfki+8eoh LBepYUpDWKOPrg7IwAHx8YQEPIfBw5QxX+uREIa7LYvIpRN3XvUq2UtmCnCMo80j0c tC9SANx7GWNIw== From: Lorenzo Bianconi To: bpf@vger.kernel.org Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, daniel@iogearbox.net, ast@kernel.org, echaudro@redhat.com, dsahern@gmail.com, magnus.karlsson@intel.com, toke@redhat.com, brouer@redhat.com, bjorn@kernel.org, maciej.fijalkowski@intel.com, john.fastabend@gmail.com Subject: [RFC bpf-next 4/4] net: xdp: update csum building the skb Date: Fri, 28 May 2021 19:43:44 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net X-Patchwork-State: RFC update skb->ip_summed and skb->csum filed building the skb in __xdp_build_skb_from_frame routine Co-developed-by: David Ahern Signed-off-by: David Ahern Signed-off-by: Lorenzo Bianconi --- net/core/xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/xdp.c b/net/core/xdp.c index 725d20f1b100..aadcbbc438c3 100644 --- a/net/core/xdp.c +++ b/net/core/xdp.c @@ -555,10 +555,10 @@ struct sk_buff *__xdp_build_skb_from_frame(struct xdp_frame *xdpf, skb->protocol = eth_type_trans(skb, dev); /* Optional SKB info, currently missing: - * - HW checksum info (skb->ip_summed) * - HW RX hash (skb_set_hash) * - RX ring dev queue index (skb_record_rx_queue) */ + xdp_frame_get_csum(xdpf, skb); /* Until page_pool get SKB return path, release DMA here */ xdp_release_frame(xdpf);