From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DEC81A4F28 for ; Wed, 28 Aug 2024 17:28:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724866094; cv=none; b=TZObSxapG0r0hBJaDwzg3Y60uK/HMoziDb0KhNF2D/znXSRTboSlW5fe/YoVwyw2yEX3IHzWLpuGSmU4ipmlAOJP3H6ibWzLV69F3UM9GLkfZrQvaqXzqNLJ2SwQpBYSRxZdPqyA5pSXOJ/TgEq+J7kMFjlV/inIeeI2gkF67a8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724866094; c=relaxed/simple; bh=HypgDgtB4ct/OuJkz4CzqDuTTpFOG82yJbB3Gp9Nl3A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gYWjZQpPBtqVAAGviRqftWlVoRI4+8UDcKS040qRqPrnI/cHNgWQoAOXAw4S94EOpR12HBge07mv7weGbQ2PG7l+Hep7TYFbDWoM1Az7K3X6Hne5KEUMEOadE3iUaOqchOMzlNpNvpHwrao2l9CH10sp7ZsF/Y5UqlEVLIwdssg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=digitalocean.com; spf=pass smtp.mailfrom=digitalocean.com; dkim=pass (1024-bit key) header.d=digitalocean.com header.i=@digitalocean.com header.b=YrieHuyL; arc=none smtp.client-ip=209.85.128.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=digitalocean.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digitalocean.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digitalocean.com header.i=@digitalocean.com header.b="YrieHuyL" Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-68d30057ae9so61676957b3.1 for ; Wed, 28 Aug 2024 10:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalocean.com; s=google; t=1724866092; x=1725470892; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zCPXRj4O3bcsketV9hnxl4fQbKxvadzaMLv4xTGbmvw=; b=YrieHuyLcaRqzVQYQoFYLCTswDKpIhgqW+kiyQ4rLa3Xa5DyiG5ftqU35tnxwzWHqV zl1BAx2Gv8ZgHhewgd14S5s1wtRw4q/H15nm/Y1mRq0Wt8eT5qG09aYYBwTjtuF8Rd9T EXMGNqv8w7Y+M36LSZJxoaNng7qxlLKZ6n5N0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724866092; x=1725470892; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zCPXRj4O3bcsketV9hnxl4fQbKxvadzaMLv4xTGbmvw=; b=DBlOuZf5NFyypUw4sjXfg1VKkGOlmnqwKLTHqybUSBN4XHqR+IBgZlxztgUv6VzRv1 jEga2FCtrOrjWHIXr9En8MSr1VWrzc8K4RWjrP/16hbIda/Ck7yS6UiW57lwPMMKjubV wqKdBxvQf0PFTJY6fmBXQq4TDtLQxfgBHjSf2h2jUJmTxm9dy01P4suW29lOXSHlKb10 Xn12v/GaBeoLPw4uc9cpOx+18QL8rEFy5McfYHwOUGu0wDRhCAxF42ysFlgME/1R9TBp OPJUaDaEGn6Yiv3uQg0/PoPnqq2Bdx7Dwir9FmhSFW6nlcx6wDShnigxVXG0vDsNbTCw rhbw== X-Forwarded-Encrypted: i=1; AJvYcCWlm4ibJ+ntV+RVy5gXowzmd7zdMxl0HCt2Li4wTipgNNZbAXEmBtKj9kquRR6X3pg/iM8PVpYRf/5eUD4=@vger.kernel.org X-Gm-Message-State: AOJu0YyOzgM+tvymGlG6H24+3AQ9WrXVF5FQsJdqHWCgkj3QbJMQaAsi lUWKObTTgLA5VxRI/jLiHaQ4IvmhXgEifLm9egV6y6RngFpGnCdOfZ2iFQURNTo= X-Google-Smtp-Source: AGHT+IFPC41Qak2gZ0YGJ2D7BiYZJ3IUJn9Ef3OAyW792KU6hAe4yKyakK/6d00Omzjp9FW2G84t4Q== X-Received: by 2002:a05:690c:6512:b0:64a:4728:ef8 with SMTP id 00721157ae682-6d277f51e62mr651667b3.44.1724866092130; Wed, 28 Aug 2024 10:28:12 -0700 (PDT) Received: from ?IPV6:2603:8080:7400:36da:b4f6:16b8:9118:2c1a? ([2603:8080:7400:36da:b4f6:16b8:9118:2c1a]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6c39de41cb8sm24217897b3.116.2024.08.28.10.28.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Aug 2024 10:28:11 -0700 (PDT) Message-ID: <41a2a533-549e-4f45-9d8d-68b5ef484b05@digitalocean.com> Date: Wed, 28 Aug 2024 12:28:09 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] Why is set_config not supported in mlx5_vnet? To: Dragos Tatulea , Jason Wang Cc: Andrew Lunn , mst@redhat.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, eperezma@redhat.com, sashal@kernel.org, yuehaibing@huawei.com, steven.sistare@oracle.com References: <33feec1a-2c5d-46eb-8d66-baa802130d7f@digitalocean.com> <24dbecec-d114-4150-87df-33dfbacaec54@nvidia.com> Content-Language: en-US From: Carlos Bilbao In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hello, On 8/27/24 11:54 AM, Dragos Tatulea wrote: > > On 27.08.24 04:03, Jason Wang wrote: >> On Tue, Aug 27, 2024 at 12:11 AM Dragos Tatulea wrote: >>> >>> On 26.08.24 16:24, Andrew Lunn wrote: >>>> On Mon, Aug 26, 2024 at 11:06:09AM +0200, Dragos Tatulea wrote: >>>>> >>>>> On 23.08.24 18:54, Carlos Bilbao wrote: >>>>>> Hello, >>>>>> >>>>>> I'm debugging my vDPA setup, and when using ioctl to retrieve the >>>>>> configuration, I noticed that it's running in half duplex mode: >>>>>> >>>>>> Configuration data (24 bytes): >>>>>> MAC address: (Mac address) >>>>>> Status: 0x0001 >>>>>> Max virtqueue pairs: 8 >>>>>> MTU: 1500 >>>>>> Speed: 0 Mb >>>>>> Duplex: Half Duplex >>>>>> RSS max key size: 0 >>>>>> RSS max indirection table length: 0 >>>>>> Supported hash types: 0x00000000 >>>>>> >>>>>> I believe this might be contributing to the underperformance of vDPA. >>>>> mlx5_vdpa vDPA devicess currently do not support the VIRTIO_NET_F_SPEED_DUPLEX >>>>> feature which reports speed and duplex. You can check the state on the >>>>> PF. >>>> Then it should probably report DUPLEX_UNKNOWN. >>>> >>>> The speed of 0 also suggests SPEED_UNKNOWN is not being returned. So >>>> this just looks buggy in general. >>>> >>> The virtio spec doesn't mention what those values should be when >>> VIRTIO_NET_F_SPEED_DUPLEX is not supported. >>> >>> Jason, should vdpa_dev_net_config_fill() initialize the speed/duplex >>> fields to SPEED/DUPLEX_UNKNOWN instead of 0? >> Spec said >> >> """ >> The following two fields, speed and duplex, only exist if >> VIRTIO_NET_F_SPEED_DUPLEX is set. >> """ >> >> So my understanding is that it is undefined behaviour, and those >> fields seems useless before feature negotiation. For safety, it might >> be better to initialize them as UNKOWN. >> > After a closer look my statement doesn't make sense: the device will copy > the virtio_net_config bytes on top. > > The solution is to initialize these fields to UNKNOWN in the driver. Will send > a patch to fix this. With Dragos' permission, I'm sending a first draft of this now. > > Thanks, > Dragos Thanks, Carlos