Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4655745iob; Sun, 8 May 2022 20:49:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtNRSFgixRK0Z+dAWXBt5eJ+ubkjSF5DP/y8WyJKHkSpUpLklf4FqWdHu0bMH3Jlf9Pp6e X-Received: by 2002:a63:4e4d:0:b0:3c6:51ec:724c with SMTP id o13-20020a634e4d000000b003c651ec724cmr10404937pgl.297.1652068163541; Sun, 08 May 2022 20:49:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652068163; cv=none; d=google.com; s=arc-20160816; b=RPKXt6kcwmq01vIhQKtJF0pdwpjGQ4tMNW7O2qXuoYn5L8Y6ijhshBxt3E5xtXFyFQ AxEZwxLt7lyEF9TqsAGVuoqEdCEHwYMNtPgk9O4lD/EogfgeCnu6vVNgNwD8CS7J4nWN nYnm/pZ6tY+xlOFgKiwN/lD74NK5sXWTMGnwPuvUSi89pAkp18OqaZ/lm+GjRWMt2W+H QsvnJEGJKC/G46WJEBpbS8CZu9YwdX6H0TActC2PIhACpiza6eIo2IdUi94qXjuynhNT au8FGu5e4LSweICKdA464SsHOkGnIO7Gs1iMgyobP+3KCA4rkIK56DO69LpNq09xQlQj r26g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=GqkF1KE8HpAmQB4r+M2R5O0GOtheHQHEI+M7f5J9eiQ=; b=vutwcmkN9MPwwZBd0Y/9g3h6rp8knHIe9uXHpZw0s5W9KIWBCeIRkwd9wNVCzUsptm 2oboWtFwxO2XqFxmy2nWoVkH0NQl/TJM3Zg8sSWxa/Ryt9moMJcZIXmORHHBqg1MCpHk cOgokIXPnums5GUIcL8B3MhNy+bt0mHg0veCwuUvbcPhYjIIouidEeIXlsvNfG4I3FeP CAcTXcjRJM/firz5zdzpO2rmLDPdh61KZ7rJ5rpvVJoEMM0rlQwwiIwi3lrz0sDSsJiI CUajbpg1fYmq3ea5tlVPZbEpw2NJvEN8KfrSVZVUmRymZnPl+v22IbJOnDNqEljdoWE5 gvPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aQyEueKv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x1-20020a63aa41000000b003c6a5d78bb5si5224604pgo.411.2022.05.08.20.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:49:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aQyEueKv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 127AA2187; Sun, 8 May 2022 20:46:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346773AbiEEITs (ORCPT + 99 others); Thu, 5 May 2022 04:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244879AbiEEITk (ORCPT ); Thu, 5 May 2022 04:19:40 -0400 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.129.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D9A5129CB8 for ; Thu, 5 May 2022 01:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651738560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GqkF1KE8HpAmQB4r+M2R5O0GOtheHQHEI+M7f5J9eiQ=; b=aQyEueKv5bawpWRSIfoAGtZLZ80Vps99RIbc9x9eUFLziVJNZcCnlIyrSvrcJEDEGS+qhc rMs+6dx/zzMSqr9OErHkErm77kxpapWMmGZw4ow3tA5B3BZ/i7jGFHpbghN01JRtwTxSL8 GofBUTtpBAMRG+ovwfDzQvxANDYxm5E= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-ZjAlkKR0NMmEFb5-35Pp1g-1; Thu, 05 May 2022 04:14:34 -0400 X-MC-Unique: ZjAlkKR0NMmEFb5-35Pp1g-1 Received: by mail-pl1-f198.google.com with SMTP id g12-20020a170902740c00b0015d243ff163so1938319pll.19 for ; Thu, 05 May 2022 01:14:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GqkF1KE8HpAmQB4r+M2R5O0GOtheHQHEI+M7f5J9eiQ=; b=nhdx/KPXiRTLDbCpAua+UKKLGf77JtKzJJbm3hwiCl6V5elRU/Q7229QpBJ2SHVTFu 1fVvu9SLMnxnb3xXEdIiGi5xj2v4oMT3mrbnMCh1kQEk2GN2EQkwsMrLlN8QbIzKnNoP lQkJcmqblqZsB8DNdmRwrO6fWclBXdNGnKo6PqSS7dTPO951BFE7AfWXQbcwEnOHw56p IIrtdpLB/t2UfR6jufVUbcGYeiHUNMBytSImNxmb947/Z5Pkd1fxIHOsCsbZg7hwJbXz M68Bj0ovNJlkGtBTVpUXGGrMarZ/83Y8fpBo5PhUqS33kKlp8Bs4z8LwZ/0zLmlN0YqW m0qQ== X-Gm-Message-State: AOAM530sqBL5cxwXGX8QVdSNbB0X6HK/Z3AXWXaR06o9Dyk0AiJS0APg RuCiRgg/yMUEb+bwfxB3zbcd2ncTRt9BdQpJbH/RlXRoHaPv5g2g9qFlZESCAdQAJOV88KtkzKl 1o3wQEg17KhJwyMZhN/hP3st6 X-Received: by 2002:a17:902:f60c:b0:156:82c9:e44b with SMTP id n12-20020a170902f60c00b0015682c9e44bmr26008991plg.106.1651738472903; Thu, 05 May 2022 01:14:32 -0700 (PDT) X-Received: by 2002:a17:902:f60c:b0:156:82c9:e44b with SMTP id n12-20020a170902f60c00b0015682c9e44bmr26008973plg.106.1651738472663; Thu, 05 May 2022 01:14:32 -0700 (PDT) Received: from [10.72.13.116] ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id d15-20020aa7868f000000b0050dc76281aesm742906pfo.136.2022.05.05.01.14.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 May 2022 01:14:32 -0700 (PDT) Message-ID: Date: Thu, 5 May 2022 16:14:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 3/3] vdpa/mlx5: Add RX MAC VLAN filter support Content-Language: en-US To: Eli Cohen , "mst@redhat.com" Cc: "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "si-wei.liu@oracle.com" References: <20220411122942.225717-1-elic@nvidia.com> <20220411122942.225717-4-elic@nvidia.com> From: Jason Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 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 Thanks >