Re: [PATCH iwl-next v2 4/5] iavf: Add devlink port function rate API support

Zhang, Xuejun
2023-08-09T18:43:36Z

On 8/8/2023 1:49 PM, Simon Horman wrote:
> On Tue, Aug 08, 2023 at 09:57:33AM +0800, Wenjun Wu wrote:
>> From: Jun Zhang <xuejun.zhang@intel.com>
>>
>> To allow user to configure queue based parameters, devlink port function
>> rate api functions are added for setting node tx_max and tx_share
>> parameters.
>>
>> iavf rate tree with root node and queue nodes is created and registered
>> with devlink rate when iavf adapter is configured.
>>
>> Signed-off-by: Jun Zhang <xuejun.zhang@intel.com>
> ...
>
>> +/**
>> + * iavf_update_queue_tx_max - sets tx max parameter
>> + * @adapter: iavf adapter struct instance
>> + * @node: iavf rate node struct instance
>> + * @bw: bandwidth in bytes per second
>> + * @extack: extended netdev ack structure
>> + *
>> + * This function sets max BW limit.
>> + */
>> +static int iavf_update_queue_tx_max(struct iavf_adapter *adapter,
>> + struct iavf_dev_rate_node *node,
>> + u64 bw, struct netlink_ext_ack *extack)
>> +{
>> + /* Keep in kbps */
>> + node->tx_max_temp = div_u64(bw, IAVF_RATE_DIV_FACTOR);
>> + if (ADV_LINK_SUPPORT(adapter)) {
>> + if (node->tx_max_temp / 1000 > adapter->link_speed_mbps)
>> + return -EINVAL;
>> + }
>> +
>> + node->tx_update_flag |= IAVF_FLAG_TX_MAX_UPDATED;
>> +
>> + return iavf_check_update_config(adapter, node);
>> +}
>> +
>> +/**
>> + * iavf_devlink_rate_node_tx_max_set - devlink_rate API for setting tx max
>> + * @rate_node: devlink rate struct instance
> Hi Jun Zhang,
>
> Please describe all the parameters of iavf_devlink_rate_node_tx_max_set
> in it's kernel doc.
>
> ./scripts/kernel-doc -none is your friend here.

Thanks.

As this function is an implementation of Kernel API. To be in sync w/
kernel api definition documentation, will omit the function description
here.

>> + *
>> + * This function implements rate_node_tx_max_set function of devlink_ops
>> + */
>> +static int iavf_devlink_rate_node_tx_max_set(struct devlink_rate *rate_node,
>> + void *priv, u64 tx_max,
>> + struct netlink_ext_ack *extack)
> ...
>