From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Wenjun Wu <wenjun1.wu@intel.com>, <intel-wired-lan@lists.osuosl.org>
Cc: mitu.aggarwal@intel.com, qi.z.zhang@intel.com
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v1 1/5] virtchnl: support queue rate limit and quanta size configuration
Date: Mon, 31 Jul 2023 15:22:45 -0700 [thread overview]
Message-ID: <ef452117-09b3-dc17-588a-4ff1f2e4d470@intel.com> (raw)
In-Reply-To: <20230727021021.961119-2-wenjun1.wu@intel.com>
On 7/26/2023 7:10 PM, Wenjun Wu wrote:
> This patch adds new virtchnl opcodes and structures for rate limit
> and quanta size configuration, which include:
> 1. VIRTCHNL_OP_CONFIG_QUEUE_BW, to configure max bandwidth for each
> VF per queue.
> 2. VIRTCHNL_OP_CONFIG_QUANTA, to configure quanta size per queue.
> 3. VIRTCHNL_OP_GET_QOS_CAPS, VF queries current QoS configuration, such
> as enabled TCs, arbiter type, up2tc and bandwidth of VSI node. The
> configuration is previously set by DCB and PF, and now is the potential
> QoS capability of VF. VF can take it as reference to configure queue TC
> mapping.
>
> Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
> ---
> include/linux/avf/virtchnl.h | 113 +++++++++++++++++++++++++++++++++++
> 1 file changed, 113 insertions(+)
>
> diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h
> index c15221dcb75e..f1250ddd063d 100644
> --- a/include/linux/avf/virtchnl.h
> +++ b/include/linux/avf/virtchnl.h
> @@ -84,6 +84,9 @@ enum virtchnl_rx_hsplit {
> VIRTCHNL_RX_HSPLIT_SPLIT_SCTP = 8,
> };
>
> +enum virtchnl_bw_limit_type {
> + VIRTCHNL_BW_SHAPER = 0,
> +};
> /* END GENERIC DEFINES */
>
> /* Opcodes for VF-PF communication. These are placed in the v_opcode field
> @@ -145,6 +148,11 @@ enum virtchnl_ops {
> VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2 = 55,
> VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2 = 56,
> VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2 = 57,
> + /* opcode 57 - 65 are reserved */
> + VIRTCHNL_OP_GET_QOS_CAPS = 66,
> + /* opcode 68 through 111 are reserved */
> + VIRTCHNL_OP_CONFIG_QUEUE_BW = 112,
> + VIRTCHNL_OP_CONFIG_QUANTA = 113,
> VIRTCHNL_OP_MAX,
> };
>
> @@ -253,6 +261,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource);
> #define VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC BIT(26)
> #define VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF BIT(27)
> #define VIRTCHNL_VF_OFFLOAD_FDIR_PF BIT(28)
> +#define VIRTCHNL_VF_OFFLOAD_QOS BIT(29)
>
> #define VF_BASE_MODE_OFFLOADS (VIRTCHNL_VF_OFFLOAD_L2 | \
> VIRTCHNL_VF_OFFLOAD_VLAN | \
> @@ -1367,6 +1376,83 @@ struct virtchnl_fdir_del {
>
> VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_fdir_del);
>
> +struct virtchnl_shaper_bw {
> + /* Unit is Kbps */
> + u32 committed;
> + u32 peak;
> +};
> +
> +VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_shaper_bw);
> +
> +/* VIRTCHNL_OP_GET_QOS_CAPS
> + * VF sends this message to get its QoS Caps, such as
> + * TC number, Arbiter and Bandwidth.
> + */
> +struct virtchnl_qos_cap_elem {
> + u8 tc_num;
> + u8 tc_prio;
> +#define VIRTCHNL_ABITER_STRICT 0
> +#define VIRTCHNL_ABITER_ETS 2
> + u8 arbiter;
> +#define VIRTCHNL_STRICT_WEIGHT 1
> + u8 weight;
> + enum virtchnl_bw_limit_type type;
> + union {
> + struct virtchnl_shaper_bw shaper;
> + u8 pad2[32];
> + };
> +};
> +
> +VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_qos_cap_elem);
> +
> +struct virtchnl_qos_cap_list {
> + u16 vsi_id;
> + u16 num_elem;
> + struct virtchnl_qos_cap_elem cap[1];
> +};
If it's not too late to use a flex arrays, we should. Otherwise, this
should model after Olek's work [1].
Adding Olek in case he has input.
> +
> +VIRTCHNL_CHECK_STRUCT_LEN(44, virtchnl_qos_cap_list);
> +
> +/* VIRTCHNL_OP_CONFIG_QUEUE_BW */
> +struct virtchnl_queue_bw {
> + u16 queue_id;
> + u8 tc;
> + u8 pad;
> + struct virtchnl_shaper_bw shaper;
> +};
> +
> +VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_queue_bw);
> +
> +struct virtchnl_queues_bw_cfg {
> + u16 vsi_id;
> + u16 num_queues;
> + struct virtchnl_queue_bw cfg[1];
same here
> +};
> +
> +VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_queues_bw_cfg);
> +
> +enum virtchnl_queue_type {
> + VIRTCHNL_QUEUE_TYPE_TX = 0,
> + VIRTCHNL_QUEUE_TYPE_RX = 1,
> +};
> +
> +/* structure to specify a chunk of contiguous queues */
> +struct virtchnl_queue_chunk {
> + /* see enum virtchnl_queue_type */
> + s32 type;
> + u16 start_queue_id;
> + u16 num_queues;
> +};
> +
> +VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_queue_chunk);
> +
> +struct virtchnl_quanta_cfg {
> + u16 quanta_size;
> + struct virtchnl_queue_chunk queue_select;
> +};
> +
> +VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_quanta_cfg);
> +
> /**
> * virtchnl_vc_validate_vf_msg
> * @ver: Virtchnl version info
> @@ -1558,6 +1644,33 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,
> case VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2:
> valid_len = sizeof(struct virtchnl_vlan_setting);
> break;
> + case VIRTCHNL_OP_GET_QOS_CAPS:
> + break;
> + case VIRTCHNL_OP_CONFIG_QUEUE_BW:
> + valid_len = sizeof(struct virtchnl_queues_bw_cfg);
> + if (msglen >= valid_len) {
> + struct virtchnl_queues_bw_cfg *q_bw =
> + (struct virtchnl_queues_bw_cfg *)msg;
missing newline here.
> + if (q_bw->num_queues == 0) {
> + err_msg_format = true;
> + break;
> + }
> + valid_len += (q_bw->num_queues - 1) *
> + sizeof(q_bw->cfg[0]);
See referenced series for changes to this too.
> + }
> + break;
> + case VIRTCHNL_OP_CONFIG_QUANTA:
> + valid_len = sizeof(struct virtchnl_quanta_cfg);
> + if (msglen >= valid_len) {
> + struct virtchnl_quanta_cfg *q_quanta =
> + (struct virtchnl_quanta_cfg *)msg;
need newline
> + if (q_quanta->quanta_size == 0 ||
> + q_quanta->queue_select.num_queues == 0) {
> + err_msg_format = true;
> + break;
> + }
> + }
> + break;
> /* These are always errors coming from the VF. */
> case VIRTCHNL_OP_EVENT:
> case VIRTCHNL_OP_UNKNOWN:
[1]
https://lore.kernel.org/netdev/20230728155207.10042-1-aleksander.lobakin@intel.com/#t
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2023-07-31 22:22 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 2:10 [Intel-wired-lan] [PATCH iwl-next v1 0/5] iavf: Add devlink and devlink rate support Wenjun Wu
2023-07-27 2:10 ` [Intel-wired-lan] [PATCH iwl-next v1 1/5] virtchnl: support queue rate limit and quanta size configuration Wenjun Wu
2023-07-31 22:22 ` Tony Nguyen [this message]
2023-08-01 9:24 ` Wu, Wenjun1
2023-07-27 2:10 ` [Intel-wired-lan] [PATCH iwl-next v1 2/5] ice: Support VF " Wenjun Wu
2023-07-31 22:23 ` Tony Nguyen
2023-08-01 9:30 ` Wu, Wenjun1
2023-07-27 2:10 ` [Intel-wired-lan] [PATCH iwl-next v1 3/5] iavf: Add devlink and devlink port support Wenjun Wu
2023-07-27 2:10 ` [Intel-wired-lan] [PATCH iwl-next v1 4/5] iavf: Add devlink port function rate API support Wenjun Wu
2023-07-27 2:10 ` [Intel-wired-lan] [PATCH iwl-next v1 5/5] iavf: Add VIRTCHNL Opcodes Support for Queue bw Setting Wenjun Wu
2023-07-31 22:21 ` [Intel-wired-lan] [PATCH iwl-next v1 0/5] iavf: Add devlink and devlink rate support Tony Nguyen
2023-08-01 18:43 ` Zhang, Xuejun
2023-08-08 1:57 ` [Intel-wired-lan] [PATCH iwl-next v2 " Wenjun Wu
2023-08-08 1:57 ` [Intel-wired-lan] [PATCH iwl-next v2 1/5] virtchnl: support queue rate limit and quanta size configuration Wenjun Wu
2023-08-08 1:57 ` [Intel-wired-lan] [PATCH iwl-next v2 2/5] ice: Support VF " Wenjun Wu
2023-08-16 16:54 ` Brett Creeley
2023-08-08 1:57 ` [Intel-wired-lan] [PATCH iwl-next v2 3/5] iavf: Add devlink and devlink port support Wenjun Wu
2023-08-16 17:11 ` Brett Creeley
2023-08-08 1:57 ` [Intel-wired-lan] [PATCH iwl-next v2 4/5] iavf: Add devlink port function rate API support Wenjun Wu
2023-08-08 20:49 ` Simon Horman
2023-08-09 18:43 ` Zhang, Xuejun
2023-08-16 17:27 ` Brett Creeley
2023-08-08 1:57 ` [Intel-wired-lan] [PATCH iwl-next v2 5/5] iavf: Add VIRTCHNL Opcodes Support for Queue bw Setting Wenjun Wu
2023-08-08 20:54 ` Simon Horman
2023-08-09 18:44 ` Zhang, Xuejun
2023-08-16 17:32 ` Brett Creeley
2023-08-16 3:33 ` [Intel-wired-lan] [PATCH iwl-next v3 0/5] iavf: Add devlink and devlink rate support Wenjun Wu
2023-08-16 3:33 ` [Intel-wired-lan] [PATCH iwl-next v3 1/5] virtchnl: support queue rate limit and quanta size configuration Wenjun Wu
2023-08-16 3:33 ` [Intel-wired-lan] [PATCH iwl-next v3 2/5] ice: Support VF " Wenjun Wu
2023-08-16 3:33 ` [Intel-wired-lan] [PATCH iwl-next v3 3/5] iavf: Add devlink and devlink port support Wenjun Wu
2023-08-16 3:33 ` [Intel-wired-lan] [PATCH iwl-next v3 4/5] iavf: Add devlink port function rate API support Wenjun Wu
2023-08-16 3:33 ` [Intel-wired-lan] [PATCH iwl-next v3 5/5] iavf: Add VIRTCHNL Opcodes Support for Queue bw Setting Wenjun Wu
2023-08-16 9:14 ` Simon Horman
2023-08-22 3:39 ` [Intel-wired-lan] [PATCH iwl-next v4 0/5] iavf: Add devlink and devlink rate support Wenjun Wu
2023-08-22 3:39 ` [Intel-wired-lan] [PATCH iwl-next v4 1/5] virtchnl: support queue rate limit and quanta size configuration Wenjun Wu
2023-08-22 3:40 ` [Intel-wired-lan] [PATCH iwl-next v4 2/5] ice: Support VF " Wenjun Wu
2023-08-22 3:40 ` [Intel-wired-lan] [PATCH iwl-next v4 3/5] iavf: Add devlink and devlink port support Wenjun Wu
2023-08-22 3:40 ` [Intel-wired-lan] [PATCH iwl-next v4 4/5] iavf: Add devlink port function rate API support Wenjun Wu
2023-08-22 3:40 ` [Intel-wired-lan] [PATCH iwl-next v4 5/5] iavf: Add VIRTCHNL Opcodes Support for Queue bw Setting Wenjun Wu
2023-08-22 6:12 ` [Intel-wired-lan] [PATCH iwl-next v4 0/5] iavf: Add devlink and devlink rate support Jiri Pirko
2023-08-22 15:12 ` Jakub Kicinski
2023-08-22 15:34 ` [Intel-wired-lan] [PATCH iwl-next v4 0/5] iavf: Add devlink and devlink rate support' Jiri Pirko
2023-08-23 19:13 ` Zhang, Xuejun
2023-08-24 7:04 ` Jiri Pirko
2023-08-28 22:46 ` Zhang, Xuejun
2023-11-17 5:52 ` Zhang, Xuejun
2023-11-17 11:21 ` Jiri Pirko
2023-11-21 9:04 ` Paolo Abeni
2023-11-18 16:48 ` Jakub Kicinski
2023-11-22 22:19 ` Zhang, Xuejun
2023-11-23 3:22 ` Jakub Kicinski
2023-11-28 0:15 ` Zhang, Xuejun
2023-11-28 1:43 ` Jakub Kicinski
2023-12-14 20:29 ` Paolo Abeni
2023-12-15 1:46 ` Jakub Kicinski
2023-12-15 11:06 ` Paolo Abeni
2023-12-15 11:47 ` Paolo Abeni
2023-12-15 12:30 ` Jiri Pirko
2023-12-15 22:41 ` Jakub Kicinski
2023-12-18 20:12 ` Paolo Abeni
2023-12-18 21:33 ` Jakub Kicinski
2023-12-15 12:22 ` Jiri Pirko
2023-10-18 9:05 ` Paolo Abeni
2023-08-23 21:39 ` Zhang, Xuejun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ef452117-09b3-dc17-588a-4ff1f2e4d470@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=mitu.aggarwal@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=wenjun1.wu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.