lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 19 Jan 2021 14:23:31 -0800
From:   Alexander Duyck <alexander.duyck@...il.com>
To:     Xin Long <lucien.xin@...il.com>
Cc:     network dev <netdev@...r.kernel.org>,
        "linux-sctp @ vger . kernel . org" <linux-sctp@...r.kernel.org>,
        Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
        Neil Horman <nhorman@...driver.com>,
        David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jesse Brandeburg <jesse.brandeburg@...el.com>,
        Tony Nguyen <anthony.l.nguyen@...el.com>,
        intel-wired-lan <intel-wired-lan@...ts.osuosl.org>
Subject: Re: [PATCH net-next 1/6] net: add inline function skb_csum_is_sctp

On Fri, Jan 15, 2021 at 10:13 PM Xin Long <lucien.xin@...il.com> wrote:
>
> 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 <alexander.duyck@...il.com>
> Signed-off-by: Xin Long <lucien.xin@...il.com>

One minor nit. If you had to resubmit this I might move the ionic
driver code into a separate patch. However It can probably be accepted
as is.

Reviewed-by: Alexander Duyck <alexanderduyck@...com>

> ---
>  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);
>
> --
> 2.1.0
>

Powered by blists - more mailing lists