From patchwork Thu Jun 17 14:17:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 94355 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 1A44DA0C4B; Thu, 17 Jun 2021 16:17:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F5624067A; Thu, 17 Jun 2021 16:17:33 +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 949F140150 for ; Thu, 17 Jun 2021 16:17:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623939451; 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=NMsunvtl7rgbtQF5wRVDWKG5fcAGpIsdXKZlom6cmiM=; b=ZTreTVKfyHbc0cmykVk3nEq+6WqKZURY0Snm944/+7pT44LmrW0whW9eLP1Qnm16ycBFMF jh1EESu/vqbh3FPtvASVQBE0Q2LJUo8rDoueKx3SkdzZQTeVwBcUx5eGnZUM3TP0FKyo81 dqpc1Zx/1iYOJXJxY9YeLWqpoEpuCIQ= 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-309-QC17CpZGN5OSSKps3WXO9g-1; Thu, 17 Jun 2021 10:17:30 -0400 X-MC-Unique: QC17CpZGN5OSSKps3WXO9g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 77157101C8AD; Thu, 17 Jun 2021 14:17:29 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50B445D6DC; Thu, 17 Jun 2021 14:17:21 +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, 17 Jun 2021 16:17:15 +0200 Message-Id: <20210617141718.173396-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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] [PATCH v2 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. Changes since v2: ----------------- - Remove unnecessary "\n" in error logging (Chenbo). Changes since RFC: ------------------ - Rebase - Improve logging by printing used MAC address when specified by the user or the device (Adrian, Chenbo) 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 | 95 +++++++++++++++---- .../net/virtio/virtio_user/virtio_user_dev.h | 2 + drivers/net/virtio/virtio_user_ethdev.c | 12 ++- 5 files changed, 158 insertions(+), 23 deletions(-)