From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BFD45A04FF; Wed, 23 Mar 2022 09:39:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64CB541140; Wed, 23 Mar 2022 09:39:50 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 4AA3B41104 for ; Wed, 23 Mar 2022 09:39:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648024788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nqLzEBqgkKlJ91koEPmmEdmc7Ni6L/N6KBtZIKy+/g8=; b=cvaz3Rla57K5QQ2j2Tu76DoqclrptLSPnWbl7hiqV2PQaMZh66fUMNrwrqoYJly8Jd1JLh D41hTUHm6JTxZdTe2G7b5r9Fm6qb3379yroh+HF2z3Hv34VV2ToRNimW3SNoOwYyE40dZ6 LeIsTjzI78IccDkcUc7fQjNPVh3qCJg= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-27-kqkJuR9MPhaez7A8w_1P8g-1; Wed, 23 Mar 2022 04:39:47 -0400 X-MC-Unique: kqkJuR9MPhaez7A8w_1P8g-1 Received: by mail-lf1-f69.google.com with SMTP id k19-20020a0565123d9300b0044a37518903so362468lfv.10 for ; Wed, 23 Mar 2022 01:39:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nqLzEBqgkKlJ91koEPmmEdmc7Ni6L/N6KBtZIKy+/g8=; b=UpyfwM0Nk9UUvg19xWZM2R/gp1J5ReK7Iu/I/cAKbw0W79s56CCF4JD+j3t9Qarymb eBHPEkMFq43EEkluctiXgV6DwycpsR08qVjMtWWnnha99hUQ1O2rXIboK3788o6tDh/E yaGiKVSSThTH9wyAjvR7ZamVLQqcYWBDdI8X4xXsdMWVJO+3yLd4r8mHxkq86a9R0sUc 0AbE39Q2x1m1pqCssgHuKSSyP/TZEaT2QHHzFRcRgs8LVh1jtgNHmCb45Fefl2+upMtr QATUyFJJ0j5aK2tS/tzXzsYgGaWTnkadFAOAajoCKeay7mi88BZ3Kc88GiByBbFORMWe QESw== X-Gm-Message-State: AOAM532+ms42ewsRCqnBcfeeOvddfThguZsa+3icyMY6g5TJqNbEx1v3 OXyR1fldUyPWTgv/pmEc8dbja9JCz/r75aJdYpjmHvLKtbHYqMDAFUWQsCHmJu2K0NI2iQLKAHm 1W5E4uIQQACSed7u3RbU= X-Received: by 2002:a05:6512:1506:b0:448:2f28:91ec with SMTP id bq6-20020a056512150600b004482f2891ecmr20915856lfb.217.1648024785836; Wed, 23 Mar 2022 01:39:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7XfDJDG+WrPIOXPzt2bMkDV6/tN9qyQ/PZcwxmRijYkoEKmNVukJD/CujoXRC/wJeKBaUnHSZ31+AY1YodI4= X-Received: by 2002:a05:6512:1506:b0:448:2f28:91ec with SMTP id bq6-20020a056512150600b004482f2891ecmr20915846lfb.217.1648024785639; Wed, 23 Mar 2022 01:39:45 -0700 (PDT) MIME-Version: 1.0 References: <1648009687-19957-1-git-send-email-longli@linuxonhyperv.com> In-Reply-To: <1648009687-19957-1-git-send-email-longli@linuxonhyperv.com> From: David Marchand Date: Wed, 23 Mar 2022 09:39:34 +0100 Message-ID: Subject: Re: [PATCH] net/netvsc: fix the calculation of checksums based on mbuf flag To: longli@linuxonhyperv.com Cc: dev , Stephen Hemminger , Long Li Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Mar 23, 2022 at 5:28 AM wrote: > > From: Long Li > > The netvsc should use RTE_MBUF_F_TX_L4_MASK and check the value to decide > the correct way to calculate checksums. It's better to describe what the impact for an application is. Do I understand correctly that UDP checksum offloading was broken? I guess you want this backported. Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") Cc: stable@dpdk.org > > Signed-off-by: Long Li > --- > drivers/net/netvsc/hn_rxtx.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c > index 028f176c7e..34f40be5b8 100644 > --- a/drivers/net/netvsc/hn_rxtx.c > +++ b/drivers/net/netvsc/hn_rxtx.c > @@ -1348,8 +1348,11 @@ static void hn_encap(struct rndis_packet_msg *pkt, > *pi_data = NDIS_LSO2_INFO_MAKEIPV4(hlen, > m->tso_segsz); > } > - } else if (m->ol_flags & > - (RTE_MBUF_F_TX_TCP_CKSUM | RTE_MBUF_F_TX_UDP_CKSUM | RTE_MBUF_F_TX_IP_CKSUM)) { > + } else if ((m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == > + RTE_MBUF_F_TX_TCP_CKSUM || > + (m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == > + RTE_MBUF_F_TX_UDP_CKSUM || > + (m->ol_flags & RTE_MBUF_F_TX_IP_CKSUM)) { > pi_data = hn_rndis_pktinfo_append(pkt, NDIS_TXCSUM_INFO_SIZE, > NDIS_PKTINFO_TYPE_CSUM); > *pi_data = 0; > @@ -1363,9 +1366,11 @@ static void hn_encap(struct rndis_packet_msg *pkt, > *pi_data |= NDIS_TXCSUM_INFO_IPCS; > } > > - if (m->ol_flags & RTE_MBUF_F_TX_TCP_CKSUM) > + if ((m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == > + RTE_MBUF_F_TX_TCP_CKSUM) > *pi_data |= NDIS_TXCSUM_INFO_MKTCPCS(hlen); > - else if (m->ol_flags & RTE_MBUF_F_TX_UDP_CKSUM) > + else if ((m->ol_flags & RTE_MBUF_F_TX_L4_MASK) == > + RTE_MBUF_F_TX_UDP_CKSUM) > *pi_data |= NDIS_TXCSUM_INFO_MKUDPCS(hlen); > } > > -- > 2.32.0 > -- David Marchand