Lines Matching +full:mailbox +full:-
16 * - Redistributions of source code must retain the above
20 * - Redistributions in binary form must reproduce the above
58 __be16 max_bw_units; /* 3-100Mbps, 4-1Gbps, other values - reserved */
87 struct mlx4_cmd_mailbox *mailbox; in mlx4_SET_PORT_PRIO2TC() local
93 mailbox = mlx4_alloc_cmd_mailbox(dev); in mlx4_SET_PORT_PRIO2TC()
94 if (IS_ERR(mailbox)) in mlx4_SET_PORT_PRIO2TC()
95 return PTR_ERR(mailbox); in mlx4_SET_PORT_PRIO2TC()
97 context = mailbox->buf; in mlx4_SET_PORT_PRIO2TC()
100 context->prio2tc[i >> 1] = prio2tc[i] << 4 | prio2tc[i + 1]; in mlx4_SET_PORT_PRIO2TC()
103 err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, in mlx4_SET_PORT_PRIO2TC()
106 mlx4_free_cmd_mailbox(dev, mailbox); in mlx4_SET_PORT_PRIO2TC()
114 struct mlx4_cmd_mailbox *mailbox; in mlx4_SET_PORT_SCHEDULER() local
120 mailbox = mlx4_alloc_cmd_mailbox(dev); in mlx4_SET_PORT_SCHEDULER()
121 if (IS_ERR(mailbox)) in mlx4_SET_PORT_SCHEDULER()
122 return PTR_ERR(mailbox); in mlx4_SET_PORT_SCHEDULER()
124 context = mailbox->buf; in mlx4_SET_PORT_SCHEDULER()
127 struct mlx4_port_scheduler_tc_cfg_be *tc = &context->tc[i]; in mlx4_SET_PORT_SCHEDULER()
133 tc->max_bw_units = in mlx4_SET_PORT_SCHEDULER()
137 tc->max_bw_units = in mlx4_SET_PORT_SCHEDULER()
140 tc->max_bw_value = htons(r); in mlx4_SET_PORT_SCHEDULER()
142 tc->max_bw_value = htons(MLX4_RATELIMIT_DEFAULT); in mlx4_SET_PORT_SCHEDULER()
143 tc->max_bw_units = htons(MLX4_RATELIMIT_1G_UNITS); in mlx4_SET_PORT_SCHEDULER()
146 tc->pg = htons(pg[i]); in mlx4_SET_PORT_SCHEDULER()
147 tc->bw_precentage = htons(tc_tx_bw[i]); in mlx4_SET_PORT_SCHEDULER()
151 err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, in mlx4_SET_PORT_SCHEDULER()
154 mlx4_free_cmd_mailbox(dev, mailbox); in mlx4_SET_PORT_SCHEDULER()
164 struct mlx4_cmd_mailbox *mailbox; in mlx4_ALLOCATE_VPP_get() local
167 mailbox = mlx4_alloc_cmd_mailbox(dev); in mlx4_ALLOCATE_VPP_get()
168 if (IS_ERR(mailbox)) in mlx4_ALLOCATE_VPP_get()
169 return PTR_ERR(mailbox); in mlx4_ALLOCATE_VPP_get()
171 out_param = mailbox->buf; in mlx4_ALLOCATE_VPP_get()
173 err = mlx4_cmd_box(dev, 0, mailbox->dma, port, in mlx4_ALLOCATE_VPP_get()
182 *available_vpp = (u16)be32_to_cpu(out_param->available_vpp); in mlx4_ALLOCATE_VPP_get()
185 vpp_p_up[i] = (u8)be32_to_cpu(out_param->vpp_p_up[i]); in mlx4_ALLOCATE_VPP_get()
188 mlx4_free_cmd_mailbox(dev, mailbox); in mlx4_ALLOCATE_VPP_get()
198 struct mlx4_cmd_mailbox *mailbox; in mlx4_ALLOCATE_VPP_set() local
201 mailbox = mlx4_alloc_cmd_mailbox(dev); in mlx4_ALLOCATE_VPP_set()
202 if (IS_ERR(mailbox)) in mlx4_ALLOCATE_VPP_set()
203 return PTR_ERR(mailbox); in mlx4_ALLOCATE_VPP_set()
205 in_param = mailbox->buf; in mlx4_ALLOCATE_VPP_set()
208 in_param->vpp_p_up[i] = cpu_to_be32(vpp_p_up[i]); in mlx4_ALLOCATE_VPP_set()
210 err = mlx4_cmd(dev, mailbox->dma, port, in mlx4_ALLOCATE_VPP_set()
216 mlx4_free_cmd_mailbox(dev, mailbox); in mlx4_ALLOCATE_VPP_set()
226 struct mlx4_cmd_mailbox *mailbox; in mlx4_SET_VPORT_QOS_get() local
229 mailbox = mlx4_alloc_cmd_mailbox(dev); in mlx4_SET_VPORT_QOS_get()
230 if (IS_ERR(mailbox)) in mlx4_SET_VPORT_QOS_get()
231 return PTR_ERR(mailbox); in mlx4_SET_VPORT_QOS_get()
233 ctx = mailbox->buf; in mlx4_SET_VPORT_QOS_get()
235 err = mlx4_cmd_box(dev, 0, mailbox->dma, (vport << 8) | port, in mlx4_SET_VPORT_QOS_get()
244 out_param[i].bw_share = be32_to_cpu(ctx->qos_p_up[i].bw_share); in mlx4_SET_VPORT_QOS_get()
246 be32_to_cpu(ctx->qos_p_up[i].max_avg_bw); in mlx4_SET_VPORT_QOS_get()
248 !!(be32_to_cpu(ctx->qos_p_up[i].enable) & 31); in mlx4_SET_VPORT_QOS_get()
252 mlx4_free_cmd_mailbox(dev, mailbox); in mlx4_SET_VPORT_QOS_get()
263 struct mlx4_cmd_mailbox *mailbox; in mlx4_SET_VPORT_QOS_set() local
266 mailbox = mlx4_alloc_cmd_mailbox(dev); in mlx4_SET_VPORT_QOS_set()
267 if (IS_ERR(mailbox)) in mlx4_SET_VPORT_QOS_set()
268 return PTR_ERR(mailbox); in mlx4_SET_VPORT_QOS_set()
270 ctx = mailbox->buf; in mlx4_SET_VPORT_QOS_set()
273 ctx->qos_p_up[i].bw_share = cpu_to_be32(in_param[i].bw_share); in mlx4_SET_VPORT_QOS_set()
274 ctx->qos_p_up[i].max_avg_bw = in mlx4_SET_VPORT_QOS_set()
276 ctx->qos_p_up[i].enable = in mlx4_SET_VPORT_QOS_set()
280 err = mlx4_cmd(dev, mailbox->dma, (vport << 8) | port, in mlx4_SET_VPORT_QOS_set()
286 mlx4_free_cmd_mailbox(dev, mailbox); in mlx4_SET_VPORT_QOS_set()