DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ferruh Yigit <ferruh.yigit@amd.com>
Cc: dev@dpdk.org, "Morten Brørup" <mb@smartsharesystems.com>
Subject: Re: [PATCH v2] common/sfc: replace out of bounds condition with static_assert
Date: Sun, 11 Feb 2024 09:41:49 -0800	[thread overview]
Message-ID: <20240211094149.58aa3a24@hermes.local> (raw)
In-Reply-To: <a9822f48-544c-46ab-9d53-93bf50ccfa7b@amd.com>

On Wed, 7 Feb 2024 23:30:07 +0000
Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> On 2/7/2024 10:36 PM, Stephen Hemminger wrote:
> > On Wed, 7 Feb 2024 19:10:37 +0000
> > Ferruh Yigit <ferruh.yigit@amd.com> 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.


  reply	other threads:[~2024-02-11 17:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 20:18 [PATCH] " Stephen Hemminger
2024-01-18 23:05 ` Morten Brørup
2024-02-13  7:47   ` Andrew Rybchenko
2024-01-19 22:13 ` [PATCH v2] " Stephen Hemminger
2024-01-20  7:53   ` Morten Brørup
2024-02-07 19:10   ` Ferruh Yigit
2024-02-07 22:34     ` Stephen Hemminger
2024-02-07 22:36     ` Stephen Hemminger
2024-02-07 23:30       ` Ferruh Yigit
2024-02-11 17:41         ` Stephen Hemminger [this message]
2024-02-11 22:24 ` [PATCH] " Stephen Hemminger
2024-02-12  5:48 ` [PATCH v4] " Stephen Hemminger
2024-02-12 12:09   ` Ferruh Yigit
2024-02-13  9:39   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240211094149.58aa3a24@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=mb@smartsharesystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).