Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5858601yba; Thu, 11 Apr 2019 07:14:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiesiEIIPmKlJP1Xc/ubEic/rsmojAweRkRnKsN82+tIHcyv3xUI+1dwLIROlG9ix1Wx0g X-Received: by 2002:aa7:8096:: with SMTP id v22mr21222048pff.94.1554992086015; Thu, 11 Apr 2019 07:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554992086; cv=none; d=google.com; s=arc-20160816; b=VwBtK6PESNqA7bPKa8nM7n2Vk5KzrEJCk4cSpbh9Azk14dm2iOGYuahfqaEC4xs3jJ +DmtFo7sMIz4d8bYRrEdNVEO+p4+8TkPYqJj34kmyh9P6f6RW1/c99ue6Y1F+f7CxlOB JsEsHq8VO9xUrWL6ABbyekBi2gykIBFFY58PQlkL7GinuWoXz5Tdy8CGowTzhMuDjxmR tNKXtnoJG1RxCHTebS8ciE1V37YvNNjHwI0Kr0LJa23yP7Er4gkgtC/51hJB3Snv9ugG Duuvx1aHkKCbrEijZqWvabKoOuJgr8QgXloMdUlgirijzeqJp2s1TNihFefyTDjMuPNv t3kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Psxq1a4XqqKstTyF5j8GevDssfxU25xh8JuczOrSjAE=; b=oTDQI3cbGs6KgbcpN7zShClMP6yZNUpb82xJD7GcWARThkq0OEgUXUZoy3chpvnJB6 5NPvgPiBO1oD19r3Gb4AVxsFh9BZEToUKhCTl97JSiXYJ0cbayGKT3yMHMS1mH4kTFoN +mc4MId3CrDey7jd9CqSPMpYnFjctpe3tkQfb5uQNzXP4iqRjAUKVSe8Md1Gk9WyNml9 Tbl/23FBtds8ZiCRnsic7WN3/te2kZaYY7XzW+3OCLGO6iiNqaL2LW2c4nS4iKelhuvm J/DwrM0uCZraM6ulILccNdR+5+IECTsuZbIe5OSNsEKgrrWuKbQR7kVTGUrKvm2N9r6F UFew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RpHUJdQ2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si34676975pfn.57.2019.04.11.07.14.30; Thu, 11 Apr 2019 07:14:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RpHUJdQ2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726731AbfDKONj (ORCPT + 99 others); Thu, 11 Apr 2019 10:13:39 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33051 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfDKONj (ORCPT ); Thu, 11 Apr 2019 10:13:39 -0400 Received: by mail-pf1-f196.google.com with SMTP id h5so3539066pfo.0; Thu, 11 Apr 2019 07:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Psxq1a4XqqKstTyF5j8GevDssfxU25xh8JuczOrSjAE=; b=RpHUJdQ2vd0YcPCaW6JwryLgBMnY5/ojB+mqLaGyJb/NZFdiQ6nWDUjRGAVaUplebs c87SaPRdmBlO/0fswUFICCR0ks1Z9rdZwt31vI5K4POLlWWgpq9f7DW95rPrqEHRmXby Bc5Zm/tTZhzgOPnAwM6msPuCuyJjyM51n+i3P2GvoZ/vdNoMYnBy3NJVpqL6ibkQ/nNh O7jLIYAZeQxlNDeSOw9hh8Odwi/yJNPtoCxA+Y9Xdwcwon58lKDmfym7NljEEg/Szu1l fcY+UAYe1WzPvTa/GPq93X7JDxVRwoEv+2hlkuEZ+aYuQPytn+V+PPaj85yLvons+AuZ j6iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Psxq1a4XqqKstTyF5j8GevDssfxU25xh8JuczOrSjAE=; b=gNqhfBFzCaeEErmuCEr15e9VTrqf+vULLpnmm1xU75ySW4tmy7F88kKN6f5EAHlj2k ZgRPmEHrkE0LJ2sRc3+4BSerE6Bu7ETyN5ijP16xgCZbTToDrtANd9gJM7HfpNG2SzkS brMw/Lkieg/uQgrE7O+cadhZ8J+ZgvlfKV8JgcPk/+ayH0M4CJYrUwW5GEhwc69QwujW LmwiiXRScBTjCpvIoXN9uwqkNojdN4iSWZUx5lqkn9w0YOHKWGmwc2XJGc5GQHtUubXG EqoAqnQglz3Sv5I6Bwireka8XWOmxbo/O0vqlyHty+SevuHjyf+uNU7FLwln1NpVafHe mKyQ== X-Gm-Message-State: APjAAAW1DK2MyPeWGbTH6afYdYNJfvoQjFFsMUlfey1jdOg98S2dbwav sndSYHtmxpfzofhep30HUCpISueanZGZJo2FlV0= X-Received: by 2002:aa7:8b4c:: with SMTP id i12mr43773357pfd.189.1554992018299; Thu, 11 Apr 2019 07:13:38 -0700 (PDT) MIME-Version: 1.0 References: <1554406595-3128-1-git-send-email-lsun@mellanox.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 11 Apr 2019 17:13:27 +0300 Message-ID: Subject: Re: [PATCH v13] platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc To: Liming Sun Cc: David Woods , Andy Shevchenko , Darren Hart , Vadim Pasternak , Linux Kernel Mailing List , Platform Driver Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 7, 2019 at 5:05 AM Liming Sun wrote: > > > + * mlxbf_tmfifo_msg_hdr - Structure of the TmFifo message header > > > + * @type: message type > > > + * @len: payload length > > > + * @u: 64-bit union data > > > + */ > > > +union mlxbf_tmfifo_msg_hdr { > > > + struct { > > > + u8 type; > > > + __be16 len; > > > + u8 unused[5]; > > > + } __packed; > > > + u64 data; > > > > I'm not sure I understand how you can distinguish which field of union to use? > > Isn't here some type missed? > > Updated the comment in v14. > > This message header is a union of struct and u64 data. > The 'struct' has > type and length field which are used to encode & decode the message. > The 'data' field is used to read/write the message header from/to the FIFO. Something fishy here. You are using a structure of data which you would like to write with one call? Perhaps you need to construct this on-the-fly. Moreover, the __be memeber is used in a data which is written as LE. This needs more explanation. -- With Best Regards, Andy Shevchenko