From: Yojana Mallik <y-mallik@ti.com>
To: Andrew Lunn <andrew@lunn.ch>
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>,
Siddharth Vadapalli <s-vadapalli@ti.com>, <y-mallik@ti.com>
Subject: Re: [PATCH net-next v2 2/3] net: ethernet: ti: Register the RPMsg driver as network device
Date: Tue, 4 Jun 2024 11:53:55 +0530 [thread overview]
Message-ID: <2d65aa06-cadd-4462-b8b9-50c9127e6a30@ti.com> (raw)
In-Reply-To: <4416ada7-399b-4ea0-88b0-32ca432d777b@lunn.ch>
Hi Andrew,
On 6/2/24 22:15, Andrew Lunn wrote:
>> +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?
>
+ rpmsg_send(common->rpdev->ept, (void *)(&common->send_msg),
+ sizeof(common->send_msg));
rpmsg_send in icve_create_send_request is sending message_header.msg_type to R5
core using (void *)(&common->send_msg).
In icve_rpmsg_cb function switch case statements for option msg_type are used
and cases are from enum icve_rpmsg_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,
> };
>
Since msg_hdr.msg_type which takes value from enum icve_msg_type is being used
in rpmsg_send and icve_rpmsg_cb, I would prefer to continue with the 2 separate
enums, that is enum icve_msg_type and enum icve_rpmsg_type. However I am always
open to make improvements and would be happy to discuss this further if you
have additional insights.
> Also, why SET_MAC_ADDR? It would be good to document where the MAC
> address are coming from. And what address this is setting.
>
The interface which is controlled by Linux and interacting with the R5 core is
assigned mac address 00:00:00:00:00:00 by default. To ensure reliable
communication and compliance with network standards a different MAC address is
set for this interface using icve_set_mac_address.
> 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.
>
I will do it.
>> +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: <NO-CARRIER,BROADCAST,MULTICAST,UP> 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?
>
MTU is only the Payload. I have realized the macro names are misleading and I
will change them as
#define ICVE_PACKET_BUFFER_SIZE 1540
#define MAX_MTU ICVE_PACKET_BUFFER_SIZE - (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN)
Hence value of max mtu is 1518 bytes.
>> + 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
The address referred above is physical address. It is the address of Tx and Rx
buffer under the control of Linux operating over A53 core. The check if the
shared memory is mapped to the same address in both address spaces is checked
by the R5 core.
Thanks for the feedback.
Regards
Yojana Mallik
next prev parent reply other threads:[~2024-06-04 6:24 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-31 6:40 [PATCH net-next v2 0/3] Introducing Intercore Virtual Ethernet (ICVE) driver Yojana Mallik
2024-05-31 6:40 ` [PATCH net-next v2 1/3] net: ethernet: ti: RPMsg based shared memory ethernet driver Yojana Mallik
2024-05-31 15:30 ` Randy Dunlap
2024-06-03 5:50 ` Yojana Mallik
2024-06-02 7:01 ` Siddharth Vadapalli
2024-06-03 6:16 ` Yojana Mallik
2024-06-02 16:21 ` Andrew Lunn
2024-06-03 8:56 ` Yojana Mallik
2024-06-03 12:54 ` Andrew Lunn
2024-05-31 6:40 ` [PATCH net-next v2 2/3] net: ethernet: ti: Register the RPMsg driver as network device Yojana Mallik
2024-06-01 3:13 ` kernel test robot
2024-06-03 9:26 ` Yojana Mallik
2024-06-02 7:22 ` Siddharth Vadapalli
2024-06-02 15:54 ` Andrew Lunn
2024-06-02 7:35 ` Siddharth Vadapalli
2024-06-02 16:45 ` Andrew Lunn
2024-06-04 6:23 ` Yojana Mallik [this message]
2024-06-04 12:54 ` Andrew Lunn
2024-06-12 12:52 ` Yojana Mallik
2024-06-12 14:59 ` Andrew Lunn
2024-06-14 9:08 ` Yojana Mallik
2024-06-16 16:19 ` Andrew Lunn
2024-06-16 19:03 ` Andrew Lunn
2024-06-04 13:00 ` Andrew Lunn
2024-06-12 12:49 ` Yojana Mallik
2024-06-12 14:36 ` Andrew Lunn
2024-05-31 6:40 ` [PATCH net-next v2 3/3] net: ethernet: ti: icve: Add support for multicast filtering Yojana Mallik
2024-06-03 21:27 ` kernel test robot
2024-06-02 15:45 ` [PATCH net-next v2 0/3] Introducing Intercore Virtual Ethernet (ICVE) driver Andrew Lunn
2024-06-03 23:54 ` Jakub Kicinski
2024-06-12 12:48 ` Yojana Mallik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2d65aa06-cadd-4462-b8b9-50c9127e6a30@ti.com \
--to=y-mallik@ti.com \
--cc=andrew@lunn.ch \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=diogo.ivo@siemens.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rdunlap@infradead.org \
--cc=rogerq@kernel.org \
--cc=rogerq@ti.com \
--cc=s-vadapalli@ti.com \
--cc=schnelle@linux.ibm.com \
--cc=srk@ti.com \
--cc=vigneshr@ti.com \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®