linux/drivers/infiniband/ulp/ipoib/ipoib_cm.c

/*
 * Copyright (c) 2006 Mellanox Technologies. 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 <rdma/ib_cm.h>
#include <net/dst.h>
#include <net/icmp.h>
#include <linux/icmpv6.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/moduleparam.h>
#include <linux/sched/signal.h>
#include <linux/sched/mm.h>

#include "ipoib.h"

int ipoib_max_conn_qp =;

module_param_named(max_nonsrq_conn_qp, ipoib_max_conn_qp, int, 0444);
MODULE_PARM_DESC();

#ifdef CONFIG_INFINIBAND_IPOIB_DEBUG_DATA
static int data_debug_level;

module_param_named(cm_data_debug_level, data_debug_level, int, 0644);
MODULE_PARM_DESC();
#endif

#define IPOIB_CM_IETF_ID

#define IPOIB_CM_RX_UPDATE_TIME
#define IPOIB_CM_RX_TIMEOUT
#define IPOIB_CM_RX_DELAY
#define IPOIB_CM_RX_UPDATE_MASK

#define IPOIB_CM_RX_RESERVE

static struct ib_qp_attr ipoib_cm_err_attr =;

#define IPOIB_CM_RX_DRAIN_WRID

static struct ib_send_wr ipoib_cm_rx_drain_wr =;

static int ipoib_cm_tx_handler(struct ib_cm_id *cm_id,
			       const struct ib_cm_event *event);

static void ipoib_cm_dma_unmap_rx(struct ipoib_dev_priv *priv, int frags,
				  u64 mapping[IPOIB_CM_RX_SG])
{}

static int ipoib_cm_post_receive_srq(struct net_device *dev, int id)
{}

static int ipoib_cm_post_receive_nonsrq(struct net_device *dev,
					struct ipoib_cm_rx *rx,
					struct ib_recv_wr *wr,
					struct ib_sge *sge, int id)
{}

static struct sk_buff *ipoib_cm_alloc_rx_skb(struct net_device *dev,
					     struct ipoib_cm_rx_buf *rx_ring,
					     int id, int frags,
					     u64 mapping[IPOIB_CM_RX_SG],
					     gfp_t gfp)
{}

static void ipoib_cm_free_rx_ring(struct net_device *dev,
				  struct ipoib_cm_rx_buf *rx_ring)
{}

static void ipoib_cm_start_rx_drain(struct ipoib_dev_priv *priv)
{}

static void ipoib_cm_rx_event_handler(struct ib_event *event, void *ctx)
{}

static struct ib_qp *ipoib_cm_create_rx_qp(struct net_device *dev,
					   struct ipoib_cm_rx *p)
{}

static int ipoib_cm_modify_rx_qp(struct net_device *dev,
				 struct ib_cm_id *cm_id, struct ib_qp *qp,
				 unsigned int psn)
{}

static void ipoib_cm_init_rx_wr(struct net_device *dev,
				struct ib_recv_wr *wr,
				struct ib_sge *sge)
{}

static int ipoib_cm_nonsrq_init_rx(struct net_device *dev, struct ib_cm_id *cm_id,
				   struct ipoib_cm_rx *rx)
{}

static int ipoib_cm_send_rep(struct net_device *dev, struct ib_cm_id *cm_id,
			     struct ib_qp *qp,
			     const struct ib_cm_req_event_param *req,
			     unsigned int psn)
{}

static int ipoib_cm_req_handler(struct ib_cm_id *cm_id,
				const struct ib_cm_event *event)
{}

static int ipoib_cm_rx_handler(struct ib_cm_id *cm_id,
			       const struct ib_cm_event *event)
{}
/* Adjust length of skb with fragments to match received data */
static void skb_put_frags(struct sk_buff *skb, unsigned int hdr_space,
			  unsigned int length, struct sk_buff *toskb)
{}

void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
{}

static inline int post_send(struct ipoib_dev_priv *priv,
			    struct ipoib_cm_tx *tx,
			    unsigned int wr_id,
			    struct ipoib_tx_buf *tx_req)
{}

void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_tx *tx)
{}

void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *wc)
{}

int ipoib_cm_dev_open(struct net_device *dev)
{}

static void ipoib_cm_free_rx_reap_list(struct net_device *dev)
{}

void ipoib_cm_dev_stop(struct net_device *dev)
{}

static int ipoib_cm_rep_handler(struct ib_cm_id *cm_id,
				const struct ib_cm_event *event)
{}

static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_cm_tx *tx)
{}

static int ipoib_cm_send_req(struct net_device *dev,
			     struct ib_cm_id *id, struct ib_qp *qp,
			     u32 qpn,
			     struct sa_path_rec *pathrec)
{}

static int ipoib_cm_modify_tx_init(struct net_device *dev,
				  struct ib_cm_id *cm_id, struct ib_qp *qp)
{}

static int ipoib_cm_tx_init(struct ipoib_cm_tx *p, u32 qpn,
			    struct sa_path_rec *pathrec)
{}

static void ipoib_cm_tx_destroy(struct ipoib_cm_tx *p)
{}

static int ipoib_cm_tx_handler(struct ib_cm_id *cm_id,
			       const struct ib_cm_event *event)
{}

struct ipoib_cm_tx *ipoib_cm_create_tx(struct net_device *dev, struct ipoib_path *path,
				       struct ipoib_neigh *neigh)
{}

void ipoib_cm_destroy_tx(struct ipoib_cm_tx *tx)
{}

#define QPN_AND_OPTIONS_OFFSET

static void ipoib_cm_tx_start(struct work_struct *work)
{}

static void ipoib_cm_tx_reap(struct work_struct *work)
{}

static void ipoib_cm_skb_reap(struct work_struct *work)
{}

void ipoib_cm_skb_too_long(struct net_device *dev, struct sk_buff *skb,
			   unsigned int mtu)
{}

static void ipoib_cm_rx_reap(struct work_struct *work)
{}

static void ipoib_cm_stale_task(struct work_struct *work)
{}

static ssize_t mode_show(struct device *d, struct device_attribute *attr,
			 char *buf)
{}

static ssize_t mode_store(struct device *d, struct device_attribute *attr,
			  const char *buf, size_t count)
{}

static DEVICE_ATTR_RW(mode);

int ipoib_cm_add_mode_attr(struct net_device *dev)
{}

static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)
{}

int ipoib_cm_dev_init(struct net_device *dev)
{}

void ipoib_cm_dev_cleanup(struct net_device *dev)
{}