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 32944A0C43; Mon, 18 Oct 2021 17:58:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9459641160; Mon, 18 Oct 2021 17:58:54 +0200 (CEST) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id 743FB40142 for ; Mon, 18 Oct 2021 17:58:53 +0200 (CEST) Received: by mail-pl1-f178.google.com with SMTP id y1so11543914plk.10 for ; Mon, 18 Oct 2021 08:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sO45oPzzi96f8RkYx84QmNQBEkpzJ2q1cdK0/bPYWkM=; b=oad59AGkvc1x5wbjBJQZa1x8ohSabrUOEw79Is0yUu9S17hgGWoqHlZ9YAOXpBFBX6 bNU7oG2BArakQJAwMtU3X9EAGLSTPrQdj5BDM6E1gc76C3ZBUlnUbN0sbeAXAz0NZOKg fJrbJUuQGFze37NXGoLbCZwGazQRGFH0xS+v/eMcTamZIdczwO4hSAq26svGPa21ln1F /0rb3yoRDHrSGl+lGXbY+WP8S9Y7sQ1FBw8whJm1rNHNPhe+CcCWQz+WRTGGFplyktJH bkBTG+R04Cb+NqOPGqvxrz65Ffn9n9x+fc1axS1el176N9DozT0aPBqvqSKjiiFOm3Pl rrTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sO45oPzzi96f8RkYx84QmNQBEkpzJ2q1cdK0/bPYWkM=; b=wUR4XYV8V6KbCG4nFHDE2xub4+/dIC12i0IwOXQmOVAt2GAJYHrOPMXsussZjTyKbd E9BURH9ILMgVlukNb9cuk++Rd+epRuORzAwaIIYbIzXlMSgEAFNBdT8CPde/WjkyKdk2 PSLEOUZDWTayHPmdNGr6CbzP/UYJmekJ6vYtKjBQ2jLCsl3ejk3CnDEEAWFoN3svjaT6 VP7CnE/bcguaq9OWJmmvoB7AT3Y601K8CuMaX+VGl8UssOUUFcBSSnLObZRFjB80YbV8 uWMqjUqgmw9pZ1ufLCgRulABnQnEm10Pzt35sPAa0a2R8nHYiF75YyJqBphwjn6Pew10 /2Bg== X-Gm-Message-State: AOAM531u30POPhBamHyUm0726Def1dnCgOqeoKs1KlonIuHAC61jfkfu 9GToOqJ3RDrT0gbzl68uiFBXHg== X-Google-Smtp-Source: ABdhPJz0KaGqCnhgR96Ctn4wEOSYK65H/jI8Le34it7cgtl9y0kOuEMd16t6DZ088TOW+GvC+y6Lvw== X-Received: by 2002:a17:90b:1c09:: with SMTP id oc9mr22653947pjb.33.1634572732656; Mon, 18 Oct 2021 08:58:52 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id q8sm19983067pja.52.2021.10.18.08.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 08:58:51 -0700 (PDT) Date: Mon, 18 Oct 2021 08:58:47 -0700 From: Stephen Hemminger To: Konstantin Ananyev Cc: dev@dpdk.org, stable@dpdk.org Message-ID: <20211018085847.2cb4ddc6@hermes.local> In-Reply-To: <20211018134052.10514-1-konstantin.ananyev@intel.com> References: <20211018134052.10514-1-konstantin.ananyev@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] test/bpf: fix auto-test with clang fails 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 Sender: "dev" On Mon, 18 Oct 2021 14:40:52 +0100 Konstantin Ananyev wrote: > test_shift1_check() function fails with clang build. > The reason for that is that clang uses 64-bit shift instruction for > what expected to be 32-bit operation. > To be more specific, this C code: > r2 = (uint32_t)r2 >> r4; > With clang produces: > 41a4eb: 48 d3 ef shr %cl,%rdi > In that particular case it is an allowed choice, as from one side > left-operand value is known to fit into 32 bits, from other side > according to 'C' standard: > "...if the value of the right operand is negative or is greater than > or equal to the width of the promoted left operand, the behavior is > undefined." > The problem is that on x86 behavior for 64-bit and 32-bit shift > operation might differ. > The fix avoids undefined behavior by making sure > that right operand will not exceed width of the promoted left operand. > > Bugzilla ID: 811 > Fixes: 9f8f9d91a701 ("test/bpf: introduce functional test") > Cc: stable@dpdk.org > > Reported-by: Stephen Hemminger > Signed-off-by: Konstantin Ananyev Thanks Acked-by: Stephen Hemminger