Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp398496pxx; Thu, 29 Oct 2020 05:26:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzqQh9hVYa/luNGCuV3T+o7lsv/BhUplUjEpthOWCf7f2RXrmeC6XHErVyScq8rqmZ6Q5y X-Received: by 2002:a05:6402:6ca:: with SMTP id n10mr3773852edy.314.1603974373931; Thu, 29 Oct 2020 05:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603974373; cv=none; d=google.com; s=arc-20160816; b=ugpi4HfT7qvjo/VaMIi2Tg5vMS+6CM9a+rFuJwTBQAX4PJFR/TLigMKFgoymQ5lOBV 2LT7xW+1Q0Aggv4KZcXzvZuyNeDvr9E6d8yY5qBX+CrLBqIkNemYh7x8emjGxhgabBih OaFMwsFMbL5l++mcp7yw2ldyzHJq1FYKnFDhUYVEW4LgOGezmiRXY3Eqh/Mc6uY5eqGH AF0c+bSAwRmdxt0h3Ol9comtt0UwiS64UtonJM69JkbxRNI+7gLZnSDzI47/K1KyB3+T obBAFL0UG1qDhI3/Gn2UplFLVxyNn0wqaahWAJ92BNAteVjEztq7aVS2truFBjoy+d1n DUxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uu1tSUlQesEvUDOvu71K/Re9PS7yCI/Ckixv81heB68=; b=ZohdqTQAuI/hvhM0RQplbN40jcFj8/F9HdMQIsKkKOitTljX5r7Z58ghHeMWhE8AlD 693mU9nO/vxprXhLgb7/RyZHca/I1NyOPR/2hqGMzLTa2wn3BjN15Ti3CAv9sQ5Wk1as Lzt6pxuGvN+/7nd+/I+tY1yfMyGT07Wnot5anfNFvOs6S/YbKaWD+QaVAgtcEQqtHYZ/ SUfreMe1q8xHoxmiNlHzAAqrxgoIKTQK+KTD/DzbWcM/L9wErGajpmrfrb1VqlWyEwc7 +Ti+hqVv6BFuJC+ejVsr1wY/pK0U2A/N98F8Bu2eTFEdt+V+cQZSO63gUG75H8s9p30M zKHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MrXt5Z81; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zh8si2135746ejb.123.2020.10.29.05.25.50; Thu, 29 Oct 2020 05:26:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MrXt5Z81; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725813AbgJ2MYB (ORCPT + 99 others); Thu, 29 Oct 2020 08:24:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58825 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgJ2MXD (ORCPT ); Thu, 29 Oct 2020 08:23:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603974181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uu1tSUlQesEvUDOvu71K/Re9PS7yCI/Ckixv81heB68=; b=MrXt5Z81enyxcclTA3ygBvjNS87Zpsd+41hSuiDE/JR8D4ygQtx5J3P50yqpRFOilCq4fR rgMST2gfnLo6K0npf5NUJTTzQkbJusw5cYwR0Gl0au3xl2eoesRwzScgedoX7vR57YPTiv g/fEujsUXnaZRM9ZGjgTk8xkXTBLHlA= 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-398-JN7Y5NHFNI29WG7XpYQt1g-1; Thu, 29 Oct 2020 08:20:55 -0400 X-MC-Unique: JN7Y5NHFNI29WG7XpYQt1g-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 9152287952A; Thu, 29 Oct 2020 12:20:54 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-113-197.ams2.redhat.com [10.36.113.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BD3B6266E; Thu, 29 Oct 2020 12:20:52 +0000 (UTC) From: Laurent Vivier To: linux-kernel@vger.kernel.org Cc: "Michael S. Tsirkin" , virtualization@lists.linux-foundation.org, Jason Wang , Laurent Vivier Subject: [PATCH 1/2] vdpasim: fix MAC address configuration Date: Thu, 29 Oct 2020 13:20:49 +0100 Message-Id: <20201029122050.776445-2-lvivier@redhat.com> In-Reply-To: <20201029122050.776445-1-lvivier@redhat.com> References: <20201029122050.776445-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vdpa_sim generates a ramdom MAC address but it is never used by upper layers because the VIRTIO_NET_F_MAC bit is not set in the features list. Because of that, virtio-net always regenerates a random MAC address each time it is loaded whereas the address should only change on vdpa_sim load/unload. Fix that by adding VIRTIO_NET_F_MAC in the features list of vdpa_sim. Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator") Cc: jasowang@redhat.com Signed-off-by: Laurent Vivier --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index 2629911c29bb..7f8ebc9924ac 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -60,7 +60,8 @@ struct vdpasim_virtqueue { static u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) | (1ULL << VIRTIO_F_VERSION_1) | - (1ULL << VIRTIO_F_ACCESS_PLATFORM); + (1ULL << VIRTIO_F_ACCESS_PLATFORM) | + (1ULL << VIRTIO_NET_F_MAC); /* State of each vdpasim device */ struct vdpasim { -- 2.26.2