Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2346830rwi; Thu, 3 Nov 2022 16:07:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5IRlxrW4PJUwzd4lEKrx2aZ9xYyw1SkSv0x7UC1YYNy+dzYapqjiih6i7axKStNVUUObEP X-Received: by 2002:a05:6402:42cf:b0:457:ae6f:e443 with SMTP id i15-20020a05640242cf00b00457ae6fe443mr33277070edc.299.1667516846368; Thu, 03 Nov 2022 16:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667516846; cv=none; d=google.com; s=arc-20160816; b=aXfn/hFF9ZLx0TX4YKTvE5PfZ9CezEPbAzlQiIsJouA4SR9CnmVvC9itJp94cVSoiy qZnbOHaCW6D6cAS7JHi1MSJ8Y5KPmlZre7MiiVSO74njm75Eo93VJuyZmV53xqaNs5q3 4vlFWbadMw/YXxNPhg1fDrKAaZQY2r6hZaaL1u5U0jd3gmVE+CieqbJl/hpfCN00FyP6 b3X+yegtFqnNwRxxzpzjDy/HxPfkFw0VLpoDazJJOGSr3nrEmywXmGybZCCofCiMOknO O/UTJ1sS7Ag4QfnXcTYM9HD9Xm+9oIdMCpCTFcMxPLQ4vunpgfs2EPpUXBVqaiVkZUex EGxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=0Q4UYJo0r4CAvLo84TRF+qOpG8p4iPvKnthKy/ejt7k=; b=QtzFKZDkrBc2RWpRLlO88SlpKrI4n6inqXghofLCa7K4XGiLQEmncKK9FVx9ghHI6D d/QvKrKrk1KuHM2Ru/nRjEeZTLGaJsbpiSji5E+FKzljuvZ9vkPULWcvIhI0Z+bOf2zV rTw5bHL23fT2JzFCn8CAEyrdhex7OH/FkmSXoI64ItEV4OmehYmPtqjP18jVMV+9TLvS vLvoSyP77s4Du4TKjMNE6zxYKGkZZhXNwJdnlPcf8oqlrtZcaqlvNKTcFZRMJk7tpTcz k/qjZF+2NrPGt5K6jQtPIruI0vDxpY7hoMJ5PDjkhCVANnYfKV9GNh9lmtPDldtd9sQP 73BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="qwtuK/tB"; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a056402084e00b004596db363c4si3449926edz.264.2022.11.03.16.07.02; Thu, 03 Nov 2022 16:07:26 -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=@quicinc.com header.s=qcdkim header.b="qwtuK/tB"; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231654AbiKCWJc (ORCPT + 97 others); Thu, 3 Nov 2022 18:09:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231319AbiKCWJ3 (ORCPT ); Thu, 3 Nov 2022 18:09:29 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C10C20BD1; Thu, 3 Nov 2022 15:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1667513368; x=1699049368; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=0Q4UYJo0r4CAvLo84TRF+qOpG8p4iPvKnthKy/ejt7k=; b=qwtuK/tBxQxh2U3gqsPoTJchQYr7OIwpIZ+HladWMYgbVyLH93GYNJNH /jFxkQunMlwTB+UjZLrFe4mvA6lcysZj4Yxw0CuNES6IHbe8qj6mKeNOY /IrHa0p+aWcbrgTQzcsc9GkD1RfMQMqo+i2HZGvhataVUCl2jxi4qiMN4 Q=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 03 Nov 2022 15:09:27 -0700 X-QCInternal: smtphost Received: from nasanex01b.na.qualcomm.com ([10.46.141.250]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2022 15:09:27 -0700 Received: from [10.110.42.219] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 3 Nov 2022 15:09:26 -0700 Message-ID: Date: Thu, 3 Nov 2022 15:09:25 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v6 10/21] gunyah: rsc_mgr: Add resource manager RPC core To: Greg Kroah-Hartman CC: Jassi Brar , Bjorn Andersson , Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Andy Gross , Dmitry Baryshkov , , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , "Will Deacon" , Catalin Marinas , "Arnd Bergmann" , Srinivas Kandagatla , Amol Maheshwari , Kalle Valo , , , , References: <20221026185846.3983888-1-quic_eberman@quicinc.com> <20221026185846.3983888-11-quic_eberman@quicinc.com> <3d2858fe-ea3e-159c-faff-5052cba1e08c@quicinc.com> <28eaa4bd-a9ee-c415-57c4-a9a56ffeef18@quicinc.com> Content-Language: en-US From: Elliot Berman In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 11/2/2022 5:22 PM, Greg Kroah-Hartman wrote: > On Wed, Nov 02, 2022 at 11:04:45AM -0700, Elliot Berman wrote: >>>>>> +/* Resource Manager Header */ >>>>>> +struct gh_rm_rpc_hdr { >>>>>> + u8 version : 4, hdr_words : 4; >>>>>> + u8 type : 2, fragments : 6; >>>>> >>>>> Ick, that's hard to read. One variable per line please? >>>> >>>> Ack. >>>> >>>>> And why the bit packed stuff? Are you sure this is the way to do this? >>>>> Why not use a bitmask instead? >>>>> >>>> >>>> I felt bit packed implementation is cleaner and easier to map to >>>> understanding what the fields are used for. >>> >>> Ah, so this isn't what is on the "wire", then don't use a bitfield like >>> this, use a real variable and that will be faster and simpler to >>> understand. >>> >> >> This is what's on the "wire". Whether I use bitfield or bit packed would be >> functionally the same and is just a cosmetic change IMO. > > Ah, that wasn't obvious at all. > > Usually using bitfields like this for "wire" protocols is not a good > idea (endian issues and all of that.) Please use a bitmask instead, as > that way you know exactly what is happening, and the compiler can > usually generate much better code overall. > > And as this is on the wire, please specify the endian values, _AND_ use > the proper kernel types for stuff that goes between user/kernel or > kernel/hardware, as you are not doing that here. Ack