From: Jason Wang <jasowang@redhat.com>
To: Eli Cohen <elic@nvidia.com>, "mst@redhat.com" <mst@redhat.com>
Cc: "virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"si-wei.liu@oracle.com" <si-wei.liu@oracle.com>
Subject: Re: [PATCH 3/3] vdpa/mlx5: Add RX MAC VLAN filter support
Date: Thu, 5 May 2022 16:14:25 +0800 [thread overview]
Message-ID: <ad4c0688-6e4b-bc66-55c3-8d33493f7c8c@redhat.com> (raw)
In-Reply-To: <DM8PR12MB540032F367E9DB4C277AB946ABC19@DM8PR12MB5400.namprd12.prod.outlook.com>
在 2022/5/2 13:38, Eli Cohen 写道:
>>> +static virtio_net_ctrl_ack handle_ctrl_vlan(struct mlx5_vdpa_dev *mvdev, u8 cmd)
>>> +{
>>> + struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
>>> + virtio_net_ctrl_ack status = VIRTIO_NET_ERR;
>>> + struct mlx5_control_vq *cvq = &mvdev->cvq;
>>> + struct virtio_net_ctrl_vlan vlan;
>>> + size_t read;
>>> + u16 id;
>>> +
>>> + switch (cmd) {
>>> + case VIRTIO_NET_CTRL_VLAN_ADD:
>>> + read = vringh_iov_pull_iotlb(&cvq->vring, &cvq->riov, (void *)&vlan, sizeof(vlan));
>>> + if (read != sizeof(vlan))
>>> + break;
>>> +
>>> + id = mlx5vdpa16_to_cpu(mvdev, vlan.id);
>>> + if (mac_vlan_add(ndev, ndev->config.mac, id, true))
>>> + break;
>> This may work now but I wonder if we had the plan to support
>> VIRTIO_NET_F_CTRL_RX?
>>
>> if $mac is not in $mac_table
>> drop;
>> if $vlan is not in $vlan_table
>> drop;
>>
>> With that features we probably requires the dedicated vlan filters
>> without a mac? Or do we want to a $mac * $vlans rules?
>>
>> If yes, maybe it's better to decouple vlan filters from mac now.
>>
> If we use dedicated filter tables for VLAN and MAC working in series,
> we may not have full control over incoming traffic filtering.
> For example, suppose we have VLAN table allowing v1 and v2 to go through,
> and a MAC table allowing m1 and m2 to go through.
>
> If we want only (v1, m1) and (v2, m2) to go through but not (v1, m2) or (v2, m1)
> then it would not be possible to block the latter.
Yes, but this is currently how virtio-net work in the spec.
>
> As I can see, the spec does not require that finesse
Yes.
> but I wonder if this not
> what real life requires.
Then we need to extend the spec.
> If you think we should follow the spec let me know and will prepare a new version.
It should be fine now. (But if we want too support CTRL_RX we need some
refactoring on the codes).
So:
Acked-by: Jason Wang <jasowang@redhat.com>
Thanks
>
next prev parent reply other threads:[~2022-05-05 8:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-11 12:29 [PATCH 0/3 RESEND] mlx5_vdpa: Support MAC/VLAN haw offloading Eli Cohen
2022-04-11 12:29 ` [PATCH 1/3] vdpa/mlx5: Remove flow counter from steering Eli Cohen
2022-04-11 12:29 ` [PATCH 2/3] virtio_net: Add control VQ struct to carry vlan id Eli Cohen
2022-04-15 3:00 ` Jason Wang
2022-05-02 5:39 ` Eli Cohen
2022-04-11 12:29 ` [PATCH 3/3] vdpa/mlx5: Add RX MAC VLAN filter support Eli Cohen
2022-04-15 3:58 ` Jason Wang
2022-05-02 5:38 ` Eli Cohen
2022-05-05 8:14 ` Jason Wang [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-04-11 12:27 [PATCH 0/3] mlx5_vdpa: Support MAC/VLAN haw offloading Eli Cohen
2022-04-11 12:27 ` [PATCH 3/3] vdpa/mlx5: Add RX MAC VLAN filter support Eli Cohen
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=ad4c0688-6e4b-bc66-55c3-8d33493f7c8c@redhat.com \
--to=jasowang@redhat.com \
--cc=elic@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=si-wei.liu@oracle.com \
--cc=virtualization@lists.linux-foundation.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 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®