lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <72e24344-2be4-48e5-b29f-7564fae3b15c@digitalocean.com>
Date: Wed, 4 Sep 2024 09:14:48 -0500
From: Carlos Bilbao <cbilbao@...italocean.com>
To: "Nelson, Shannon" <shannon.nelson@....com>,
 Carlos Bilbao <carlos.bilbao.osdev@...il.com>, dtatulea@...dia.com,
 mst@...hat.com, jasowang@...hat.com, sashal@...nel.org,
 alvaro.karsz@...id-run.com, christophe.jaillet@...adoo.fr,
 steven.sistare@...cle.com
Cc: bilbao@...edu, xuanzhuo@...ux.alibaba.com, johnah.palmer@...cle.com,
 eperezma@...hat.com, cratiu@...dia.com, virtualization@...ts.linux.dev,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] vdpa/mlx5: Set speed and duplex of vDPA devices to
 UNKNOWN

Hello Nelson,

On 9/3/24 12:37 PM, Nelson, Shannon wrote:
> On 9/3/2024 10:15 AM, Carlos Bilbao wrote:
>> From: Carlos Bilbao <cbilbao@...italocean.com>
>>
>> Initialize the speed and duplex fields in virtio_net_config to UNKNOWN.
>> This is needed because mlx5_vdpa vDPA devicess currently do not support the
>> VIRTIO_NET_F_SPEED_DUPLEX feature which reports speed and duplex. Add
>> needed helper cpu_to_mlx5vdpa32() to convert endianness of speed.
>>
>> Signed-off-by: Carlos Bilbao <cbilbao@...italocean.com>
>> Reviewed-by: Dragos Tatulea <dtatulea@...dia.com>
>> ---
>>   drivers/vdpa/mlx5/net/mlx5_vnet.c | 12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
>> index b56aae3f7be3..5fce6d62af4f 100644
>> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
>> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
>> @@ -173,6 +173,11 @@ static __virtio16 cpu_to_mlx5vdpa16(struct mlx5_vdpa_dev *mvdev, u16 val)
>>          return __cpu_to_virtio16(mlx5_vdpa_is_little_endian(mvdev), val);
>>   }
>>
>> +static __virtio32 cpu_to_mlx5vdpa32(struct mlx5_vdpa_dev *mvdev, u32 val)
>> +{
>> +    return __cpu_to_virtio32(mlx5_vdpa_is_little_endian(mvdev), val);
>
> I hate picking at little things like this, but this should be a tab rather than 4 spaces.
>

Correct, thanks, will fix in v3.


> sln
>
>
>> +}
>> +
>>   static u16 ctrl_vq_idx(struct mlx5_vdpa_dev *mvdev)
>>   {
>>          if (!(mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_MQ)))
>> @@ -3433,6 +3438,13 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name,
>>          init_rwsem(&ndev->reslock);
>>          config = &ndev->config;
>>
>> +       /*
>> +        * mlx5_vdpa vDPA devices currently don't support reporting or
>> +        * setting the speed or duplex.
>> +        */
>> +       config->speed  = cpu_to_mlx5vdpa32(mvdev, SPEED_UNKNOWN);
>> +       config->duplex = DUPLEX_UNKNOWN;
>> +
>>          if (add_config->mask & BIT_ULL(VDPA_ATTR_DEV_NET_CFG_MTU)) {
>>                  err = config_func_mtu(mdev, add_config->net.mtu);
>>                  if (err)
>> -- 
>> 2.34.1
>>

Thanks, Carlos


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ