Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp116529pxp; Tue, 8 Mar 2022 22:10:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJww5LuC5UrRrIm2sI8r6rKYpSpjcJQfONuhGraKBo+GYsLvqQRS/TPUwFN+KVVzBkGFZEXS X-Received: by 2002:a17:902:b617:b0:151:d68e:351 with SMTP id b23-20020a170902b61700b00151d68e0351mr18979166pls.19.1646806256849; Tue, 08 Mar 2022 22:10:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646806256; cv=none; d=google.com; s=arc-20160816; b=jS6IOO/yhktIV1l7OfBX018KgzViChmTTQcOi9GzyRJhsZ0GvPaco5Vs1ePnCQx2JU bHP4M6GQNevm4VDlOff1vgfYprQqd6JgBHIVWL73MJYyAXNa7yAniG9X/KWW1Zx5Sgqs Be2zjfKljFy9ENAY1Pym2NitTwXprXe66/66Sjmq6BPc+U2QBGXjOp4YgRkwE0olT3yb eln2LQauBJh1yHxcCCqSkkooNi+wthhXRLsVMoWaBr2dOUq7eeRL1pCKYWBD6qZ8qfI2 Wfl7QxZghmo34F7rRPlWloJim9aFQnwLBsDqf1ikNCBNdC1lEnZXSvt3zhrdOiUpDtYK y2cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=y/0IJwAM45i8D7IQ89GLerrlKVWq7qopyUSczMtAR4g=; b=gWvbGoHpIDdyVzuZIhyY/7n18AfwJg548ArvK8P9BICl+83Geex5t11YCPuj19sepF 3ns5iIwQ6m6fEd1M4vKZBzwOtRDDf93QZBUBactO4mPQ3WhP33CmOHtRPvJv3cF49XKh WTrjWo04Q7jsCVvYLIk1y8uwXUmA7Dz8hPGTdTO+0GcewHnGZjgX7/pkspmtfcYDnIm7 pCkvYXv/gki45o3NDnA4+U3co7J0cRpoF1q4YTND6d+pAMVwQ+sAtaTP/c2yVrO1byfP TXcj7JcV9IpJtaVsQjqvqLaTIhBPrY37jVQ7XMatxr+7cnigyV6wFc4XRhNN0cc1f55w wURQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H9SDN6dC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a170903244600b0014f84dbf8bfsi1063041pls.586.2022.03.08.22.10.37; Tue, 08 Mar 2022 22:10:56 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=H9SDN6dC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbiCIF7z (ORCPT + 99 others); Wed, 9 Mar 2022 00:59:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiCIF7y (ORCPT ); Wed, 9 Mar 2022 00:59:54 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C14036EB2A; Tue, 8 Mar 2022 21:58:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2EEDEB81F3A; Wed, 9 Mar 2022 05:58:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91F20C340E8; Wed, 9 Mar 2022 05:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646805532; bh=nBdw0PFUgI9rHcAMdSksgHJv8MFwbw+evuLD7B1lrrw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=H9SDN6dCekoDWiMzcWpMmr4TZ8DLnTG/mH9dAhFGw43kPtWr4qQGHrJAYky+XfRln NqXlDqTboGbeJ4pc7/ZPZA/tjHWOIJEV4FPMIJ9D0BrVRIRy727pcHFV4LlevSr4iQ MLvMQiKV5Rxuiu3AfyhFBB5HHHSUEfRlTJxYE38FWDb0vYHWnq6zIHr6+6p0Yejctz +bdAaDZfmW4gQPhPAEXDm2vL1PDuxd+4ZgB0sYsiKKwdpWc4YfAVCIkWjhfoaM4q5v uvv0XKxVNm2sIBoTUxgszLf4KsfA86zqkXFA0PbusMPYBvIVWYUqNIXw8czQRE5E8R tKnEC/XC4+oDw== Date: Tue, 8 Mar 2022 21:58:51 -0800 From: Jakub Kicinski To: Kleber Sacilotto de Souza Cc: davem@davemloft.net, shuah@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH] net: netdevsim: fix byte order on ipsec debugfs file Message-ID: <20220308215851.397817bd@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20220308135106.890270-1-kleber.souza@canonical.com> References: <20220308135106.890270-1-kleber.souza@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 Tue, 8 Mar 2022 14:51:06 +0100 Kleber Sacilotto de Souza wrote: > When adding a new xfrm state, the data provided via struct xfrm_state > is stored in network byte order. This needs to be taken into > consideration when exporting the SAs data to userspace via debugfs, > otherwise the content will depend on the system endianness. Fix this by > converting all multi-byte fields from network to host order. > > Also fix the selftest script which was expecting the data as exported by > a little-endian system, which was inverted. > > Fixes: 7699353da875 ("netdevsim: add ipsec offload testing") > Fixes: 2766a11161cc ("selftests: rtnetlink: add ipsec offload API test") > Signed-off-by: Kleber Sacilotto de Souza Then the struct members need to have the correct types, as is this patch adds sparse warnings (build with C=1).