From patchwork Thu Mar 18 22:35:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 89511 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C3033A0561; Thu, 18 Mar 2021 23:35:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45DEB140F48; Thu, 18 Mar 2021 23:35:42 +0100 (CET) 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 83E2840698 for ; Thu, 18 Mar 2021 23:35:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616106939; 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; bh=UrK9snxInzi1Jp4iJSRQm9FDvljab/l5q1S8GowcSYo=; b=N8U+QBAcxPnS5hVO7mCRNdKUdnRgU/8FWqOW6xRC4sFJh3gG0PelEtyk8Oxi5VYw0vl+th Is/NSgLSgozFbsVxDMLmuxNRjJ40qbtv9UlKeFlxRMsMSCuoQnAvLPLAQNUucLgBopAUyC zydcbG8tmGYLqfCGZLHL8/b2mjQlsAY= 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-411-S2HW0YDQNoy9tT5wgavxiw-1; Thu, 18 Mar 2021 18:35:36 -0400 X-MC-Unique: S2HW0YDQNoy9tT5wgavxiw-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 8F1201083E81; Thu, 18 Mar 2021 22:35:35 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76CFF610F1; Thu, 18 Mar 2021 22:35:29 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com, david.marchand@redhat.com Cc: Maxime Coquelin Date: Thu, 18 Mar 2021 23:35:23 +0100 Message-Id: <20210318223526.168614-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 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 Subject: [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" 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. 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. 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(-)