From patchwork Sat Jan 16 06:13:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 364998 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 D3B0DC433E9 for ; Sat, 16 Jan 2021 06:14:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE337206D4 for ; Sat, 16 Jan 2021 06:14:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726413AbhAPGOl (ORCPT ); Sat, 16 Jan 2021 01:14:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbhAPGOl (ORCPT ); Sat, 16 Jan 2021 01:14:41 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E111C0613D3; Fri, 15 Jan 2021 22:14:00 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id t6so5836829plq.1; Fri, 15 Jan 2021 22:14:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=I/5Du7qPUEoAkb/XhaPW7rJMvAwX/2S0SMJ5Ik87vvk=; b=oTLLb3ze9CaFXpQP4trMv2SGZ0RnAMg+FrqP0ctLs0vr2/fTEEVxRTg9QYSzes1VRL 29r9Ql1o4LjHvX7BOIal8O+In4K2MaYV/vcwL+68tRRK7tsDQQzPsTAvDvWH48dsTAo6 3j7MvPCmY0php0/57U/7U02tSavISNC/NdyeIUGmh+jbKUYBaFKUOHK/Ox1hfxQf0tCY n1issAJrv/DienryubwHhvlX5QFUazKSNGgwICQd9zVerwJya0WlUmj1bME7aJ3UEU3n ypZNyX1R76M+Xr5Lmib0kTpytxr+lMA+VBGvhxIh3oIkta9eoYS35e9mRlOgRw247rqF unfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=I/5Du7qPUEoAkb/XhaPW7rJMvAwX/2S0SMJ5Ik87vvk=; b=WoAkLmhzqbpBwy7Hqr0wzK2YlNr0gevP6tkx8SH2xiCC8vmWRlikRK5plEYb0bS/rI UZ97IyZun6GJAQFWbIIY1+LuMNShwmSGPUaCdUxl9K2DqmFqyUoUPgxeXOU87CNL7nwV SZXFww9pBOZuEARb2+hJgYWd1CkV7aXivx44xOETovHF4McMaEHJf0Rd0U9yKEHZPFQ9 5o5jPMLSrzXdbgYuGDaARL7Ef68MyA8+2QlDmej5Koju+9M/fwVdPpwSk+ep6oDnkn0R lKD6VK9Bs7M3y+xI9MJ1GCu5u8sH9NiQN0ymJNYGPHN8ykGEuucNjmB+PfTMCLzpxsKG mcEA== X-Gm-Message-State: AOAM532N6VEQkA/vhMMRcs1kwE0h8JwP/Z3kRJvXCx2Vp0gDVkVlpq8J S3DQXTpOKK/Bi1bP0SgnMtbRYqtRASFULA== X-Google-Smtp-Source: ABdhPJwYE1rCasHJsP2JtEWgQWy0+8wznldbHOM8YUKDYBiZc7Pl4iJ8egKOwPwk3lKaTdt14uGQ3g== X-Received: by 2002:a17:90a:9ac:: with SMTP id 41mr14531399pjo.46.1610777639488; Fri, 15 Jan 2021 22:13:59 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id t8sm10461353pjd.51.2021.01.15.22.13.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jan 2021 22:13:58 -0800 (PST) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: Marcelo Ricardo Leitner , Neil Horman , davem@davemloft.net, Jakub Kicinski , Alexander Duyck , Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org Subject: [PATCH net-next 1/6] net: add inline function skb_csum_is_sctp Date: Sat, 16 Jan 2021 14:13:37 +0800 Message-Id: <34c9f5b8c31610687925d9db1f151d5bc87deba7.1610777159.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch is to define a inline function skb_csum_is_sctp(), and also replace all places where it checks if it's a SCTP CSUM skb. This function would be used later in many networking drivers in the following patches. Suggested-by: Alexander Duyck Signed-off-by: Xin Long Reviewed-by: Alexander Duyck Acked-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 2 +- include/linux/skbuff.h | 5 +++++ net/core/dev.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index ac4cd5d..162a1ff 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -979,7 +979,7 @@ static int ionic_tx_calc_csum(struct ionic_queue *q, struct sk_buff *skb) stats->vlan_inserted++; } - if (skb->csum_not_inet) + if (skb_csum_is_sctp(skb)) stats->crc32_csum++; else stats->csum++; diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index c9568cf..46f901a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -4621,6 +4621,11 @@ static inline void skb_reset_redirect(struct sk_buff *skb) #endif } +static inline bool skb_csum_is_sctp(struct sk_buff *skb) +{ + return skb->csum_not_inet; +} + static inline void skb_set_kcov_handle(struct sk_buff *skb, const u64 kcov_handle) { diff --git a/net/core/dev.c b/net/core/dev.c index 0a31d4e..bbd306f 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3617,7 +3617,7 @@ static struct sk_buff *validate_xmit_vlan(struct sk_buff *skb, int skb_csum_hwoffload_help(struct sk_buff *skb, const netdev_features_t features) { - if (unlikely(skb->csum_not_inet)) + if (unlikely(skb_csum_is_sctp(skb))) return !!(features & NETIF_F_SCTP_CRC) ? 0 : skb_crc32c_csum_help(skb); From patchwork Sat Jan 16 06:13:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 365412 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 D7313C433E6 for ; Sat, 16 Jan 2021 06:15:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADAEB23AA9 for ; Sat, 16 Jan 2021 06:15:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726502AbhAPGOt (ORCPT ); Sat, 16 Jan 2021 01:14:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbhAPGOs (ORCPT ); Sat, 16 Jan 2021 01:14:48 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 698E1C061793; Fri, 15 Jan 2021 22:14:08 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id v1so6293379pjr.2; Fri, 15 Jan 2021 22:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=/iL/g7I8EapQ7hx/Ua42HZrRsvsGuh8TkarNGwQsIs8=; b=gB937wVqSTEEqgO4ChtFvHK3VK3JSjkIepCYK5rBbNLDVN8uQ2ycZXkcxgJIPZ5lN+ oSPfWgjLRy47C0aKrjnoz3vsDKV4HPitJLVVZi3jJ+KbMHRZYrBYlN/z/nKnH3YE6rBG khfL8WOCDNRbeSLjdVOjfaHuZRp8oczRC0nmVPO6wlgzWeTaaHr20/aXeovupBIGfzfY zBKwotFTysy9nhmp0peXofo7arXQ1TIL3L/i/1ErTu4yxsfMHlR5jAAG20MXB1IIoA3k BfCvT3cOPfwnBHwL9AabCLBsTfdDFS+E123bOTnZ7v0FRmzVJToef1LxFvziNZ/JrLdL dGmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=/iL/g7I8EapQ7hx/Ua42HZrRsvsGuh8TkarNGwQsIs8=; b=dg5t60s8ZM5OsnY2lcANdkUB1USeyfBTRAAUx34q9pk5DRukS+pTDKZ/supZ5GeR+5 sOxvuL5Q6X2Ntfc0JirwgQcxe3UF0xEWjovPFPNdNaXK9GLpQFMW1WmU0uPfmUht7a3g 1b4za3P4eaWhIOrbql+/4CNAV/WhmvEmc8GBs0RekwAk/vHTDc9MhULqI1sGJOlVosLI +zhjQx54xUedYPclkVrYLYCVUyl5OwAXPmQKlYvIb4GU37y6VR93waFFun7iM2ooZIJc k1R6y3kmgMH2QBzH1lA9uHzdqDWTEQa0rOtPu1x893FdNeD8GzjFgLufLAdP7c5lWslm P4XA== X-Gm-Message-State: AOAM5338uFHfubxXLd+UzjbdmOXUHErtHvBLlR1AWoGSF0UcuiSWD6IV hg0YB6ZnhXrWF3xxYCXewGWXOhhZFzaVTQ== X-Google-Smtp-Source: ABdhPJxLveKMeCpGPHjtVz4XEHzWNkVtXJXc6F6ZL4bY7V2ABEPcgX7nQoGKkKf27M9Tj8v6vzP9xA== X-Received: by 2002:a17:90b:305:: with SMTP id ay5mr14955006pjb.4.1610777647794; Fri, 15 Jan 2021 22:14:07 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id 19sm9658182pfn.133.2021.01.15.22.14.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jan 2021 22:14:07 -0800 (PST) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: Marcelo Ricardo Leitner , Neil Horman , davem@davemloft.net, Jakub Kicinski , Alexander Duyck , Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org Subject: [PATCH net-next 2/6] net: igb: use skb_csum_is_sctp instead of protocol check Date: Sat, 16 Jan 2021 14:13:38 +0800 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: <34c9f5b8c31610687925d9db1f151d5bc87deba7.1610777159.git.lucien.xin@gmail.com> References: <34c9f5b8c31610687925d9db1f151d5bc87deba7.1610777159.git.lucien.xin@gmail.com> In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC checksum offload packet, and there is no need to parse the packet to check its proto field, especially when it's a UDP or GRE encapped packet. So this patch also makes igb support SCTP CRC checksum offload for UDP and GRE encapped packets. Signed-off-by: Xin Long Reviewed-by: Alexander Duyck --- drivers/net/ethernet/intel/igb/igb_main.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 03f78fd..8757ad0 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -5959,15 +5959,6 @@ static int igb_tso(struct igb_ring *tx_ring, return 1; } -static inline bool igb_ipv6_csum_is_sctp(struct sk_buff *skb) -{ - unsigned int offset = 0; - - ipv6_find_hdr(skb, &offset, IPPROTO_SCTP, NULL, NULL); - - return offset == skb_checksum_start_offset(skb); -} - static void igb_tx_csum(struct igb_ring *tx_ring, struct igb_tx_buffer *first) { struct sk_buff *skb = first->skb; @@ -5990,10 +5981,7 @@ static void igb_tx_csum(struct igb_ring *tx_ring, struct igb_tx_buffer *first) break; case offsetof(struct sctphdr, checksum): /* validate that this is actually an SCTP request */ - if (((first->protocol == htons(ETH_P_IP)) && - (ip_hdr(skb)->protocol == IPPROTO_SCTP)) || - ((first->protocol == htons(ETH_P_IPV6)) && - igb_ipv6_csum_is_sctp(skb))) { + if (skb_csum_is_sctp(skb)) { type_tucmd = E1000_ADVTXD_TUCMD_L4T_SCTP; break; } From patchwork Sat Jan 16 06:13:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 364997 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 24C37C433E0 for ; Sat, 16 Jan 2021 06:15:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D30F23AA9 for ; Sat, 16 Jan 2021 06:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726633AbhAPGO5 (ORCPT ); Sat, 16 Jan 2021 01:14:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbhAPGO5 (ORCPT ); Sat, 16 Jan 2021 01:14:57 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6C64C061794; Fri, 15 Jan 2021 22:14:16 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id m6so6891617pfm.6; Fri, 15 Jan 2021 22:14:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=uvk0y2wENIsw6rNbF1+OkFOxLr21ev6bXBNVBL+g4HU=; b=ZNCpCUkAxqUeDra4bYat8qk9p9VWE1LQhAyFYufQ6mEdxVK2AuwF97T3rwO0nkneX9 l/7wLnhi11YARgirZC6yyMt3A7kdP1d1rnXWzI24VZEpW1O9JGIIrDkhUZedEBW+VIjV OKT1Fydi6UYRGbnUWc25RXE7s56kgBF+Aic4W2ckaE8JFjdipL5c2+W0aM4M4Xmvz+Pn 2f0TvIT+Yue7pqhe7ZIeEiKVXtzI/d/wAhbLPV9wDav45kn4FZTRYhIAzpAvso4e/caV JbyDMTB9Wui1eRVGMI4BT/0mjDRpPFWtjG0jjA0tCu0QKpEiVrgB2HwY01unbOs2omA0 /ECQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=uvk0y2wENIsw6rNbF1+OkFOxLr21ev6bXBNVBL+g4HU=; b=ivj9HBMMYncre9BoOb+jWx43GDVWaHfANxzSiGckHovfaXL7kwX1l+ok/JoHpynTUe cBllWG7nvN6ul9Bmsz6QMHRbF2g9yPWr8LIravJW5Ek8ac11CvS6C45/+gTRdnE5mKnB jp1PJMtLTUsEUNMIgIvGcEuKzdEAoDJCslzLYgQ0sAwR8s/opOItYJQ8Y0cC16BUjA8T y8MHwmXKzRgtM7hOT2pERzEyZXKeJy7HloZDOey5Om4rYy4JVQ3j9f0/WXBglSnxR+/i UYsfhv0VJdjc1Anm8hosUFO8MukaHC8I/LqLGSQwqqRtLUUDf7sntc++INnpEieb0DRL sbIQ== X-Gm-Message-State: AOAM531/AM9o8hxQVOm0jbSlSrN1D/ClllkjQ4hiSS4AAuEAAXe+4skL rmLzxhvv2xhV1FTNewZZonzJXtDiKrtkMw== X-Google-Smtp-Source: ABdhPJwoc/sR8PjU9Laii5iV7OfMXQl+IWjX9V4X6Y7mAAcvpLXovNzIXFrw1UvSb+dhbq71uX/7ag== X-Received: by 2002:a63:43c6:: with SMTP id q189mr16036820pga.245.1610777656113; Fri, 15 Jan 2021 22:14:16 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id 129sm9663877pfw.86.2021.01.15.22.14.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jan 2021 22:14:15 -0800 (PST) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: Marcelo Ricardo Leitner , Neil Horman , davem@davemloft.net, Jakub Kicinski , Alexander Duyck , Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org Subject: [PATCH net-next 3/6] net: igbvf: use skb_csum_is_sctp instead of protocol check Date: Sat, 16 Jan 2021 14:13:39 +0800 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: References: <34c9f5b8c31610687925d9db1f151d5bc87deba7.1610777159.git.lucien.xin@gmail.com> In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC checksum offload packet, and yet it also makes igbvf support SCTP CRC checksum offload for UDP and GRE encapped packets, just as it does in igb driver. Signed-off-by: Xin Long Reviewed-by: Alexander Duyck --- drivers/net/ethernet/intel/igbvf/netdev.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index 30fdea2..fb3fbcb 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c @@ -2072,15 +2072,6 @@ static int igbvf_tso(struct igbvf_ring *tx_ring, return 1; } -static inline bool igbvf_ipv6_csum_is_sctp(struct sk_buff *skb) -{ - unsigned int offset = 0; - - ipv6_find_hdr(skb, &offset, IPPROTO_SCTP, NULL, NULL); - - return offset == skb_checksum_start_offset(skb); -} - static bool igbvf_tx_csum(struct igbvf_ring *tx_ring, struct sk_buff *skb, u32 tx_flags, __be16 protocol) { @@ -2102,10 +2093,7 @@ static bool igbvf_tx_csum(struct igbvf_ring *tx_ring, struct sk_buff *skb, break; case offsetof(struct sctphdr, checksum): /* validate that this is actually an SCTP request */ - if (((protocol == htons(ETH_P_IP)) && - (ip_hdr(skb)->protocol == IPPROTO_SCTP)) || - ((protocol == htons(ETH_P_IPV6)) && - igbvf_ipv6_csum_is_sctp(skb))) { + if (skb_csum_is_sctp(skb)) { type_tucmd = E1000_ADVTXD_TUCMD_L4T_SCTP; break; } From patchwork Sat Jan 16 06:13:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 365411 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 64BE5C4332B for ; Sat, 16 Jan 2021 06:15:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4012A23AA9 for ; Sat, 16 Jan 2021 06:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726669AbhAPGPD (ORCPT ); Sat, 16 Jan 2021 01:15:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbhAPGPC (ORCPT ); Sat, 16 Jan 2021 01:15:02 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9777AC061795; Fri, 15 Jan 2021 22:14:22 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id h10so6888868pfo.9; Fri, 15 Jan 2021 22:14:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=V2nEP27oGTcNy8IrU1fSA3OjNH51LnvWbCcr7tSh5c4=; b=bGjvKnbY+JV9g1sz/zHa0oU2w2C0idy+1+ZliPwg8xRc2aJP+MnrANHVyu8X0UT0hN J5M29sLWMEIbCec47kB7sRD6NLB6iUkAyaLFwEfpmsb+EY0h5EeV37f8LZsZRLwZR68y hPtUhSQqdGyT37M0dOr5Myagv/IUC+0js7TnMF7TDuib5eOhnhKRwWy3mzRb6GHdaLz7 ZuE2C66mwjmtfDHwIXi6ocUZeHenQkWUFB86jdvB/xVW+sikj5LDQGEwuuzMjQNZ4WMO zgTETYT3JmNkoADYLl1+AruRau4yYTgjzw+f4k7rDejFXcjutW8xELStSBFH42tW+M73 TL2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=V2nEP27oGTcNy8IrU1fSA3OjNH51LnvWbCcr7tSh5c4=; b=rjngdJtYphudYiNpVsxfZt07bnpz2gCC+QJbufXe3DdTeZ328r+eJJtFBmH3kwwNxh H5vM8aTBZaC75P5i6HwOmldXUpuU0i3xHhW3/NblrRfPkK9PZZ4HNaetSwVDV9y/dxaf U14U9rH//do1WTd1vbzbZZy04lOQS7jpxMxx3CPVnbxxtwp6YRSIoiSQWtkXjELuYKOv ThmAPotSWNBQAyNvEzFtC9eBFBV/bgrRa9ZXrOx3sf0Tgz6QO/a9qWoYxzFJOC0cS6gK 9YcEiBpfTxxa71dwujOOEpRCgQVm2wBcfYudzmRd+K+TcAnhdvxGVxCatl9HeLhw5gXV k2pQ== X-Gm-Message-State: AOAM530dgylQ2ZcOHq3DJdGtyKNnNivhlniseViqqQAbzNJgt39TB8v2 /Ov62QwZe/pQ6mww5IM+TKXy4ok4RFsC7g== X-Google-Smtp-Source: ABdhPJyyy42brQiNKCwn9At6xMddGS+824+a+h4kd+1mpMebf24dzNCMMmkQFeKXtYh5D0bHp7U+IA== X-Received: by 2002:a63:1110:: with SMTP id g16mr16274126pgl.357.1610777661982; Fri, 15 Jan 2021 22:14:21 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id f24sm9447968pjj.5.2021.01.15.22.14.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jan 2021 22:14:21 -0800 (PST) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: Marcelo Ricardo Leitner , Neil Horman , davem@davemloft.net, Jakub Kicinski , Alexander Duyck , Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org Subject: [PATCH net-next 4/6] net: igc: use skb_csum_is_sctp instead of protocol check Date: Sat, 16 Jan 2021 14:13:40 +0800 Message-Id: <7b4d84fe32d588884fcd75c2f6f84eb8cd052622.1610777159.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: <34c9f5b8c31610687925d9db1f151d5bc87deba7.1610777159.git.lucien.xin@gmail.com> In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC checksum offload packet, and yet it also makes igc support SCTP CRC checksum offload for UDP and GRE encapped packets, just as it does in igb driver. Signed-off-by: Xin Long Reviewed-by: Alexander Duyck --- drivers/net/ethernet/intel/igc/igc_main.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index afd6a62..43aec42 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -949,15 +949,6 @@ static void igc_tx_ctxtdesc(struct igc_ring *tx_ring, } } -static inline bool igc_ipv6_csum_is_sctp(struct sk_buff *skb) -{ - unsigned int offset = 0; - - ipv6_find_hdr(skb, &offset, IPPROTO_SCTP, NULL, NULL); - - return offset == skb_checksum_start_offset(skb); -} - static void igc_tx_csum(struct igc_ring *tx_ring, struct igc_tx_buffer *first) { struct sk_buff *skb = first->skb; @@ -980,10 +971,7 @@ static void igc_tx_csum(struct igc_ring *tx_ring, struct igc_tx_buffer *first) break; case offsetof(struct sctphdr, checksum): /* validate that this is actually an SCTP request */ - if ((first->protocol == htons(ETH_P_IP) && - (ip_hdr(skb)->protocol == IPPROTO_SCTP)) || - (first->protocol == htons(ETH_P_IPV6) && - igc_ipv6_csum_is_sctp(skb))) { + if (skb_csum_is_sctp(skb)) { type_tucmd = IGC_ADVTXD_TUCMD_L4T_SCTP; break; } From patchwork Sat Jan 16 06:13:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 364996 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 15C40C433DB for ; Sat, 16 Jan 2021 06:15:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4B9823AA9 for ; Sat, 16 Jan 2021 06:15:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726710AbhAPGPN (ORCPT ); Sat, 16 Jan 2021 01:15:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbhAPGPM (ORCPT ); Sat, 16 Jan 2021 01:15:12 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8010C061796; Fri, 15 Jan 2021 22:14:30 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id x126so6884882pfc.7; Fri, 15 Jan 2021 22:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=GcDQDv7mFHcGzkL4z+RhUvR05OkRKTeW0Xhqt5i/PZc=; b=YyOsnKFsHbCCOnTLmJKeqet080Pd14q0jBAKWAnJz0hX9kpU44mvuJcBaesXsg64ST 6bKPjzj+/HetnFOx2C2NTYicW2Xn9Om0LhlTtGnjvNp1/gU40KgDmUarRbqsBA0b3Xvv pGxmXTWzRWWflsIQYQawDa+J484K1aAZuTpV8s4+bR7zP1Y86bEM0Kg8/hjvPS+fSj5U YqfP51movbhNtI4sPdTFLKyXHRw4A4nJhyDe2peak0nLa8y9i45gsQMeYUaHqelCOmAq p7aolZ0XIr14JFiDPcyu4yl6r8doSXOS5G3wPqbQv/Zd3OmS/ssDOphM7sTJ2UEHMM2C arxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=GcDQDv7mFHcGzkL4z+RhUvR05OkRKTeW0Xhqt5i/PZc=; b=IaGr4S0YqjE9qVjTApxgTQ5s/d2t9ILGEG5eBWqGxngqr9C/ecaieYGbjuwoUY5RjH K5oUQjYbLEDobBnVsdNhQqHanP71PJ2n3pl4tq2p67UX5AUb16TFvZF8hclWYMg0lobh Im04jI2nskGrpq2hu2ScuOgk/Wjuw1SaD1mQpUZFzbcGpUO7W513hEudjUtkSwxLHXQh uP+FCocOYr/xtAG6/T0WI8jQgaSdsyTwGjzr75K1Dtus0YCai8AjE/sjNSj6ilFYFilL mKW/oEW0SWExAatukfBQ7YPPsUyp+3Wi10w0M5Zx7ycauewaVcvIb8BchzKOumlfrrAy DH5g== X-Gm-Message-State: AOAM531JyYqX4VTiUmrpd93HuhMvGMnhj//wo824Rk3NQoePsG/nGk61 Qok/JnWyhwsNHrqkxt449pOXFf1QY9idkw== X-Google-Smtp-Source: ABdhPJxETlwAXI2t5X+FU6+CsHVtHCXjSMbknJQFc+8hdJKgfKrSOvWgMOyi9vIPNWMHLCnfN8lFkA== X-Received: by 2002:a65:5283:: with SMTP id y3mr16253618pgp.174.1610777670297; Fri, 15 Jan 2021 22:14:30 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id w200sm9864931pfc.14.2021.01.15.22.14.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jan 2021 22:14:29 -0800 (PST) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: Marcelo Ricardo Leitner , Neil Horman , davem@davemloft.net, Jakub Kicinski , Alexander Duyck , Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org Subject: [PATCH net-next 5/6] net: ixgbe: use skb_csum_is_sctp instead of protocol check Date: Sat, 16 Jan 2021 14:13:41 +0800 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: <7b4d84fe32d588884fcd75c2f6f84eb8cd052622.1610777159.git.lucien.xin@gmail.com> References: <34c9f5b8c31610687925d9db1f151d5bc87deba7.1610777159.git.lucien.xin@gmail.com> <7b4d84fe32d588884fcd75c2f6f84eb8cd052622.1610777159.git.lucien.xin@gmail.com> In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC checksum offload packet, and yet it also makes ixgbe support SCTP CRC checksum offload for UDP and GRE encapped packets, just as it does in igb driver. Signed-off-by: Xin Long Reviewed-by: Alexander Duyck --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 6cbbe09..2973c54 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -8040,15 +8040,6 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring, return 1; } -static inline bool ixgbe_ipv6_csum_is_sctp(struct sk_buff *skb) -{ - unsigned int offset = 0; - - ipv6_find_hdr(skb, &offset, IPPROTO_SCTP, NULL, NULL); - - return offset == skb_checksum_start_offset(skb); -} - static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring, struct ixgbe_tx_buffer *first, struct ixgbe_ipsec_tx_data *itd) @@ -8074,10 +8065,7 @@ static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring, break; case offsetof(struct sctphdr, checksum): /* validate that this is actually an SCTP request */ - if (((first->protocol == htons(ETH_P_IP)) && - (ip_hdr(skb)->protocol == IPPROTO_SCTP)) || - ((first->protocol == htons(ETH_P_IPV6)) && - ixgbe_ipv6_csum_is_sctp(skb))) { + if (skb_csum_is_sctp(skb)) { type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_SCTP; break; } From patchwork Sat Jan 16 06:13:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 365410 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 5955FC433E9 for ; Sat, 16 Jan 2021 06:15:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26CD3206D4 for ; Sat, 16 Jan 2021 06:15:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbhAPGPU (ORCPT ); Sat, 16 Jan 2021 01:15:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbhAPGPT (ORCPT ); Sat, 16 Jan 2021 01:15:19 -0500 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45BFCC061757; Fri, 15 Jan 2021 22:14:39 -0800 (PST) Received: by mail-pg1-x52d.google.com with SMTP id n10so7405769pgl.10; Fri, 15 Jan 2021 22:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=tdERieQxHdGfwIbBa+vBjrBhMvCQN0KrezwB3bCvhCI=; b=AjcIgbmspBRodbPF6HCP12RUDlCEdUblG8XgtE6rAarmbJbtnjqyW9JxUvl2IJYV1e F6SJBjnt5ofo5gojJxy4deiqtVaQUguzqUpeQF4D0+gDroeYtpC+ecQ86SKT9Vb3NOy/ eIJ+SisYel2+kYCVsbNNT70NJ2ny5P5mzNtfNHibf+rDppRbGGupUZUDDcsnPxpl085U EGb+O7JpM+uD76HSJuBKLBA0zh8Q0jc75fCC/LRWCPEXgAif69mx8VQVsEMGuotoAvSN JSvV8CDACiLR6GGHsNZYteuY03NTiWAa6ka0WyS6CQVe/EqZzHYmAgmpeiu+iCsfpu6R PiNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=tdERieQxHdGfwIbBa+vBjrBhMvCQN0KrezwB3bCvhCI=; b=qyogI8qK0/k4cqHG0M2xs5osuNKOHtdFWpsDKsAJkEfJVvaQnC0+FCkrnBRT2uCAGg Tl2mbdrU3fvutQFZ+wvYqkcz8RXOsjy0KamKTCoRJ0QuNb0ufnRiY2079skpwp1nKdT0 xpFLWLyu4lsBIEEe4bctKn1lbi4mWjmf7aUPOR0frRFIwfTas/89Jbnwt5Zq02x/IUov WbTBgcW9dIGLub0CTwqhTKcETX3hACaFKkKRSqEgveeQB2Tta1Ur1yf1OlQ9KNjL3RBN wnhfykfD3G+5VwsJ8wzcNetK5dTPlc3WQGas83VwmNdgBG/jpRfrTx1H5M1D3pjhgycT aOMA== X-Gm-Message-State: AOAM530FA6JjuRY5Vcsuac+OS74O570Aw28CUW5rPAM31A2TDX47fRMB IrHLw4wpbPYTcdgjzXspT8clW9pCqX5K/g== X-Google-Smtp-Source: ABdhPJyHhkO2bjdkIB45X0LnolVIdaFq4kG082tSkw1Um22ir/+9vGKKnuz4igyhIXt4mGN0dy7uKg== X-Received: by 2002:a05:6a00:a88:b029:19e:4ba8:bbe4 with SMTP id b8-20020a056a000a88b029019e4ba8bbe4mr16769998pfl.41.1610777678637; Fri, 15 Jan 2021 22:14:38 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id y189sm9593875pfb.155.2021.01.15.22.14.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jan 2021 22:14:38 -0800 (PST) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: Marcelo Ricardo Leitner , Neil Horman , davem@davemloft.net, Jakub Kicinski , Alexander Duyck , Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org Subject: [PATCH net-next 6/6] net: ixgbevf: use skb_csum_is_sctp instead of protocol check Date: Sat, 16 Jan 2021 14:13:42 +0800 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: References: <34c9f5b8c31610687925d9db1f151d5bc87deba7.1610777159.git.lucien.xin@gmail.com> <7b4d84fe32d588884fcd75c2f6f84eb8cd052622.1610777159.git.lucien.xin@gmail.com> In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC checksum offload packet, and yet it also makes ixgbevf support SCTP CRC checksum offload for UDP and GRE encapped packets, just as it does in igb driver. Signed-off-by: Xin Long Reviewed-by: Alexander Duyck --- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 4061cd7..cd9d79f 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -3844,15 +3844,6 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring, return 1; } -static inline bool ixgbevf_ipv6_csum_is_sctp(struct sk_buff *skb) -{ - unsigned int offset = 0; - - ipv6_find_hdr(skb, &offset, IPPROTO_SCTP, NULL, NULL); - - return offset == skb_checksum_start_offset(skb); -} - static void ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring, struct ixgbevf_tx_buffer *first, struct ixgbevf_ipsec_tx_data *itd) @@ -3873,10 +3864,7 @@ static void ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring, break; case offsetof(struct sctphdr, checksum): /* validate that this is actually an SCTP request */ - if (((first->protocol == htons(ETH_P_IP)) && - (ip_hdr(skb)->protocol == IPPROTO_SCTP)) || - ((first->protocol == htons(ETH_P_IPV6)) && - ixgbevf_ipv6_csum_is_sctp(skb))) { + if (skb_csum_is_sctp(skb)) { type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_SCTP; break; }