smc_llc.h 1.5 KB
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
U
Ursula Braun 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*
 *  Shared Memory Communications over RDMA (SMC-R) and RoCE
 *
 *  Definitions for LLC (link layer control) message handling
 *
 *  Copyright IBM Corp. 2016
 *
 *  Author(s):  Klaus Wacker <Klaus.Wacker@de.ibm.com>
 *              Ursula Braun <ubraun@linux.vnet.ibm.com>
 */

#ifndef SMC_LLC_H
#define SMC_LLC_H

#include "smc_wr.h"

#define SMC_LLC_FLAG_RESP		0x80

#define SMC_LLC_WAIT_FIRST_TIME		(5 * HZ)
21
#define SMC_LLC_WAIT_TIME		(2 * HZ)
U
Ursula Braun 已提交
22 23 24 25 26 27 28 29

enum smc_llc_reqresp {
	SMC_LLC_REQ,
	SMC_LLC_RESP
};

enum smc_llc_msg_type {
	SMC_LLC_CONFIRM_LINK		= 0x01,
30 31
	SMC_LLC_ADD_LINK		= 0x02,
	SMC_LLC_DELETE_LINK		= 0x04,
32
	SMC_LLC_CONFIRM_RKEY		= 0x06,
33
	SMC_LLC_TEST_LINK		= 0x07,
34 35
	SMC_LLC_CONFIRM_RKEY_CONT	= 0x08,
	SMC_LLC_DELETE_RKEY		= 0x09,
U
Ursula Braun 已提交
36 37 38
};

/* transmit */
39
int smc_llc_send_confirm_link(struct smc_link *lnk,
U
Ursula Braun 已提交
40
			      enum smc_llc_reqresp reqresp);
41
int smc_llc_send_add_link(struct smc_link *link, u8 mac[], u8 gid[],
42 43
			  enum smc_llc_reqresp reqresp);
int smc_llc_send_delete_link(struct smc_link *link,
44
			     enum smc_llc_reqresp reqresp, bool orderly);
45
int smc_llc_link_init(struct smc_link *link);
46
void smc_llc_link_active(struct smc_link *link, int testlink_time);
47
void smc_llc_link_deleting(struct smc_link *link);
48
void smc_llc_link_inactive(struct smc_link *link);
49
void smc_llc_link_clear(struct smc_link *link);
50 51
int smc_llc_do_confirm_rkey(struct smc_link *link,
			    struct smc_buf_desc *rmb_desc);
U
Ursula Braun 已提交
52 53 54
int smc_llc_init(void) __init;

#endif /* SMC_LLC_H */