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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <89652b98-65a8-4a97-a2e2-6c36acf7c663@gmail.com>
Date: Mon, 9 Dec 2024 23:03:04 +0200
From: Tariq Toukan <ttoukan.linux@...il.com>
To: Jakub Kicinski <kuba@...nel.org>, Tariq Toukan <tariqt@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>,
 Eric Dumazet <edumazet@...gle.com>, Andrew Lunn <andrew+netdev@...n.ch>,
 Leon Romanovsky <leonro@...dia.com>, netdev@...r.kernel.org,
 Saeed Mahameed <saeedm@...dia.com>, Gal Pressman <gal@...dia.com>,
 linux-rdma@...r.kernel.org, Carolina Jubran <cjubran@...dia.com>,
 Cosmin Ratiu <cratiu@...dia.com>, Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH net-next V5 07/11] devlink: Extend devlink rate API with
 traffic classes bandwidth management



On 07/12/2024 4:10, Jakub Kicinski wrote:
> On Thu, 5 Dec 2024 00:09:27 +0200 Tariq Toukan wrote:
>> +          min: 0
>> +          max: 100
> 
> Are full percentage points sufficient granularity?
> 

Yes, we think so.

>> +	if (!tb[DEVLINK_ATTR_RATE_TC_INDEX]) {
> 
> NL_SET_ERR_ATTR_MISS()
> 
> Please limit the string messages where error can be expressed in
> machine readable form.
> 

I'll fix.

>> +		NL_SET_ERR_MSG(extack, "Traffic class index is expected");
>> +		return -EINVAL;
>> +	}
>> +
>> +	tc_index = nla_get_u8(tb[DEVLINK_ATTR_RATE_TC_INDEX]);
>> +
>> +	if (tc_index >= IEEE_8021QAZ_MAX_TCS) {
> 
> This can't be enforced by the policy?
> 

If we enforce by policy we need to use the constant 7, not the macro 
IEEE_8021QAZ_MAX_TCS-1.
I'll keep it.

>> +		NL_SET_ERR_MSG_FMT(extack,
>> +				   "Provided traffic class index (%u) exceeds the maximum allowed value (%u)",
>> +				   tc_index, IEEE_8021QAZ_MAX_TCS - 1);
>> +		return -EINVAL;
>> +	}
>> +
>> +	if (!tb[DEVLINK_ATTR_RATE_TC_BW]) {
>> +		NL_SET_ERR_MSG(extack, "Traffic class bandwidth is expected");
>> +		return -EINVAL;
>> +	}
>> +
>> +	if (test_and_set_bit(tc_index, bitmap)) {
>> +		NL_SET_ERR_MSG(extack, "Duplicate traffic class index specified");
> 
> always try to point to attr that caused the issue
> 

I'll fix.

>> +		return -EINVAL;
>> +	}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ