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 2C08DA0352 for ; Fri, 17 Dec 2021 08:07:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 129AE4013F; Fri, 17 Dec 2021 08:07:43 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 225794013F for ; Fri, 17 Dec 2021 08:07:42 +0100 (CET) Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id ED7853FFD8 for ; Fri, 17 Dec 2021 07:07:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1639724861; bh=KTmCZJYTBn0/Cm+LkQEJSIoDpKiMsV6pOTFocQot4yU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LkfWWDPGVjc4YJuMDgWwhW82ngvs3LAJLoUK+BhHYCCjfNXaCv0ywm3QWY8Re1uNg SiNyUBSmyHsr05WFSrxjK3S1lbjpasV9MxUr8n8uJTdmom9gdND4Ef1vphBmwDiajP zaxbZrafxay5u2Y4O7fg8ffX86lqJTrrthAgR1XnahGhC3J6hDD6EAscaF0mEYVPMy /Z9veLvVdqx0isb3fNAO3xzU09dY2PzpOI0zr2p5vZVZd2utamAc6IsTTgmixsxm8s 7UBbQXBkdO9vhTZFyGLECH99epmdbt87RNJYID/rQ3PS4KpcV1b/rrNIWPQjmL8NNW dL10wkvid6law== Received: by mail-qk1-f198.google.com with SMTP id u12-20020a05620a0c4c00b00475a9324977so578600qki.13 for ; Thu, 16 Dec 2021 23:07:41 -0800 (PST) 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=KTmCZJYTBn0/Cm+LkQEJSIoDpKiMsV6pOTFocQot4yU=; b=J4B9PM0cRYfWIDf5O6wz0mFE8A4PRhnp0KeC3Huz0h07FikYR16OKIEl1QENoz6SAj KoYevuLy0ntCpgRKkRvN9G59iTXACKDDZ8BrudDWEfc6Fq5KKfOz4HsBUBpMEZ6fT+Kk ldp5EfhVdhd6A0lmnP78R8A0GI9cR7YCAuS4vBLh69IR/g40zU3xS8rpnQxRCgQpWLKu AcqHaYObofFyRyDNcRuEBb502zv0ddcGA3lSGu4JrEQgYSROOS1GjPINd/KnpARV19Q3 LkW7qX3+DQAQFrFIxozAQP/H+mjv0QONYIVskHIYVTq3obyOuanWUGv1EPdeFlGtBLrp tg/g== X-Gm-Message-State: AOAM530fFEQyxhWeOFiCn17vx2pvflSfrWQzVoEf7FCy9QXRLO91+haQ w5446VSBvpb60ibgSOIUjTfJ8hLpCjTVO7kaJ1wcHdos8mDfoL6DjObvfvtqiqqp3l06y6C8HFS SGSeQQsgMJkU5/Yt9xtKlpnquTd17YnA0qb3WN4JE X-Received: by 2002:a05:6214:8c2:: with SMTP id da2mr1445903qvb.23.1639724861081; Thu, 16 Dec 2021 23:07:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJw10UAGzFWPQyvjmw6t0hd2OhtNrDIvZf+BmetZdd9Q3bu6mrbpfJs9aqYRXs8EbmVsvDwhTOp3hzlo2Vy6RBo= X-Received: by 2002:a05:6214:8c2:: with SMTP id da2mr1445891qvb.23.1639724860796; Thu, 16 Dec 2021 23:07:40 -0800 (PST) MIME-Version: 1.0 References: <20211215190011.1928990-1-ferruh.yigit@intel.com> <20211216123611.2125507-1-ferruh.yigit@intel.com> In-Reply-To: <20211216123611.2125507-1-ferruh.yigit@intel.com> From: Christian Ehrhardt Date: Fri, 17 Dec 2021 08:07:15 +0100 Message-ID: Subject: Re: [PATCH 19.11 v2] igb_uio: fix build for switch fall through To: Ferruh Yigit Cc: stable@dpdk.org Content-Type: text/plain; charset="UTF-8" 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 Thu, Dec 16, 2021 at 1:36 PM Ferruh Yigit wrote: > > Linux is using '-Wimplicit-fallthrough=5' compiler option, which doesn't > take any fall through comments into account but only uses compiler > 'fallthrough' attribute to document fall through action is intended. > > "falls through" comment was used in the code which is causing a build > error now, this patch converts comment to the 'fallthrough' macro > defined in the Linux. > > To cover the case where Linux version doesn't have the macro, defined it > in the compatibility header too. Thank you Ferruh, I've applied it to the WIP branch for test builds. If nothing regresses I'll keep it and it will go into -rc2 later. > Signed-off-by: Ferruh Yigit > --- > Cc: Christian Ehrhardt > > v2: > * Add both dummy and attribute fallthrough macro definition to > compatibility header. > --- > kernel/linux/igb_uio/compat.h | 14 ++++++++++++++ > kernel/linux/igb_uio/igb_uio.c | 6 +++--- > 2 files changed, 17 insertions(+), 3 deletions(-) > > diff --git a/kernel/linux/igb_uio/compat.h b/kernel/linux/igb_uio/compat.h > index 8dbb896ae118..850b359f3643 100644 > --- a/kernel/linux/igb_uio/compat.h > +++ b/kernel/linux/igb_uio/compat.h > @@ -152,3 +152,17 @@ static inline bool igbuio_kernel_is_locked_down(void) > return false; > #endif > } > + > +#ifndef fallthrough > + > +#ifndef __has_attribute > +#define __has_attribute(x) 0 > +#endif > + > +#if __has_attribute(__fallthrough__) > +#define fallthrough __attribute__((__fallthrough__)) > +#else > +#define fallthrough do {} while (0) > +#endif > + > +#endif > diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c > index 039f5a5f6354..57d0c58ab1b8 100644 > --- a/kernel/linux/igb_uio/igb_uio.c > +++ b/kernel/linux/igb_uio/igb_uio.c > @@ -236,7 +236,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev) > } > #endif > > - /* falls through - to MSI */ > + fallthrough; > case RTE_INTR_MODE_MSI: > #ifndef HAVE_ALLOC_IRQ_VECTORS > if (pci_enable_msi(udev->pdev) == 0) { > @@ -255,7 +255,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev) > break; > } > #endif > - /* falls through - to INTX */ > + fallthrough; > case RTE_INTR_MODE_LEGACY: > if (pci_intx_mask_supported(udev->pdev)) { > dev_dbg(&udev->pdev->dev, "using INTX"); > @@ -265,7 +265,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev) > break; > } > dev_notice(&udev->pdev->dev, "PCI INTX mask not supported\n"); > - /* falls through - to no IRQ */ > + fallthrough; > case RTE_INTR_MODE_NONE: > udev->mode = RTE_INTR_MODE_NONE; > udev->info.irq = UIO_IRQ_NONE; > -- > 2.33.1 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd