From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BC61042A4D; Wed, 3 May 2023 11:36:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 914D14114B; Wed, 3 May 2023 11:36:57 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 0001741144 for ; Wed, 3 May 2023 11:36:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683106616; 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=L0VU5IfGHXYPSUv9DtHZZEP5+huHKu8XhOAkzwQi0hs=; b=cbWprsjZ7cu3XS9uwNlcoyT800Qf5rryGq4S8na6ELA7kzQs9hnJzgQoYhKMUMeYe+5q9K L0UUTxiJE9f1fcYNq+wgbJSZbq5Fs22fibTgbvhTZex30cVZ2prnHrYEupCmf9Z5GK0hPD lvtsgYlPosgyZiIUp/FwJWllIPHWQVs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-669-Cg9_2FmZPkOZYT7zcmltWQ-1; Wed, 03 May 2023 05:36:53 -0400 X-MC-Unique: Cg9_2FmZPkOZYT7zcmltWQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0B18C280049A; Wed, 3 May 2023 09:36:53 +0000 (UTC) Received: from [10.39.208.36] (unknown [10.39.208.36]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DAE5C2166B26; Wed, 3 May 2023 09:36:50 +0000 (UTC) Message-ID: <42af2ea2-0c07-bc76-e086-9eb6bf0c639e@redhat.com> Date: Wed, 3 May 2023 11:36:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 To: Cheng Jiang , chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, xuan.ding@intel.com, wenwux.ma@intel.com, yuanx.wang@intel.com, xingguang.he@intel.com, David Marchand References: <20230421010932.46847-1-cheng1.jiang@intel.com> From: Maxime Coquelin Subject: Re: [PATCH 0/2] vhost: add port mirroring function in the vhost lib In-Reply-To: <20230421010932.46847-1-cheng1.jiang@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Cheng, On 4/21/23 03:09, Cheng Jiang wrote: > Similar to the port mirroring function on the switch or router, this > patch set implements such function on the Vhost lib. When > data is sent to a front-end, it will also send the data to its mirror > front-end. When data is received from a front-end, it will also send > the data to its mirror front-end. Why not just keeping mirroring in the switch/router? I am really not convinced this is the way to go: 1. API is too complex 2. It requires async support 3. There is too much code duplication, it increases virtio-net.c by 30%, and it is without packed ring support. 4. If mirror port is down for any reason, packets to/from the original port are dropped. 5. It seems to assume negotiated features of the two ports are identical, e.g. Virtio-net header length? If so, that's not a manageable solution. Regards, Maxime > > Cheng Jiang (2): > vhost: add ingress API for port mirroring datapath > vhost: add egress API for port mirroring datapath > > lib/vhost/rte_vhost_async.h | 17 + > lib/vhost/version.map | 3 + > lib/vhost/virtio_net.c | 1266 +++++++++++++++++++++++++++++++++++ > 3 files changed, 1286 insertions(+) > > -- > 2.35.1 >