From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFA8A41C92 for ; Wed, 10 Jul 2024 06:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720591851; cv=none; b=pDk3rMn98wdH9Lp3NQfOGX0z3bG9TEAIDyNz0bccjo5KHWIpe2gv16a4F57tZtbpFpKeSYkWgcJU2mGmMoOXlfy6gP8pJ3+YU7cDXu5y+oIyzaJ8JJM8nxDioWJ8ijDL1fbo8kUXnGCwdn2wn6bY8mjI5AMg2RhnorveDHx62wc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720591851; c=relaxed/simple; bh=1OteSeEEKH0xI0Oh+CNKtD7aOdOLUK4Wax0gEtG/3rY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=te9ZRXR9K3fDu73Ue6atIrQ/hsn7V0B9h/Mw4AlW1nvzDS6md9pexLMI/9aTaxUQzH3rGj+YNQI1eRM6+x0IcKRW6FEqTVhbHU0JXtcA9wEWn06/AN7aIcDfNcRMPPSioDnOjfI5ihD5Y4RYWIupSr/c69cwrE+OokO4ybiGgLU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dvsRFLqV; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dvsRFLqV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720591848; 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=X4MsH1lA4eWc8gvy+b6nRd+irAYUf4vc/vQAj43j3S8=; b=dvsRFLqVVes0doTNK7yYNnH7tlVnP+/H8jWYAtril39/PogA1o2ZJBzQ4viAfpHeZ34jLK mvKdX0iQ6pqbhXBnFOii90Zl3CVtDih3wbROcPNFynFpcrHBDVcUlFvgAfa04W41/EuvLx K+zbjJBh9uN874dj0uFHAaCmNN7mfXo= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-346-9b-Z5lkuOwemotDq0Potfw-1; Wed, 10 Jul 2024 02:10:47 -0400 X-MC-Unique: 9b-Z5lkuOwemotDq0Potfw-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-52ea249d1c9so5619858e87.0 for ; Tue, 09 Jul 2024 23:10:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720591846; x=1721196646; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X4MsH1lA4eWc8gvy+b6nRd+irAYUf4vc/vQAj43j3S8=; b=J4R+9cnYs5f00Cwpxg878OgF+Dit1vZT74o/hvrfyPPBL3mhqgsX7eyLYdi2r5g35s sgR0500ZyFSpqybPcOPT0LxDcL9/nphtGNzJrybRSc2WgTri+fnsLp+HgRt4MwM7XEJr JjyV9TmvMjtLsU5kJAqWfGoDXVXdPFGC19/ZRXjsrDlZm4RwlswfC71cBddefK9K5YU3 fuZ3o7EqCuAYuRnSDFG1HhMUQ5jH+arxnoERJFgs5wNDVZW9aGwtSW/cFIY4+hnYK4lO Z4hsDly10Z9dQ9q9QfG5J9lcDcX29BbtZPCgTTjGVvuY2NJVFzq1vG9vOyDpu9RAXuS2 7jSw== X-Forwarded-Encrypted: i=1; AJvYcCVXSXk0LgmqqogFLg2qiVy4ujQWfd1+0In/DFGdp20+0nBR2+KO0rNH4VZvdnbK3FkIKqV2ssiAA4l0wY2PDWtcsWlb/jLN X-Gm-Message-State: AOJu0YymO1/IbN5x4P8UoAn8P1VqsGNiYZlIab5d2zXm75OF8feMklCI 2a7VQnovVJimjQt+inbjqXG0/ziQp2mYfIvc/Y819Hh9TISAaBE+3bw4gyrRWtkN0yAsp9j9NYb DwNd8P5nZBjdgnbi6d1NtJ0zylcr3FD0AW/OtM7ySu1EzH+ld41X2GA== X-Received: by 2002:ac2:42d8:0:b0:52b:b327:9c1c with SMTP id 2adb3069b0e04-52eb99d59e8mr2530503e87.62.1720591845786; Tue, 09 Jul 2024 23:10:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPbauTJ9QFnUJHiEZRXf8cKpY/Ph2hFs+oVaX3YRKAndRpINbHSQxy+Oi4OwHlpwQjmGnGuw== X-Received: by 2002:ac2:42d8:0:b0:52b:b327:9c1c with SMTP id 2adb3069b0e04-52eb99d59e8mr2530479e87.62.1720591845031; Tue, 09 Jul 2024 23:10:45 -0700 (PDT) Received: from redhat.com ([2a02:14f:174:f6ae:a6e3:8cbc:2cbd:b8ff]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4266b03feecsm101417875e9.10.2024.07.09.23.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 23:10:43 -0700 (PDT) Date: Wed, 10 Jul 2024 02:10:37 -0400 From: "Michael S. Tsirkin" To: Jason Wang Cc: Cindy Lu , Parav Pandit , Dragos Tatulea , "sgarzare@redhat.com" , "netdev@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , Leonardo Milleri Subject: Re: [PATCH v3 0/2] vdpa: support set mac address from vdpa tool Message-ID: <20240710020852-mutt-send-email-mst@kernel.org> References: <20240708064820.88955-1-lulu@redhat.com> <20240709084109-mutt-send-email-mst@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jul 10, 2024 at 11:05:48AM +0800, Jason Wang wrote: > On Tue, Jul 9, 2024 at 8:42 PM Michael S. Tsirkin wrote: > > > > On Tue, Jul 09, 2024 at 02:19:19PM +0800, Cindy Lu wrote: > > > On Tue, 9 Jul 2024 at 11:59, Parav Pandit wrote: > > > > > > > > Hi Cindy, > > > > > > > > > From: Cindy Lu > > > > > Sent: Monday, July 8, 2024 12:17 PM > > > > > > > > > > Add support for setting the MAC address using the VDPA tool. > > > > > This feature will allow setting the MAC address using the VDPA tool. > > > > > For example, in vdpa_sim_net, the implementation sets the MAC address to > > > > > the config space. However, for other drivers, they can implement their own > > > > > function, not limited to the config space. > > > > > > > > > > Changelog v2 > > > > > - Changed the function name to prevent misunderstanding > > > > > - Added check for blk device > > > > > - Addressed the comments > > > > > Changelog v3 > > > > > - Split the function of the net device from vdpa_nl_cmd_dev_attr_set_doit > > > > > - Add a lock for the network device's dev_set_attr operation > > > > > - Address the comments > > > > > > > > > > Cindy Lu (2): > > > > > vdpa: support set mac address from vdpa tool > > > > > vdpa_sim_net: Add the support of set mac address > > > > > > > > > > drivers/vdpa/vdpa.c | 81 ++++++++++++++++++++++++++++ > > > > > drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 19 ++++++- > > > > > include/linux/vdpa.h | 9 ++++ > > > > > include/uapi/linux/vdpa.h | 1 + > > > > > 4 files changed, 109 insertions(+), 1 deletion(-) > > > > > > > > > > -- > > > > > 2.45.0 > > > > > > > > Mlx5 device already allows setting the mac and mtu during the vdpa device creation time. > > > > Once the vdpa device is created, it binds to vdpa bus and other driver vhost_vdpa etc bind to it. > > > > So there was no good reason in the past to support explicit config after device add complicate the flow for synchronizing this. > > > > > > > > The user who wants a device with new attributes, as well destroy and recreate the vdpa device with new desired attributes. > > > > > > > > vdpa_sim_net can also be extended for similar way when adding the vdpa device. > > > > > > > > Have you considered using the existing tool and kernel in place since 2021? > > > > Such as commit d8ca2fa5be1. > > > > > > > > An example of it is, > > > > $ vdpa dev add name bar mgmtdev vdpasim_net mac 00:11:22:33:44:55 mtu 9000 > > > > > > > Hi Parav > > > Really thanks for your comments. The reason for adding this function > > > is to support Kubevirt. > > > the problem we meet is that kubevirt chooses one random vdpa device > > > from the pool and we don't know which one it going to pick. That means > > > we can't get to know the Mac address before it is created. So we plan > > > to have this function to change the mac address after it is created > > > Thanks > > > cindy > > > > Well you will need to change kubevirt to teach it to set > > mac address, right? > > That's the plan. Adding Leonardo. > > Thanks So given you are going to change kubevirt, can we change it to create devices as needed with the existing API? > > > > -- > > MST > >