Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6489828rwd; Mon, 19 Jun 2023 08:02:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56rbuAr/oOi9S86x8kD102GCqC4YvJI6kI3EINGpV5KNd5RwuzmvMnAtE+UKmscqEGrAbP X-Received: by 2002:a17:902:ea0f:b0:1b6:6b03:10cd with SMTP id s15-20020a170902ea0f00b001b66b0310cdmr1817839plg.67.1687186920145; Mon, 19 Jun 2023 08:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687186920; cv=none; d=google.com; s=arc-20160816; b=m41buTt7aEDcuXrupjph/WSns+2fy9703O7RLfxzh2GqGFC8HrEd94WAF94qKct6Ql OAsHajeHWvhq9ltXyf1cHxd5cGG6Gl9CM2wGbRNXc1suDY6Ed1G9ubBp0ffhtjHJADl9 u7UjxuZckm/woAG4P9Kqxt1UJ51ImTaznWtO4lYJxyyPsZwMaIceWXPjoSNqfFFXjGHF /MVjfvB8oVxGkoH2QeEZuo0V5ABWF35l/l5O3hBYue3GbU3oSIAMKMNrFBOtT0xht8vw cj0+Bl0v0AvH6yZj6moGW5cxPYza5jmHz/8KnwofoNPSJLfQNISLyc06iIcel/sT00Eq wRug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=h/FMBET8Xaxpjw3bixtAd1vmrL7NQ478gCBTrLfRJ4Y=; b=kGlCgrf8cIPCBGk3bUr+iTLcNpFCgHbwfJewVRMn1tRtNILckofIjmlwY3jVyiFzDF 1hiW85b0xxRwu0k6rdgikMgMcpUqJTmPdH9oRHSxGZWYXP29tyJOj6trp/YQ7EuVAhMz DJnu8NJEOgc2q1kiv1GiaB743o7+hm1JFkdJ/EiymXPR4R/bvDZyUcrLpevB9dpxuYe4 LqsNnothVnJD9Uw23u70udC3HKPyerGB/LNW6FQ2wcMIirXJaA40A5Gqtz5YD8xqUACn VXPm8pvItyGD4uJ94YsJ3+a+gGsaiZ+GAhVWshJVFTp73Hnj7eWcPRMOoF5RfSeD4bjX IWPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=cvTPB6NG; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=MerLevCu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a170902ef4800b001ab18eacb8csi21243384plx.526.2023.06.19.08.01.30; Mon, 19 Jun 2023 08:02:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=cvTPB6NG; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=MerLevCu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231567AbjFSOzv (ORCPT + 99 others); Mon, 19 Jun 2023 10:55:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbjFSOzt (ORCPT ); Mon, 19 Jun 2023 10:55:49 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA674C1; Mon, 19 Jun 2023 07:55:48 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 5A9C55C0309; Mon, 19 Jun 2023 10:55:48 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Mon, 19 Jun 2023 10:55:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1687186548; x=1687272948; bh=h/ FMBET8Xaxpjw3bixtAd1vmrL7NQ478gCBTrLfRJ4Y=; b=cvTPB6NGU1O3VED7yc IMdFBHs6VjuoW1SxIhb/sBEvHJzfHAf90cSLZIHRN8VxAfThEhVKyJzZ8TE+dopj M+qRK/EdxB96cB1cw2iTKM0iS0lKcpFuDbqVTkTBGeaHguMLiCIOeikSs83gLGaK IU66LEEerwY7d7SdZ9hcXclTZB46ZQnhylRAG8vn/IWk9ou7cvOPyNAgh1cLTkLA Kmi7PgDl0x7+qvHs4JRJLkL9ySnGQSOhsGrXe5OdMyNA02aJ0d1Sw94JwogQAwBi jU2zo67YYMNPCzdsLyMkZluqf9bnAKzVuAvJubCV+6ClOemjUaA9J9KD4ZOrYzuh BseQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1687186548; x=1687272948; bh=h/FMBET8Xaxpj w3bixtAd1vmrL7NQ478gCBTrLfRJ4Y=; b=MerLevCufwjdx8NK1dD4kVUCgpcgI S+YwxBQlhrBlnFal9OqwM8Cs/V0HPDr50ySy+cpfMyxuRJEg/dlq5AJwfzEGl/H4 jcIXj5lc9SJR9jHaIbr6v1Ty/vOthisocYkc3U4HHFEZQNTRdPDjVfJefNYTMV7L TxBB78lNOd1yF7G1peTq0XsgJjZZtLv+BcV0vDZ2sBI+XvBJPuCvidT51IacQJUP PH1/cXOYTvjKcpoNVXUvrjYQPWn058F99bK3xVbf/7EZxMHckOvXqLNX9Qzc+nbk oeoaIGaF8GzgcElrXhB2TfRdBNZidCtfegNaWCTNwfiIrV5Zy9TyRfh2Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeefvddgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepgeetiefhjedvhfeffffhvddvvdffgfetvdetiefghefhheduffeljeeuuddv lefgnecuffhomhgrihhnpehprghsthgvsghinhdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2F7ACB60086; Mon, 19 Jun 2023 10:55:48 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-496-g8c46984af0-fm-20230615.001-g8c46984a Mime-Version: 1.0 Message-Id: <7047eaa9-30b6-47bd-a878-7508449c9e20@app.fastmail.com> In-Reply-To: <7c448f02-4031-0a90-97e2-0cc663b0cff9@gmail.com> References: <20230619091215.2731541-1-arnd@kernel.org> <20230619091215.2731541-3-arnd@kernel.org> <7c448f02-4031-0a90-97e2-0cc663b0cff9@gmail.com> Date: Mon, 19 Jun 2023 16:55:27 +0200 From: "Arnd Bergmann" To: "Edward Cree" , "Arnd Bergmann" , "Martin Habets" , "David S . Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" Cc: Netdev , linux-net-drivers@amd.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] sfc: selftest: fix struct packing Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 19, 2023, at 12:25, Edward Cree wrote: > On 19/06/2023 10:12, Arnd Bergmann wrote: >> From: Arnd Bergmann >> >> Three of the sfc drivers define a packed loopback_payload structure with an >> ethernet header followed by an IP header. However, the kernel definition >> of iphdr specifies that this is 4-byte aligned, causing a W=1 warning: >> >> net/ethernet/sfc/siena/selftest.c:46:15: error: field ip within 'struct efx_loopback_payload' is less aligned than 'struct iphdr' and is usually due to 'struct efx_loopback_payload' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] >> struct iphdr ip; >> >> As the iphdr packing is not easily changed without breaking other code, >> change the three structures to use a local definition instead. >> >> Signed-off-by: Arnd Bergmann > > Duplicating the definition isn't the prettiest thing in the world; it'd > do for a quick fix if needed but I assume W=1 warnings aren't blocking > anyone, so maybe defer this one for now and I'll follow up soon with a > rewrite that fixes this more cleanly? My idea is to drop the __packed > from the containing struct, make efx_begin_loopback() copy the layers > separately, and efx_loopback_rx_packet() similarly do something less > direct than casting the packet data to the struct. > > But I don't insist on it; if you want this fix in immediately then I'm > okay with that too. It's not urgent, if you can come up with a nicer solution, that is probably better than applying my patch now. I have a patch [1] that addresses -Wunaligned-access for all x86 and arm randconfig builds, and this currently affects 23 drivers. Most of the changes don't have changelog texts yet, and some need a more detailed analysis to come up with a correct patch. I'd probably aim for linux-6.6 or later to get them all done, at which point we could move the warning from W=1 to the default set. Arnd [1] https://pastebin.com/g6D9NTS4