/* * Copyright (c) 2012 - 2019 Intel Corporation. All rights reserved. * Copyright (c) 2006 - 2012 QLogic Corporation. * All rights reserved. * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <linux/err.h> #include <linux/vmalloc.h> #include <rdma/rdma_vt.h> #ifdef CONFIG_DEBUG_FS #include <linux/seq_file.h> #endif #include "qib.h" static inline unsigned mk_qpn(struct rvt_qpn_table *qpt, struct rvt_qpn_map *map, unsigned off) { … } static inline unsigned find_next_offset(struct rvt_qpn_table *qpt, struct rvt_qpn_map *map, unsigned off, unsigned n, u16 qpt_mask) { … } const struct rvt_operation_params qib_post_parms[RVT_OPERATION_MAX] = …; static void get_map_page(struct rvt_qpn_table *qpt, struct rvt_qpn_map *map) { … } /* * Allocate the next available QPN or * zero/one for QP type IB_QPT_SMI/IB_QPT_GSI. */ int qib_alloc_qpn(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt, enum ib_qp_type type, u32 port) { … } /* * qib_free_all_qps - check for QPs still in use */ unsigned qib_free_all_qps(struct rvt_dev_info *rdi) { … } void qib_notify_qp_reset(struct rvt_qp *qp) { … } void qib_notify_error_qp(struct rvt_qp *qp) { … } static int mtu_to_enum(u32 mtu) { … } int qib_get_pmtu_from_attr(struct rvt_dev_info *rdi, struct rvt_qp *qp, struct ib_qp_attr *attr) { … } int qib_mtu_to_path_mtu(u32 mtu) { … } u32 qib_mtu_from_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp, u32 pmtu) { … } void *qib_qp_priv_alloc(struct rvt_dev_info *rdi, struct rvt_qp *qp) { … } void qib_qp_priv_free(struct rvt_dev_info *rdi, struct rvt_qp *qp) { … } void qib_stop_send_queue(struct rvt_qp *qp) { … } void qib_quiesce_qp(struct rvt_qp *qp) { … } void qib_flush_qp_waiters(struct rvt_qp *qp) { … } /** * qib_check_send_wqe - validate wr/wqe * @qp: The qp * @wqe: The built wqe * @call_send: Determine if the send should be posted or scheduled * * Returns 0 on success, -EINVAL on failure */ int qib_check_send_wqe(struct rvt_qp *qp, struct rvt_swqe *wqe, bool *call_send) { … } #ifdef CONFIG_DEBUG_FS static const char * const qp_type_str[] = …; /** * qib_qp_iter_print - print information to seq_file * @s: the seq_file * @iter: the iterator */ void qib_qp_iter_print(struct seq_file *s, struct rvt_qp_iter *iter) { … } #endif