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 16A2F43AEF; Sun, 11 Feb 2024 18:41:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A797D40283; Sun, 11 Feb 2024 18:41:53 +0100 (CET) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mails.dpdk.org (Postfix) with ESMTP id 786BF4025D for ; Sun, 11 Feb 2024 18:41:52 +0100 (CET) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-5d8b276979aso1663207a12.2 for ; Sun, 11 Feb 2024 09:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1707673311; x=1708278111; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=3guDIcvk8aycOBriSP94dzRZ5QZuuSYhKpH5F86DC9s=; b=TDbJgV8UyBAY4RGZPdIgZ4i/Ba/Fz5Pr5u5OLUDWpdQxWRyMtxhN6ns6uqFhdKgzyh NBUp98paCyq0YQRVAnF/HIJInnRJLZcavW5jpBIITN8TkmJ7ehpIYVvRmRhPtYCKbpCz L1nmstKYSA25L6dCbZMlKk/IFeKB64GFbA9KAuJ5izwsCmigwWlPMPrbNkKQ9x/6jO1c mxB914M104LsdHpLPH9LQE768AdrRDb7m7yTqZCFpsoX3NAIc5yfAs7qH6ae5zuYTP14 U1+o9NYDjHReEX2PtvbYZGZsK3I/TRUaRM1rQpnIPXHIAeHmzrh6Au411zIHT1mE4+XB +4Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707673311; x=1708278111; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3guDIcvk8aycOBriSP94dzRZ5QZuuSYhKpH5F86DC9s=; b=ks1arvEZYWs+pVPjgEsb8tM6hm331ZQMK0stI0h4ndisvgMGaBWO9t+3/PyTircxOC MSTyZYqge4+J1SnMpprEFsW61yZw5OCNES6DlRKR5vb3AIBGsESvuaiBcCEKFIMEhAmi u7bz3Bk/YpRR44EM7Jg2BbiPkXYMohtbP9HFfdKwcr08Cq3G+GQ9EjwNOQcxq06b6dnK xqnQNp+ilj90HC5VTfCjaOa4TrfW1Ta0GPiHZgplGMjU+Gt/0lbDL/WbXUVM+kSiXb5n B35GHJkyVsGUibdj/lYwUyPYYInS0XC2tm+nHVY41sBgx2uy89ndzJGg3t996HHy72ZM +i2A== X-Gm-Message-State: AOJu0Yze6tBpkorNQmJXgMfXXYdt6HDiyWcZ+wFdNlJwsyKGE7XY4slD bLzM/q2Lezs+qQXI6Lpwg+/KZbvuZG/GdUlFBn2VCtxi5Q1A22f2ZyrfzJ8eYkM= X-Google-Smtp-Source: AGHT+IGW2R8/zxR/JZf5enZeO03tTimzGyidvTGwHlbZw5M9LKDFLBcMFjO1hqZ2BLEgL8ozDpmHgQ== X-Received: by 2002:a05:6a20:6697:b0:19e:a323:5250 with SMTP id o23-20020a056a20669700b0019ea3235250mr2598349pzh.17.1707673311504; Sun, 11 Feb 2024 09:41:51 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX1zekU5pDHEqtLtQW1ndTMyKQABv/hXQ8UNqgIPw5/OEYJLxOSrx89o71SRkJUfPaq96CdQ/nm5VKSZWWB+zgjcG9tsf9Ki5A= Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id z13-20020a170902ee0d00b001d8f111804asm4539548plb.113.2024.02.11.09.41.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 09:41:51 -0800 (PST) Date: Sun, 11 Feb 2024 09:41:49 -0800 From: Stephen Hemminger To: Ferruh Yigit Cc: dev@dpdk.org, Morten =?UTF-8?B?QnLDuHJ1cA==?= Subject: Re: [PATCH v2] common/sfc: replace out of bounds condition with static_assert Message-ID: <20240211094149.58aa3a24@hermes.local> In-Reply-To: References: <20240118201843.189978-1-stephen@networkplumber.org> <20240119221401.68182-1-stephen@networkplumber.org> <20240207143651.6b6f1b3b@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 7 Feb 2024 23:30:07 +0000 Ferruh Yigit wrote: > On 2/7/2024 10:36 PM, Stephen Hemminger wrote: > > On Wed, 7 Feb 2024 19:10:37 +0000 > > Ferruh Yigit wrote: > > > >> ../drivers/common/sfc_efx/base/ef10_filter.c:1246:18: error: shift count > >>> = width of type [-Werror,-Wshift-count-overflow] > >> matches_count = MCDI_OUT_DWORD(req, > >> ^~~~~~~~~~~~~~~~~~~ > >> ../drivers/common/sfc_efx/base/efx_mcdi.h:493:2: note: expanded from > >> macro 'MCDI_OUT_DWORD' > >> EFX_DWORD_FIELD(*MCDI_OUT2(_emr, efx_dword_t, _ofst), \ > >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > >> ../drivers/common/sfc_efx/base/efx_types.h:533:30: note: expanded from > >> macro 'EFX_DWORD_FIELD' > >> EFX_HIGH_BIT(_field)) & EFX_MASK32(_field)) > >> ^~~~~~~~~~~~~~~~~~ > >> ../drivers/common/sfc_efx/base/efx_types.h:145:23: note: expanded from > >> macro 'EFX_MASK32' > >> (((((uint32_t)1) << EFX_WIDTH(_field))) - 1)) > > > > None of this got changed by the patch. Looks like it would not compile > > even without the patch on your version of clang. > > > > Nope, error only happens with the patch. > > And CI seems reporting the errors: > https://mails.dpdk.org/archives/test-report/2024-January/558546.html This patch is allowing compiler to see some things as constant which were hidden before. The driver is buggy, for example, look at this: /* * Stop lint complaining about some shifts. */ #ifdef __lint extern int fix_lint; #define FIX_LINT(_x) (_x + fix_lint) #else #define FIX_LINT(_x) (_x) #endif Looks like it is wallpapering over some errors.