linux/drivers/infiniband/sw/siw/siw_main.c

// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

/* Authors: Bernard Metzler <[email protected]> */
/* Copyright (c) 2008-2019, IBM Corporation */

#include <linux/init.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
#include <net/net_namespace.h>
#include <linux/rtnetlink.h>
#include <linux/if_arp.h>
#include <linux/list.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/dma-mapping.h>

#include <net/addrconf.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_user_verbs.h>
#include <rdma/rdma_netlink.h>
#include <linux/kthread.h>

#include "siw.h"
#include "siw_verbs.h"

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

/* transmit from user buffer, if possible */
const bool zcopy_tx =;

/* Restrict usage of GSO, if hardware peer iwarp is unable to process
 * large packets. try_gso = true lets siw try to use local GSO,
 * if peer agrees.  Not using GSO severly limits siw maximum tx bandwidth.
 */
const bool try_gso;

/* Attach siw also with loopback devices */
const bool loopback_enabled =;

/* We try to negotiate CRC on, if true */
const bool mpa_crc_required;

/* MPA CRC on/off enforced */
const bool mpa_crc_strict;

/* Control TCP_NODELAY socket option */
const bool siw_tcp_nagle;

/* Select MPA version to be used during connection setup */
u_char mpa_version =;

/* Selects MPA P2P mode (additional handshake during connection
 * setup, if true.
 */
const bool peer_to_peer;

struct task_struct *siw_tx_thread[NR_CPUS];
struct crypto_shash *siw_crypto_shash;

static int siw_device_register(struct siw_device *sdev, const char *name)
{}

static void siw_device_cleanup(struct ib_device *base_dev)
{}

static int siw_dev_qualified(struct net_device *netdev)
{}

static DEFINE_PER_CPU(atomic_t, siw_use_cnt);

static struct {} siw_cpu_info;

static void siw_destroy_cpulist(int number)
{}

static int siw_init_cpulist(void)
{}

/*
 * Choose CPU with least number of active QP's from NUMA node of
 * TX interface.
 */
int siw_get_tx_cpu(struct siw_device *sdev)
{}

void siw_put_tx_cpu(int cpu)
{}

static struct ib_qp *siw_get_base_qp(struct ib_device *base_dev, int id)
{}

static const struct ib_device_ops siw_device_ops =;

static struct siw_device *siw_device_create(struct net_device *netdev)
{}

/*
 * Network link becomes unavailable. Mark all
 * affected QP's accordingly.
 */
static void siw_netdev_down(struct work_struct *work)
{}

static void siw_device_goes_down(struct siw_device *sdev)
{}

static int siw_netdev_event(struct notifier_block *nb, unsigned long event,
			    void *arg)
{}

static struct notifier_block siw_netdev_nb =;

static int siw_newlink(const char *basedev_name, struct net_device *netdev)
{}

static struct rdma_link_ops siw_link_ops =;

/*
 * siw_init_module - Initialize Softiwarp module and register with netdev
 *                   subsystem.
 */
static __init int siw_init_module(void)
{}

static void __exit siw_exit_module(void)
{}

module_init();
module_exit(siw_exit_module);

MODULE_ALIAS_RDMA_LINK();