aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Raspl <stefan.raspl@de.ibm.com>2018-03-01 07:51:26 -0500
committerDavid S. Miller <davem@davemloft.net>2018-03-01 13:21:31 -0500
commit0f6271264afd975bc599d6f30f3693e9aea57036 (patch)
tree59afef354ab7a129324c74ff5331af4203e2f2f4
parent3c5aa0bc9c0063b4c462cce4d07f88aa3fbeaea3 (diff)
net/smc: cleanup smc_llc.h and smc_clc.h headers
Remove structures used internal only from headers. And remove an extra function parameter. Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com> Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/smc/af_smc.c8
-rw-r--r--net/smc/smc_clc.c3
-rw-r--r--net/smc/smc_clc.h6
-rw-r--r--net/smc/smc_llc.c30
-rw-r--r--net/smc/smc_llc.h28
5 files changed, 37 insertions, 38 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 38ae22b65e77..b1961a789837 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -312,7 +312,7 @@ out:
312 return rc; 312 return rc;
313} 313}
314 314
315static int smc_clnt_conf_first_link(struct smc_sock *smc, union ib_gid *gid) 315static int smc_clnt_conf_first_link(struct smc_sock *smc)
316{ 316{
317 struct smc_link_group *lgr = smc->conn.lgr; 317 struct smc_link_group *lgr = smc->conn.lgr;
318 struct smc_link *link; 318 struct smc_link *link;
@@ -346,7 +346,8 @@ static int smc_clnt_conf_first_link(struct smc_sock *smc, union ib_gid *gid)
346 /* send CONFIRM LINK response over RoCE fabric */ 346 /* send CONFIRM LINK response over RoCE fabric */
347 rc = smc_llc_send_confirm_link(link, 347 rc = smc_llc_send_confirm_link(link,
348 link->smcibdev->mac[link->ibport - 1], 348 link->smcibdev->mac[link->ibport - 1],
349 gid, SMC_LLC_RESP); 349 &link->smcibdev->gid[link->ibport - 1],
350 SMC_LLC_RESP);
350 if (rc < 0) 351 if (rc < 0)
351 return SMC_CLC_DECL_TCL; 352 return SMC_CLC_DECL_TCL;
352 353
@@ -498,8 +499,7 @@ static int smc_connect_rdma(struct smc_sock *smc)
498 499
499 if (local_contact == SMC_FIRST_CONTACT) { 500 if (local_contact == SMC_FIRST_CONTACT) {
500 /* QP confirmation over RoCE fabric */ 501 /* QP confirmation over RoCE fabric */
501 reason_code = smc_clnt_conf_first_link( 502 reason_code = smc_clnt_conf_first_link(smc);
502 smc, &smcibdev->gid[ibport - 1]);
503 if (reason_code < 0) { 503 if (reason_code < 0) {
504 rc = reason_code; 504 rc = reason_code;
505 goto out_err_unlock; 505 goto out_err_unlock;
diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c
index 8ac51583a063..dff318a2d5bf 100644
--- a/net/smc/smc_clc.c
+++ b/net/smc/smc_clc.c
@@ -22,6 +22,9 @@
22#include "smc_clc.h" 22#include "smc_clc.h"
23#include "smc_ib.h" 23#include "smc_ib.h"
24 24
25/* eye catcher "SMCR" EBCDIC for CLC messages */
26static const char SMC_EYECATCHER[4] = {'\xe2', '\xd4', '\xc3', '\xd9'};
27
25/* check if received message has a correct header length and contains valid 28/* check if received message has a correct header length and contains valid
26 * heading and trailing eyecatchers 29 * heading and trailing eyecatchers
27 */ 30 */
diff --git a/net/smc/smc_clc.h b/net/smc/smc_clc.h
index c145a0f36a68..aab3aae2a2ce 100644
--- a/net/smc/smc_clc.h
+++ b/net/smc/smc_clc.h
@@ -22,9 +22,6 @@
22#define SMC_CLC_CONFIRM 0x03 22#define SMC_CLC_CONFIRM 0x03
23#define SMC_CLC_DECLINE 0x04 23#define SMC_CLC_DECLINE 0x04
24 24
25/* eye catcher "SMCR" EBCDIC for CLC messages */
26static const char SMC_EYECATCHER[4] = {'\xe2', '\xd4', '\xc3', '\xd9'};
27
28#define SMC_CLC_V1 0x1 /* SMC version */ 25#define SMC_CLC_V1 0x1 /* SMC version */
29#define CLC_WAIT_TIME (6 * HZ) /* max. wait time on clcsock */ 26#define CLC_WAIT_TIME (6 * HZ) /* max. wait time on clcsock */
30#define SMC_CLC_DECL_MEM 0x01010000 /* insufficient memory resources */ 27#define SMC_CLC_DECL_MEM 0x01010000 /* insufficient memory resources */
@@ -124,9 +121,6 @@ smc_clc_proposal_get_prefix(struct smc_clc_msg_proposal *pclc)
124 ((u8 *)pclc + sizeof(*pclc) + ntohs(pclc->iparea_offset)); 121 ((u8 *)pclc + sizeof(*pclc) + ntohs(pclc->iparea_offset));
125} 122}
126 123
127struct smc_sock;
128struct smc_ib_device;
129
130int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen, 124int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
131 u8 expected_type); 125 u8 expected_type);
132int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info); 126int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info);
diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
index 92fe4cc8c82c..e4502bbff33d 100644
--- a/net/smc/smc_llc.c
+++ b/net/smc/smc_llc.c
@@ -21,6 +21,36 @@
21#include "smc_clc.h" 21#include "smc_clc.h"
22#include "smc_llc.h" 22#include "smc_llc.h"
23 23
24#define SMC_LLC_DATA_LEN 40
25
26struct smc_llc_hdr {
27 struct smc_wr_rx_hdr common;
28 u8 length; /* 44 */
29 u8 reserved;
30 u8 flags;
31};
32
33struct smc_llc_msg_confirm_link { /* type 0x01 */
34 struct smc_llc_hdr hd;
35 u8 sender_mac[ETH_ALEN];
36 u8 sender_gid[SMC_GID_SIZE];
37 u8 sender_qp_num[3];
38 u8 link_num;
39 u8 link_uid[SMC_LGR_ID_SIZE];
40 u8 max_links;
41 u8 reserved[9];
42};
43
44union smc_llc_msg {
45 struct smc_llc_msg_confirm_link confirm_link;
46 struct {
47 struct smc_llc_hdr hdr;
48 u8 data[SMC_LLC_DATA_LEN];
49 } raw;
50};
51
52#define SMC_LLC_FLAG_RESP 0x80
53
24/********************************** send *************************************/ 54/********************************** send *************************************/
25 55
26struct smc_llc_tx_pend { 56struct smc_llc_tx_pend {
diff --git a/net/smc/smc_llc.h b/net/smc/smc_llc.h
index 51b27ce90dbd..a7888607ab53 100644
--- a/net/smc/smc_llc.h
+++ b/net/smc/smc_llc.h
@@ -28,34 +28,6 @@ enum smc_llc_msg_type {
28 SMC_LLC_CONFIRM_LINK = 0x01, 28 SMC_LLC_CONFIRM_LINK = 0x01,
29}; 29};
30 30
31#define SMC_LLC_DATA_LEN 40
32
33struct smc_llc_hdr {
34 struct smc_wr_rx_hdr common;
35 u8 length; /* 44 */
36 u8 reserved;
37 u8 flags;
38};
39
40struct smc_llc_msg_confirm_link { /* type 0x01 */
41 struct smc_llc_hdr hd;
42 u8 sender_mac[ETH_ALEN];
43 u8 sender_gid[SMC_GID_SIZE];
44 u8 sender_qp_num[3];
45 u8 link_num;
46 u8 link_uid[SMC_LGR_ID_SIZE];
47 u8 max_links;
48 u8 reserved[9];
49};
50
51union smc_llc_msg {
52 struct smc_llc_msg_confirm_link confirm_link;
53 struct {
54 struct smc_llc_hdr hdr;
55 u8 data[SMC_LLC_DATA_LEN];
56 } raw;
57};
58
59/* transmit */ 31/* transmit */
60int smc_llc_send_confirm_link(struct smc_link *lnk, u8 mac[], union ib_gid *gid, 32int smc_llc_send_confirm_link(struct smc_link *lnk, u8 mac[], union ib_gid *gid,
61 enum smc_llc_reqresp reqresp); 33 enum smc_llc_reqresp reqresp);