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 ED505430CC for ; Tue, 22 Aug 2023 09:40:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCBEF4021D; Tue, 22 Aug 2023 09:40:02 +0200 (CEST) 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 7977C40041 for ; Tue, 22 Aug 2023 09:40:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692690000; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4ZZP060sx+bgubYaSjXV+qtj3gMpkRj0JKAEX+v/uS0=; b=degVOK0uhr4rT2pWK1F/wa/hJ+gz2wA/5vlG8fqstrpW/OFY7W8VZgnk1c2R/xB2D/IpHu j+sE0YebG2piSe3PBniHHihY4idd1gDMJ25yW0JAAwymkI1S6DKN3IrZWnsHYm3BhUCnSU y+Xl780IWIkQ0e/xETAVh/uMNyFsOfE= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-225-SGbAWqYGNMODLGMDoi3E_Q-1; Tue, 22 Aug 2023 03:39:59 -0400 X-MC-Unique: SGbAWqYGNMODLGMDoi3E_Q-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2b961c3af8fso44232721fa.0 for ; Tue, 22 Aug 2023 00:39:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692689998; x=1693294798; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4ZZP060sx+bgubYaSjXV+qtj3gMpkRj0JKAEX+v/uS0=; b=eKYAblWFwwBc4xD2PR4CNaokJ5TkaFciqNHeaJDpEoXwW11SqUhkYbbDTnzo6h5pSf eGzHrohbdKmzxYShVmpuu1A49UqTMxV9woHfe0uoC+gj9Ce1J4n7NCtP17zEflX28+tk 9lIi3yEcVjP+Aolv0brHi7a/jAnzlKh6OjqimcS/gPwMvXVvwBbrkM9wZqNPhUwqfA52 NHeN5p1nAYg5MsVTalpL/b4uZcujNIE0p4cm+GdyISnOFyjr9SEzobqH/YSRGVr/iTkO N51D5F0mYX0nNaTBHEYE+BqBCQof/2+UiYjD6NBZhfChQ7YY4nOSwJKbvWsos+XMw2Bw cxEw== X-Gm-Message-State: AOJu0YxRGwi1rzLjvrMIHqQmqle0tAPrBracIdaw8H+oRgB7IHF8kUio jPYSBNp7xgX/Xl4rvL8qCjjspTDsk2Smf2CRejYR6u1f0gxcdLumbP+O3/dL6oZtnGgdT90jAX+ S3UKj21zJdmL4orpqAnfEvOU= X-Received: by 2002:a05:6512:33cd:b0:4fd:fef7:95a1 with SMTP id d13-20020a05651233cd00b004fdfef795a1mr7114811lfg.53.1692689998000; Tue, 22 Aug 2023 00:39:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFl5iOFiG9fPKybFWe8GcjTTTXklkiACbpVX3YFFn9oBcLfSC+9FrsOBjGzijvvVL4gmOZ31aobNWvcJ+mn31g= X-Received: by 2002:a05:6512:33cd:b0:4fd:fef7:95a1 with SMTP id d13-20020a05651233cd00b004fdfef795a1mr7114788lfg.53.1692689997653; Tue, 22 Aug 2023 00:39:57 -0700 (PDT) MIME-Version: 1.0 References: <20230818090351.2402519-1-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Tue, 22 Aug 2023 09:39:45 +0200 Message-ID: Subject: Re: [PATCH] net/iavf: fix checksum offloading To: "Zhang, Qi Z" Cc: "dev@dpdk.org" , "echaudro@redhat.com" , "mkp@redhat.com" , "stable@dpdk.org" , "Wu, Jingjing" , "Xing, Beilei" , "Doherty, Declan" , "Sinha, Abhijit" , "Nicolau, Radu" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 On Tue, Aug 22, 2023 at 9:33=E2=80=AFAM Zhang, Qi Z = wrote: > > If the driver reads l2_len or l3_len, this is an undefined behavior: > > for example, OVS might have been using l2_len or l3_len for its interna= l uses > > (though I agree it would be risky for an application to do so). > > > > We probably need to fix access to l2_len a few lines before my patch. > > > > if (m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK && > > !(m->ol_flags & RTE_MBUF_F_TX_SEC_OFFLOAD)) > > offset |=3D (m->outer_l2_len >> 1) > > << IAVF_TX_DESC_LENGTH_MACLEN_SHIFT; > > else > > offset |=3D (m->l2_len >> 1) > > << IAVF_TX_DESC_LENGTH_MACLEN_SHIFT; > > > > > > But to be clear, no I don't think looking at l3_len value is better: > > it should not be read at all. > > Yes, you may be correct; it appears that this issue is unrelated to l3_le= n. The primary concern is to prevent the configuration of Tx descriptors wi= th incorrect values. > > Based on your description, it seems the problem arises when the PMD sets = MACLEN to 0 and also configures IIPT as 01b, Is this correct? > > To prevent this issue, we could implement a check where, if l2_len is 0, = we simply ignore the IIPT configuration and keep it at 0. (which leads to s= ame configure with your patch) The driver is _not_ supposed to read l2_len or l3_len if no valid ol_flags is set. I will reject any suggestion where you consider their values. --=20 David Marchand