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 12718A00C3; Thu, 16 Dec 2021 10:38:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F82A40696; Thu, 16 Dec 2021 10:38:08 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 431BA40143 for ; Thu, 16 Dec 2021 10:38:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639647487; x=1671183487; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=I9bobtk39fypXXvxDSz6kNvEmEKeZflI2J/A56J2u0k=; b=iS0nYILuME3Dq+BUt3nBqzJQ8moMOZoTy+1P2phbJKYc2A7UqA3AB2Hg XdsXh747ZOyh5zxD8nxVPDHthS2cskmQK+15pz0LbB+Ev0zKDRu5VLh2X uus0BF9FawB+x3N1ilL9Dz2F2DT1oThHU9RuMWdzbaCtUbKQHRbBAqUB7 qU7pwnvtenmZ2M8XGGrREbZ+7pbFkZtsi9iCc7QgZuqlNvcNf3jxzyC2C 5MBoO2uxGZSSFoXFsQCEXdu5cuGwQNaaDjO1VHDWFnsf8cgPei/jQHDau ARBXlzOlISb6uP2Gar/BR9qVBk0bwjUGo5CSFr3ELCy73p4UFXq1Q197G g==; X-IronPort-AV: E=McAfee;i="6200,9189,10199"; a="219463061" X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208";a="219463061" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 01:38:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208";a="464610568" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga003.jf.intel.com with ESMTP; 16 Dec 2021 01:38:05 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 16 Dec 2021 01:38:05 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 16 Dec 2021 01:38:05 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 16 Dec 2021 01:38:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aw3nMTnHXnZF7a0fsR7yxMfjqHZ52R65G+M1245t9QPrdad9+yZUmOF4jUdv0empM/k8YrqFc2qL+mQMnTdVpnt60j/XndG6if6txXjugJpArtpkpYQPz7GzmOz6yIgTiPRYBRB7gv8z+q81+5saUuJ47hA/fQXSwJ5u/NR/Uy3SsP6th9NST8/dOEDqbMVFanuXLoHvMX2zx4cA6TIWKPIT5+kpvQ5PI7n9noCCwhiyic8mHgYMtr/6Z0ly0RuWhk9WDCMy1NsiUvQpE/D2c0lEe5FyeC5HnzeGUbpjMsU+AyRCdYRR2lUgLAXOtd1Y51VCZGJ4eughI9Ux0uPDww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hc5LF3i3AyXKlLKaYNGDEuTzN2vT5yFlsE2gOc6GpZI=; b=Xac9wa52jL1p2mOPUe8gLF+3sFHk1JYttI9GIwjTqau4+9VsdaAnSOeoWWZmcFofu8oVH1n0NHkXGf8wRXrotl2Krv40WMEXclAgH4oPvUvvb4a2eVVbiJXTyojr/EgXXj6AlYMMy8zpvL1ReESfhu5kSyasmb7m9XABRvAHUpsJZvtErcUsbe6zOZwQcCxdcsrjFS2nOl/lSlzenaBOlf2aCQ+PnroDG9LfOuMPuiuS75/nSxIpzGD5R5Kfqu3dKw9sfvib2PGHEEC0Ldl8exukkVXexLYhN93sCv2rqHGPiIbM3Gzu5lIkQxTzET3Irb1pWXKJKUXnr6DlvD57wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5191.namprd11.prod.outlook.com (2603:10b6:510:3e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Thu, 16 Dec 2021 09:38:04 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bc5f:31a7:10ad:443c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bc5f:31a7:10ad:443c%6]) with mapi id 15.20.4801.014; Thu, 16 Dec 2021 09:38:04 +0000 Message-ID: <4fc78021-270a-39c1-b238-399fd4e98f85@intel.com> Date: Thu, 16 Dec 2021 09:37:58 +0000 Content-Language: en-US To: Stephen Hemminger CC: References: <20211215184859.1859870-1-ferruh.yigit@intel.com> <20211215112017.26958d79@hermes.local> <19cc482d-d7a4-7a14-a34f-33fd15a99a04@intel.com> <20211215151546.40de01c3@hermes.local> From: Ferruh Yigit Subject: Re: [dpdk-kmods] linux/igb_uio: fix build for switch fall through X-User: ferruhy In-Reply-To: <20211215151546.40de01c3@hermes.local> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0491.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::10) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b5ce1bc-7d5d-4d71-5a35-08d9c077c1fe X-MS-TrafficTypeDiagnostic: PH0PR11MB5191:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lv9k5ad1Fnmfx7PZlKYKkTZy68TPOJ8R9N71spqILl7Ylyoza7L7PlRm6ibqiBYUDk05YkPP099LfphD3Jyuy33hLbXaxhGCzIvJcyXWS1I6y1XJ5gjX3pyHJZHXmSY40Io8fUVLs/YCLFKBZKZ+Dis6PJakkarx7Yh4p23N8RVRmRMF1ZmejElKssQLuYgirmoYZNnUSQQ+kdhjAaYcjhhlPH/io2SCVj/oBKtWJyX+uIFEpNKoKRzZgyj8yI38lpeUzKQv/LsCA4z4l1Otcd9eP+3ySuwBcRCpgbV8Kgc9c7JfUkBCF17FDH07hCxELiAeSHH1eMwOEojdZiXPRY8AhVoF5WDKRewKiqHLewoxhba1biuDxmmJ9G/XZ3XCDrrfIx8BtzNR+oFNN5XZoHDQguYBRNh52/CCOtLEjoWcyGOGFP21YqO6gTDENF3Q2aRXV38N610wSB2+9XTckGy2KAcYvM8MNfKRUQjWvDq4DJvPdKf9Yuj2LqT/ji+nGMqHseEaRqig63t2MZ1M11ayr2LyQ3debTgef86EiLlWPGGdsg43foGBTinBJ/PTYPBAnPLOU6nwRaq0YEiHV/ZAD3bCLB4SKrmcNJpluXQ9ToJ1NW8Su+44TpgAWRVEjNpwqncsN3D3t++r4j6I6CquNRr3DTWmddwN7GgTG38h5MJJVRAtc8GYXs9uCYCK7+pP5dCf7aVmxuMfTxVNUg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(53546011)(31686004)(8676002)(186003)(6916009)(6486002)(6512007)(4326008)(508600001)(8936002)(6666004)(5660300002)(26005)(38100700002)(31696002)(36756003)(6506007)(2616005)(83380400001)(2906002)(66476007)(82960400001)(66556008)(44832011)(86362001)(66946007)(316002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M1U0Um55dGFCeDY2NTh1NDVEUkZXblZNdmxyTjhnV1NDTUNGNk4rZmhiWi9i?= =?utf-8?B?OUxHU0prcDJLdWo1V3B2dWNhVldndUMrak1VOFNMZ210QThtWEdJR1FoRWFR?= =?utf-8?B?cEdkcmpzMVl0TmxwOWsvVkxOVDV6eE9WMWpSQlVaVGdoZElIVVFzRWhuYnMy?= =?utf-8?B?ak05MW9UT1ZZSjIzL2VMTlZEVHFCZGZHRWQvVUlhUmJGVkhEc1JuSzZYVDlp?= =?utf-8?B?eHhhTkZEZXdmUWtRWGZaMmNRdUkvNzlDVDVhVzZENlJ1NWRpbXBHODBFM05W?= =?utf-8?B?UXJlUlVkWjg2TytBR2ZjU214RlYvYUFFMzlKWE5pWjZOMmtGdnNsYnV5SVIr?= =?utf-8?B?SnNLRXZkZ2NkV3JyVENPYjR5d0xRVERBdkF1T0hvdkt3QlNnanh4WVJRZmEy?= =?utf-8?B?bFJsRHg0T1ZhY1AycExZRXN4OU9NWT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Id: 4b5ce1bc-7d5d-4d71-5a35-08d9c077c1fe X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2021 09:38:04.0577 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uxK4aHeYqkpPbFrVBUMU1pQJpMpygFrBjMqbW+2HuGfKnpkX7ZSLanFveutvb9g7hBCE8QmP39cqjFO8yn+fLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5191 X-OriginatorOrg: intel.com 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 12/15/2021 11:15 PM, Stephen Hemminger wrote: > On Wed, 15 Dec 2021 21:04:30 +0000 > Ferruh Yigit wrote: > >> On 12/15/2021 7:20 PM, Stephen Hemminger wrote: >>> On Wed, 15 Dec 2021 18:48:59 +0000 >>> 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. >>>> >>>> Signed-off-by: Ferruh Yigit >>> >>> Are you sure that fixes it? because the comment in the macro is typically >>> not visible in a macro expansion. >>> Since in most case Linux uses gcc why not use the gcc attribute >>> >>> __attribute__ ((fallthrough)) >> >> Hi Stephen, >> >> That is the intention already. >> >> Patch is using the Linux kernel defined macro: >> #if __has_attribute(__fallthrough__) >> # define fallthrough __attribute__((__fallthrough__)) >> #else >> # define fallthrough do {} while (0) /* fallthrough */ >> #endif >> >> And it builds fine without the macro in the 'compat.h'. >> >> >> I added the define in the 'compat.h' for old kernels which doesn't >> define the macro. For that case I expect default '-Wimplicit-fallthrough' >> option is used which accepts 'fallthrough;' as a regex hit. > > Your right, on older kernels it really is just a dummy statement. > The regex can't work, you can take (or leave the comment) it has no effect > because implicit-fallthrough won't see it in a macro. True, it has no benefit for 'Wimplicit-fallthrough', and regex doesn't hit. But for the old kernels (<= 5.3) still need to have this define to prevent build error, because they are missing 'fallthrough' macro. But for those kernels, '-Wimplicit-fallthrough' compiler option is not set, so that should be OK **. I have tested with '4.19.221' stable kernel, this change builds fine. **: Only v5.3 has potential problem, which defines '-Wimplicit-fallthrough' and doesn't define the 'fallthrough' macro. When igb_uio compiled with this version 'fallthrough' is dummy statement from 'compat.h' and '-Wimplicit-fallthrough' can cause warning. To fix this, I will move both dummy and attribute macro definition to compat.h