xref: /freebsd/sys/dev/irdma/irdma_ws.h (revision 5b5f7d0e77a9eee73eb5d596f43aef4e1a3674d8)
1cdcd52d4SBartosz Sobczak /*-
2cdcd52d4SBartosz Sobczak  * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB
3cdcd52d4SBartosz Sobczak  *
4*5b5f7d0eSBartosz Sobczak  * Copyright (c) 2015 - 2023 Intel Corporation
5cdcd52d4SBartosz Sobczak  *
6cdcd52d4SBartosz Sobczak  * This software is available to you under a choice of one of two
7cdcd52d4SBartosz Sobczak  * licenses.  You may choose to be licensed under the terms of the GNU
8cdcd52d4SBartosz Sobczak  * General Public License (GPL) Version 2, available from the file
9cdcd52d4SBartosz Sobczak  * COPYING in the main directory of this source tree, or the
10cdcd52d4SBartosz Sobczak  * OpenFabrics.org BSD license below:
11cdcd52d4SBartosz Sobczak  *
12cdcd52d4SBartosz Sobczak  *   Redistribution and use in source and binary forms, with or
13cdcd52d4SBartosz Sobczak  *   without modification, are permitted provided that the following
14cdcd52d4SBartosz Sobczak  *   conditions are met:
15cdcd52d4SBartosz Sobczak  *
16cdcd52d4SBartosz Sobczak  *    - Redistributions of source code must retain the above
17cdcd52d4SBartosz Sobczak  *	copyright notice, this list of conditions and the following
18cdcd52d4SBartosz Sobczak  *	disclaimer.
19cdcd52d4SBartosz Sobczak  *
20cdcd52d4SBartosz Sobczak  *    - Redistributions in binary form must reproduce the above
21cdcd52d4SBartosz Sobczak  *	copyright notice, this list of conditions and the following
22cdcd52d4SBartosz Sobczak  *	disclaimer in the documentation and/or other materials
23cdcd52d4SBartosz Sobczak  *	provided with the distribution.
24cdcd52d4SBartosz Sobczak  *
25cdcd52d4SBartosz Sobczak  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26cdcd52d4SBartosz Sobczak  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27cdcd52d4SBartosz Sobczak  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28cdcd52d4SBartosz Sobczak  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29cdcd52d4SBartosz Sobczak  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30cdcd52d4SBartosz Sobczak  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31cdcd52d4SBartosz Sobczak  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32cdcd52d4SBartosz Sobczak  * SOFTWARE.
33cdcd52d4SBartosz Sobczak  */
34cdcd52d4SBartosz Sobczak 
35cdcd52d4SBartosz Sobczak #ifndef IRDMA_WS_H
36cdcd52d4SBartosz Sobczak #define IRDMA_WS_H
37cdcd52d4SBartosz Sobczak 
38cdcd52d4SBartosz Sobczak #include "osdep.h"
39cdcd52d4SBartosz Sobczak 
40cdcd52d4SBartosz Sobczak enum irdma_ws_node_type {
41cdcd52d4SBartosz Sobczak 	WS_NODE_TYPE_PARENT,
42cdcd52d4SBartosz Sobczak 	WS_NODE_TYPE_LEAF,
43cdcd52d4SBartosz Sobczak };
44cdcd52d4SBartosz Sobczak 
45cdcd52d4SBartosz Sobczak enum irdma_ws_match_type {
46cdcd52d4SBartosz Sobczak 	WS_MATCH_TYPE_VSI,
47cdcd52d4SBartosz Sobczak 	WS_MATCH_TYPE_TC,
48cdcd52d4SBartosz Sobczak };
49cdcd52d4SBartosz Sobczak 
50cdcd52d4SBartosz Sobczak struct irdma_ws_node {
51cdcd52d4SBartosz Sobczak 	struct list_head siblings;
52cdcd52d4SBartosz Sobczak 	struct list_head child_list_head;
53cdcd52d4SBartosz Sobczak 	struct irdma_ws_node *parent;
54cdcd52d4SBartosz Sobczak 	u32 l2_sched_node_id;
55cdcd52d4SBartosz Sobczak 	u16 index;
56cdcd52d4SBartosz Sobczak 	u16 qs_handle;
57cdcd52d4SBartosz Sobczak 	u16 vsi_index;
58cdcd52d4SBartosz Sobczak 	u8 traffic_class;
59cdcd52d4SBartosz Sobczak 	u8 user_pri;
60cdcd52d4SBartosz Sobczak 	u8 rel_bw;
61cdcd52d4SBartosz Sobczak 	u8 abstraction_layer; /* used for splitting a TC */
62cdcd52d4SBartosz Sobczak 	u8 prio_type;
63cdcd52d4SBartosz Sobczak 	bool type_leaf:1;
64cdcd52d4SBartosz Sobczak 	bool enable:1;
65cdcd52d4SBartosz Sobczak };
66cdcd52d4SBartosz Sobczak 
67cdcd52d4SBartosz Sobczak struct irdma_sc_vsi;
68cdcd52d4SBartosz Sobczak int irdma_ws_add(struct irdma_sc_vsi *vsi, u8 user_pri);
69cdcd52d4SBartosz Sobczak void irdma_ws_remove(struct irdma_sc_vsi *vsi, u8 user_pri);
70cdcd52d4SBartosz Sobczak void irdma_ws_reset(struct irdma_sc_vsi *vsi);
71cdcd52d4SBartosz Sobczak 
72cdcd52d4SBartosz Sobczak #endif /* IRDMA_WS_H */
73