From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AB4EC433ED for ; Fri, 16 Apr 2021 08:10:38 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 91DF66113D for ; Fri, 16 Apr 2021 08:10:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91DF66113D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 85261141B60; Fri, 16 Apr 2021 10:10:36 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 3B097141B1B for ; Fri, 16 Apr 2021 10:10:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618560633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=joIJDbl8RKA+rBtVUdwE0x05enx20xep4qQ9VA9bZKc=; b=EzRWUfMmBVS6znZuQahEJmWJBQ+nLWLeWoJk/uIlZWRgc1K3xWm4CI1a7ckcAkCrkCUQGx 8PcC+cIRKa8zgEKcrGWAUILdZfArPsXrdftrI9tFPe0eVSoekTuD2RQ1BqY1YL4W1jwSYq 33kh2nbNKMwWHkLCYeacXRbtw7Z2KOc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-133-DXF6zrHRMvKNxPpDZ2ST1w-1; Fri, 16 Apr 2021 04:10:28 -0400 X-MC-Unique: DXF6zrHRMvKNxPpDZ2ST1w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 02AC5107ACE6; Fri, 16 Apr 2021 08:10:27 +0000 (UTC) Received: from [10.36.110.28] (unknown [10.36.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70CB560BE5; Fri, 16 Apr 2021 08:10:18 +0000 (UTC) To: Adrian Moreno , dev@dpdk.org, chenbo.xia@intel.com, david.marchand@redhat.com References: <20210318223526.168614-1-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: Date: Fri, 16 Apr 2021 10:10:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [RFC 0/3] net/virtio: add vdpa device config support 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 Sender: "dev" Hi Adrian, Thanks for your feedback. On 4/16/21 9:28 AM, Adrian Moreno wrote: > > > On 3/18/21 11:35 PM, Maxime Coquelin wrote: >> This patch adds vDPA device config space requests support. >> For now, it only adds MAC address get and set. It may be >> extended in next revision to support other configs like >> link state. >> >> Regarding the MAC selection strategy, if devargs MAC address >> is set by the user and valid, the driver tries to store it >> in the device config space, then it reads the MAC address >> back from the device config, which will be used. If not set >> in devargs or invalid, it tries to read it from the device. >> If it fails, a random MAC will be used. >> >> I'm interrested to know your feedback on this strategy. > > In general, I think it's a reasonable strategy. Once we have cq support, things > will be a bit easier. > > Some questions: > How should we interpret failure to configure the mac (i.e: after set and get, > they still don't match)? Should we fail virtio_user_dev_init if the > configuration provided by devargs is not successfully applied? > > Should a zero mac be treated differntly as qemu does? [1] > > [1] > https://patchwork.ozlabs.org/project/qemu-devel/patch/20210302142014.141135-3-mst@redhat.com/ Testing with ConnectX-6 Dx, I can see that the device does not advertise VIRTIO_NET_F_MAC, so with this is series, it just doesn't try to read it from the device. My understanding is that in Qemu, the feature is forced[0], which explains why it reads zeroes. > >> It has been tested with vDPA simulator, which only supports >> getting the MAC address, and witch CX6 which supports neither >> getting or setting MAC address (and so devarg or random MAC is >> used). IFCVF driver seems to support both getting and setting >> the MAC, I have a try with it before next revision. > > Does cx6 negotiate VIRTIO_NET_F_MAC? Nope. I haven't tested yet with IFCVF. Maxime >> >> Maxime Coquelin (3): >> net/virtio: keep device and frontend features separated >> net/virtio: add device config support to vDPA >> net/virtio: add MAC device config getter and setter >> >> drivers/net/virtio/virtio_user/vhost.h | 3 + >> drivers/net/virtio/virtio_user/vhost_vdpa.c | 69 +++++++++++++++ >> .../net/virtio/virtio_user/virtio_user_dev.c | 88 +++++++++++++++---- >> .../net/virtio/virtio_user/virtio_user_dev.h | 2 + >> drivers/net/virtio/virtio_user_ethdev.c | 12 ++- >> 5 files changed, 151 insertions(+), 23 deletions(-) >> > [0]: https://elixir.bootlin.com/qemu/latest/source/hw/net/virtio-net.c#L3078