qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/1] hw/net/can: Introduce Xlnx ZynqMP CAN controller for QEM


From: Jason Wang
Subject: Re: [PATCH 1/1] hw/net/can: Introduce Xlnx ZynqMP CAN controller for QEMU
Date: Tue, 11 Feb 2020 11:09:07 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0


On 2020/2/11 上午5:45, Vikram Garhwal wrote:
+                }
+            } else {
+                /* Normal mode Tx. */
+                generate_frame(&frame, data);
+
+                can_bus_client_send(&s->bus_client, &frame, 1);
I had a quick glance at can_bus_client_send():

It did:

      QTAILQ_FOREACH(peer, &bus->clients, next) {
          if (peer->info->can_receive(peer)) {
              if (peer == client) {
                  /* No loopback support for now */
                  continue;
              }
              if (peer->info->receive(peer, frames, frames_cnt) > 0) {
                  ret = 1;
              }
          }
      }

which looks not correct. We need to use qemu_send_packet() instead of
calling peer->info->receive() directly which bypasses filters completely.
[Vikram Garhwal] Can you please elaborate it bit more on why do we need to 
filter outgoing message? So, I can either add a filter before sending the 
packets. I am unable to understand the use case for it. For any message which 
is incoming, we are filtering it for sure before storing in update_rx_fifo().


I might be not clear, I meant the netfilters supported by qemu which allows you to attach a filter to a specific NetClientState, see qemu_send_packet_async_with_flags. It doesn't mean the filter implemented in your own NIC model.

Thanks


Also, I can see existing CAN models like CAN sja1000 and CAN Kavser are using it 
same can_bus_client_send() function. However, this doesn't mean that it is the 
correct way to send & receive packets.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]