summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ef7c402)
Implement function to determine if an lnet_msg is a response
(ACK or REPLY).
Test-Parameters: trivial
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I8ba2d92866f8bb2caba120d9f23218bb7761143a
Reviewed-on: https://review.whamcloud.com/36539
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
+static inline bool
+lnet_msg_is_response(struct lnet_msg *msg)
+{
+ return msg->msg_type == LNET_MSG_ACK || msg->msg_type == LNET_MSG_REPLY;
+}
+
static inline struct lnet_comm_count *
get_stats_counts(struct lnet_element_stats *stats,
enum lnet_stats_type stats_type)
static inline struct lnet_comm_count *
get_stats_counts(struct lnet_element_stats *stats,
enum lnet_stats_type stats_type)
return 1;
/* always send any responses */
return 1;
/* always send any responses */
- if (msg->msg_type == LNET_MSG_ACK ||
- msg->msg_type == LNET_MSG_REPLY)
+ if (lnet_msg_is_response(msg))
return 1;
if (!lnet_is_peer_deadline_passed(lpni, now))
return 1;
if (!lnet_is_peer_deadline_passed(lpni, now))
lnet_set_non_mr_pref_nid(struct lnet_peer_ni *lpni, struct lnet_ni *lni,
struct lnet_msg *msg)
{
lnet_set_non_mr_pref_nid(struct lnet_peer_ni *lpni, struct lnet_ni *lni,
struct lnet_msg *msg)
{
- if (msg->msg_type != LNET_MSG_REPLY && msg->msg_type != LNET_MSG_ACK &&
- lpni->lpni_pref_nnids == 0) {
+ if (!lnet_msg_is_response(msg) && lpni->lpni_pref_nnids == 0) {
CDEBUG(D_NET, "Setting preferred local NID %s on NMR peer %s\n",
libcfs_nid2str(lni->ni_nid),
libcfs_nid2str(lpni->lpni_nid));
CDEBUG(D_NET, "Setting preferred local NID %s on NMR peer %s\n",
libcfs_nid2str(lni->ni_nid),
libcfs_nid2str(lpni->lpni_nid));
else
send_case |= MR_DST;
else
send_case |= MR_DST;
- if (msg->msg_type == LNET_MSG_REPLY ||
- msg->msg_type == LNET_MSG_ACK)
+ if (lnet_msg_is_response(msg))
send_case |= SND_RESP;
/* assign parameters to the send_data */
send_case |= SND_RESP;
/* assign parameters to the send_data */