All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Vikram Garhwal <fnuv@xilinx.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH 1/1] hw/net/can: Introduce Xlnx ZynqMP CAN controller for QEMU
Date: Tue, 11 Feb 2020 11:09:07 +0800	[thread overview]
Message-ID: <b1b9932a-5566-5d2b-c333-8c466dcd322b@redhat.com> (raw)
In-Reply-To: <DM6PR02MB5643F9E19DC0590E14612477BC190@DM6PR02MB5643.namprd02.prod.outlook.com>


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	other threads:[~2020-02-11  3:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 21:06 [PATCH 0/1] Introduce Xlnx ZynqMP CAN controller for QEMU Vikram Garhwal
2020-02-03 21:06 ` [PATCH 1/1] hw/net/can: " Vikram Garhwal
2020-02-05  5:46   ` Jason Wang
2020-02-06 18:39     ` Vikram Garhwal
2020-02-10 21:45     ` Vikram Garhwal
2020-02-11  3:09       ` Jason Wang [this message]
2020-02-25  6:22         ` Vikram Garhwal
2020-02-26  3:24           ` Jason Wang
2020-02-27 16:04             ` Vikram Garhwal
2020-02-05  3:17 ` [PATCH 0/1] " Jason Wang
2020-02-05  3:23   ` Vikram Garhwal
2020-02-05  5:48     ` Jason Wang

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=b1b9932a-5566-5d2b-c333-8c466dcd322b@redhat.com \
    --to=jasowang@redhat.com \
    --cc=fnuv@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.