diff options
author | Karsten Graul <kgraul@linux.ibm.com> | 2018-05-15 11:04:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-16 11:49:19 -0400 |
commit | d97935faee4ba2cc37676afd955e9f519a5affbf (patch) | |
tree | 2d9837285f03198604cff31bb72cca294e227dba | |
parent | 9fcdf8e983b5c8367064067cd8e74b6cfb90eef7 (diff) |
net/smc: simplify test_link function usage
Make smc_llc_send_test_link() static and remove it from the header file.
And to send a test_link response set the response flag and send the
message back as-is, without using smc_llc_send_test_link(). And because
smc_llc_send_test_link() must no longer send responses, remove the
response flag handling from the function.
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/smc/smc_llc.c | 12 | ||||
-rw-r--r-- | net/smc/smc_llc.h | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c index 29f59b47b559..229e967c7940 100644 --- a/net/smc/smc_llc.c +++ b/net/smc/smc_llc.c | |||
@@ -296,9 +296,8 @@ int smc_llc_send_delete_link(struct smc_link *link, | |||
296 | return rc; | 296 | return rc; |
297 | } | 297 | } |
298 | 298 | ||
299 | /* send LLC test link request or response */ | 299 | /* send LLC test link request */ |
300 | int smc_llc_send_test_link(struct smc_link *link, u8 user_data[16], | 300 | static int smc_llc_send_test_link(struct smc_link *link, u8 user_data[16]) |
301 | enum smc_llc_reqresp reqresp) | ||
302 | { | 301 | { |
303 | struct smc_llc_msg_test_link *testllc; | 302 | struct smc_llc_msg_test_link *testllc; |
304 | struct smc_wr_tx_pend_priv *pend; | 303 | struct smc_wr_tx_pend_priv *pend; |
@@ -312,8 +311,6 @@ int smc_llc_send_test_link(struct smc_link *link, u8 user_data[16], | |||
312 | memset(testllc, 0, sizeof(*testllc)); | 311 | memset(testllc, 0, sizeof(*testllc)); |
313 | testllc->hd.common.type = SMC_LLC_TEST_LINK; | 312 | testllc->hd.common.type = SMC_LLC_TEST_LINK; |
314 | testllc->hd.length = sizeof(struct smc_llc_msg_test_link); | 313 | testllc->hd.length = sizeof(struct smc_llc_msg_test_link); |
315 | if (reqresp == SMC_LLC_RESP) | ||
316 | testllc->hd.flags |= SMC_LLC_FLAG_RESP; | ||
317 | memcpy(testllc->user_data, user_data, sizeof(testllc->user_data)); | 314 | memcpy(testllc->user_data, user_data, sizeof(testllc->user_data)); |
318 | /* send llc message */ | 315 | /* send llc message */ |
319 | rc = smc_wr_tx_send(link, pend); | 316 | rc = smc_wr_tx_send(link, pend); |
@@ -425,7 +422,8 @@ static void smc_llc_rx_test_link(struct smc_link *link, | |||
425 | if (link->state == SMC_LNK_ACTIVE) | 422 | if (link->state == SMC_LNK_ACTIVE) |
426 | complete(&link->llc_testlink_resp); | 423 | complete(&link->llc_testlink_resp); |
427 | } else { | 424 | } else { |
428 | smc_llc_send_test_link(link, llc->user_data, SMC_LLC_RESP); | 425 | llc->hd.flags |= SMC_LLC_FLAG_RESP; |
426 | smc_llc_send_message(link, llc, sizeof(*llc)); | ||
429 | } | 427 | } |
430 | } | 428 | } |
431 | 429 | ||
@@ -551,7 +549,7 @@ static void smc_llc_testlink_work(struct work_struct *work) | |||
551 | goto out; | 549 | goto out; |
552 | } | 550 | } |
553 | reinit_completion(&link->llc_testlink_resp); | 551 | reinit_completion(&link->llc_testlink_resp); |
554 | smc_llc_send_test_link(link, user_data, SMC_LLC_REQ); | 552 | smc_llc_send_test_link(link, user_data); |
555 | /* receive TEST LINK response over RoCE fabric */ | 553 | /* receive TEST LINK response over RoCE fabric */ |
556 | rc = wait_for_completion_interruptible_timeout(&link->llc_testlink_resp, | 554 | rc = wait_for_completion_interruptible_timeout(&link->llc_testlink_resp, |
557 | SMC_LLC_WAIT_TIME); | 555 | SMC_LLC_WAIT_TIME); |
diff --git a/net/smc/smc_llc.h b/net/smc/smc_llc.h index 728823dd8ae5..fb137f24aa6b 100644 --- a/net/smc/smc_llc.h +++ b/net/smc/smc_llc.h | |||
@@ -42,8 +42,6 @@ int smc_llc_send_add_link(struct smc_link *link, u8 mac[], union ib_gid *gid, | |||
42 | enum smc_llc_reqresp reqresp); | 42 | enum smc_llc_reqresp reqresp); |
43 | int smc_llc_send_delete_link(struct smc_link *link, | 43 | int smc_llc_send_delete_link(struct smc_link *link, |
44 | enum smc_llc_reqresp reqresp); | 44 | enum smc_llc_reqresp reqresp); |
45 | int smc_llc_send_test_link(struct smc_link *lnk, u8 user_data[16], | ||
46 | enum smc_llc_reqresp reqresp); | ||
47 | void smc_llc_link_active(struct smc_link *link, int testlink_time); | 45 | void smc_llc_link_active(struct smc_link *link, int testlink_time); |
48 | void smc_llc_link_inactive(struct smc_link *link); | 46 | void smc_llc_link_inactive(struct smc_link *link); |
49 | void smc_llc_link_flush(struct smc_link *link); | 47 | void smc_llc_link_flush(struct smc_link *link); |