Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp536357lqj; Sun, 2 Jun 2024 09:45:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpELOy7mtCvknT3voL7JvdKGvieEowNgCZunlyRWg14IcGBFj4+dfniWowD6IadHo8AzjDsf6IWl5kmHg+lBGy09wCkP4HPoXIhcH+lg== X-Google-Smtp-Source: AGHT+IFNdp11LVh/7L0MxywJMxGfau/SmyJ+VVlCDaCx1Q9S+RTNeVUkG70YOhcJkBw5NJF+ZZaK X-Received: by 2002:ac2:4313:0:b0:51e:41a1:4d5 with SMTP id 2adb3069b0e04-52b8955c235mr4291541e87.9.1717346738569; Sun, 02 Jun 2024 09:45:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717346738; cv=pass; d=google.com; s=arc-20160816; b=PJJPr7rcpWrFN358BOoOBeYZW5nb1bhoKDt9mOcFbCpV5E6YXGUGRgAi4HMu5eaej2 MUgnkK0crlm4Eo+KahlsdTt3POh06Srruys5Ksm89HepWpSIfIc/3nkzEugSdUip3N5w Y3bdEW3RmqFGyGe7zIYQIHZ/RHwv3Lkq8NRlqwHV9pMecVuLDkhajyMegphOvIUKbJWG FrpvB879JYSVlUyDcKhxoXvi8jisgYm0qPgnkIvOphsv8/RcKYcGW3TfXkEH0afjeymW rhig7+FA6+J/udHcCHc1m4m3qlv1e4840MOWI0WwSr3H2qXgoPyL/xUH0cieXOrGBXWN 17Jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=E+ueS2eEFa2OpuuO5ZI4AFvsqau7YjoMECLisKyw7Wk=; fh=ZxGHAhTN2Fne2+i60fJZx66y/ypf55Z7izXGr4RwOgs=; b=oBAQvI9+Vak7f+wpD/t/2ytsRdehFdXAiylQmO2jAWq9mEh8WpTKUiaMjeId6HZ4O4 BRiir3CV/jFm6CDNb/1ghu1FDuo7T69K74tT1toJRbvNKEb2j9acWuW2WuWNG00RQDGL Gcz5HHQlD7haS0/XGunCvAe9TOtgR1qm6ss5BhZwdp1TF+ELbscyRYROh9Qs1NFl9DRY +qHDm0+4C7JsdqhsFlyCzWxoWSNXVnRYTsKnVvbXbXf277j11oudF+dkYYjyB091HRaJ gHN5KZLdf9vzV8GjrXrbARZV9W9ZvHEAix7VrtLkYE0pOsdFsrswHnGiAkYa3vHI8Pme tBdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=eMV20MTy; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-198369-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198369-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68e20b9ad8si122451266b.878.2024.06.02.09.45.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 09:45:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198369-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=eMV20MTy; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-198369-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198369-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 17E281F2138F for ; Sun, 2 Jun 2024 16:45:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C709A54FB5; Sun, 2 Jun 2024 16:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="eMV20MTy" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DDCA1DFF8; Sun, 2 Jun 2024 16:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717346729; cv=none; b=BiQ1yLUquaEkHoCSAc76icNvS+/YUs2lz8waxHEL0yjV4y9fb56uuyAbVgKabGBV4/0iF8YQL3RdGAdgQbnMqnPPUl4s1ztl/L7pVQaNiIPh34ueefZd8oMSWGbTBd2oR8nb+bsL3DeVRsEe9ko4bsi8a2nLEBBLsDba12+VM+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717346729; c=relaxed/simple; bh=c5LYpW+xTgQarazi/IQ7/kG9iiaYTqQFdkkLNpW95pw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fQwTWrX4Wfnn1qclyZ2AEZHmB90a+ejt1oiiBRCB/aVtt6NA7yQN70D5TYlbk6fDgB6H72cnFf/o9XjSuCoTKjpt8H5BlDKWvdJepZ16bHxQVGr6kRu4J0qVCoJtVKF0ZNI6fHDFqoCHy75QK3oM6LFN5YGBnd1G02bRNK6mjxY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=eMV20MTy; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=E+ueS2eEFa2OpuuO5ZI4AFvsqau7YjoMECLisKyw7Wk=; b=eMV20MTyZ4k3m5ti7s7PxT6V6f E4fWb4/PivFFAQ9A3x9BIRT/NiW9SWEh5zXBmzNLFqXnHZ1saDuqSnJ6E6gOpof8Gxg0GnJRZ8eVz LQw8iHtNIxVqU8W1lOWDpw3k4UM0zh3HNrlVI6cyXXnUkFIamHzBW40HIYhvei8Hkcy4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1sDoKa-00Ge9U-Gf; Sun, 02 Jun 2024 18:45:16 +0200 Date: Sun, 2 Jun 2024 18:45:16 +0200 From: Andrew Lunn To: Yojana Mallik Cc: schnelle@linux.ibm.com, wsa+renesas@sang-engineering.com, diogo.ivo@siemens.com, rdunlap@infradead.org, horms@kernel.org, vigneshr@ti.com, rogerq@ti.com, danishanwar@ti.com, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, srk@ti.com, rogerq@kernel.org Subject: Re: [PATCH net-next v2 2/3] net: ethernet: ti: Register the RPMsg driver as network device Message-ID: <4416ada7-399b-4ea0-88b0-32ca432d777b@lunn.ch> References: <20240531064006.1223417-1-y-mallik@ti.com> <20240531064006.1223417-3-y-mallik@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240531064006.1223417-3-y-mallik@ti.com> > +enum icve_rpmsg_type { > + /* Request types */ > + ICVE_REQ_SHM_INFO = 0, > + ICVE_REQ_SET_MAC_ADDR, > + > + /* Response types */ > + ICVE_RESP_SHM_INFO, > + ICVE_RESP_SET_MAC_ADDR, > + > + /* Notification types */ > + ICVE_NOTIFY_PORT_UP, > + ICVE_NOTIFY_PORT_DOWN, > + ICVE_NOTIFY_PORT_READY, > + ICVE_NOTIFY_REMOTE_READY, > +}; +struct message_header { + u32 src_id; + u32 msg_type; /* Do not use enum type, as enum size is compiler dependent */ +} __packed; Given how you have defined icve_rpmsg_type, what is the point of message_header.msg_type? It seems like this would make more sense: enum icve_rpmsg_request_type { ICVE_REQ_SHM_INFO = 0, ICVE_REQ_SET_MAC_ADDR, } enum icve_rpmsg_response_type { ICVE_RESP_SHM_INFO, ICVE_RESP_SET_MAC_ADDR, } enum icve_rpmsg_notify_type { ICVE_NOTIFY_PORT_UP, ICVE_NOTIFY_PORT_DOWN, ICVE_NOTIFY_PORT_READY, ICVE_NOTIFY_REMOTE_READY, }; Also, why SET_MAC_ADDR? It would be good to document where the MAC address are coming from. And what address this is setting. In fact, please put all the protocol documentation into a .rst file. That will help us discuss the protocol independent of the implementation. The protocol is an ABI, so needs to be reviewed well. > +struct icve_shm_info { > + /* Total shared memory size */ > + u32 total_shm_size; > + /* Total number of buffers */ > + u32 num_pkt_bufs; > + /* Per buff slot size i.e MTU Size + 4 bytes for magic number + 4 bytes > + * for Pkt len > + */ What is your definition of MTU? enp2s0: mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 Typically, MTU does not include the Ethernet header or checksum. Is that what you mean here? > + u32 buff_slot_size; > + /* Base Address for Tx or Rx shared memory */ > + u32 base_addr; > +} __packed; What do you mean by address here? Virtual address, physical address, DMA address? And whos address is this, you have two CPUs here, with no guaranteed the shared memory is mapped to the same address in both address spaces. Andrew