]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/infiniband/sw/rdmavt/qp.c
IB/rdmavt: Add queue pair function stubs
[mirror_ubuntu-artful-kernel.git] / drivers / infiniband / sw / rdmavt / qp.c
CommitLineData
b518d3e6
DD
1/*
2 * Copyright(c) 2015 Intel Corporation.
3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
6 *
7 * GPL LICENSE SUMMARY
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * BSD LICENSE
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
22 * are met:
23 *
24 * - Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * - Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in
28 * the documentation and/or other materials provided with the
29 * distribution.
30 * - Neither the name of Intel Corporation nor the names of its
31 * contributors may be used to endorse or promote products derived
32 * from this software without specific prior written permission.
33 *
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 *
46 */
47
48#include "qp.h"
49
50/**
51 * rvt_create_qp - create a queue pair for a device
52 * @ibpd: the protection domain who's device we create the queue pair for
53 * @init_attr: the attributes of the queue pair
54 * @udata: user data for libibverbs.so
55 *
56 * Returns the queue pair on success, otherwise returns an errno.
57 *
58 * Called by the ib_create_qp() core verbs function.
59 */
60struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
61 struct ib_qp_init_attr *init_attr,
62 struct ib_udata *udata)
63{
64 /*
65 * Queue pair creation is mostly an rvt issue. However, drivers have
66 * their own unique idea of what queue pare numbers mean. For instance
67 * there is a reserved range for PSM.
68 *
69 * VI-DRIVER-API: make_qpn()
70 * Returns a valid QPN for verbs to use
71 */
72 return ERR_PTR(-EOPNOTSUPP);
73}
74
75/**
76 * qib_modify_qp - modify the attributes of a queue pair
77 * @ibqp: the queue pair who's attributes we're modifying
78 * @attr: the new attributes
79 * @attr_mask: the mask of attributes to modify
80 * @udata: user data for libibverbs.so
81 *
82 * Returns 0 on success, otherwise returns an errno.
83 */
84int rvt_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
85 int attr_mask, struct ib_udata *udata)
86{
87 /*
88 * VT-DRIVER-API: qp_mtu()
89 * OPA devices have a per VL MTU the driver has a mapping of IB SL to SC
90 * to VL and the mapping table of MTUs per VL. This is not something
91 * that IB has and should not live in the rvt.
92 */
93 return -EOPNOTSUPP;
94}
95
96/**
97 * rvt_destroy_qp - destroy a queue pair
98 * @ibqp: the queue pair to destroy
99 *
100 * Returns 0 on success.
101 *
102 * Note that this can be called while the QP is actively sending or
103 * receiving!
104 */
105int rvt_destroy_qp(struct ib_qp *ibqp)
106{
107 /*
108 * VT-DRIVER-API: qp_flush()
109 * Driver provies a mechanism to flush and wait for that flush to
110 * finish.
111 */
112
113 return -EOPNOTSUPP;
114}
115
116int rvt_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
117 int attr_mask, struct ib_qp_init_attr *init_attr)
118{
119 return -EOPNOTSUPP;
120}