X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Finclude%2Flnet%2Fapi.h;h=c139be1b9427d98c7866f606c8e15f3f24ec774b;hb=db49fbf00d24edc8347006241f314fb0f82f1b63;hp=9a137f03acfc51141471742f976a6a7d82366737;hpb=d10200a80770f0029d1d665af954187b9ad883df;p=fs%2Flustre-release.git diff --git a/lnet/include/lnet/api.h b/lnet/include/lnet/api.h index 9a137f0..c139be1 100644 --- a/lnet/include/lnet/api.h +++ b/lnet/include/lnet/api.h @@ -23,11 +23,10 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2016, Intel Corporation. + * Copyright (c) 2016, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. */ #ifndef __LNET_API_H__ @@ -47,7 +46,7 @@ # error This include is only for kernel use. #endif -#include +#include /** \defgroup lnet_init_fini Initialization and cleanup * The LNet must be properly initialized before any LNet calls can be made. @@ -75,9 +74,10 @@ int LNetNIFini(void); * * \see LNetMEAttach * @{ */ -int LNetGetId(unsigned int index, lnet_process_id_t *id); +int LNetGetId(unsigned int index, struct lnet_process_id *id); int LNetDist(lnet_nid_t nid, lnet_nid_t *srcnid, __u32 *order); -void LNetSnprintHandle(char *str, int str_len, lnet_handle_any_t handle); +lnet_nid_t LNetPrimaryNID(lnet_nid_t nid); +bool LNetIsPeerLocal(lnet_nid_t nid); /** @} lnet_addr */ @@ -91,26 +91,16 @@ void LNetSnprintHandle(char *str, int str_len, lnet_handle_any_t handle); * list is a chain of MEs. Each ME includes a pointer to a memory descriptor * and a set of match criteria. The match criteria can be used to reject * incoming requests based on process ID or the match bits provided in the - * request. MEs can be dynamically inserted into a match list by LNetMEAttach() - * and LNetMEInsert(), and removed from its list by LNetMEUnlink(). + * request. MEs can be dynamically inserted into a match list by LNetMEAttach(), + * and must then be attached to an MD with LNetMDAttach(). * @{ */ -int LNetMEAttach(unsigned int portal, - lnet_process_id_t match_id_in, - __u64 match_bits_in, - __u64 ignore_bits_in, - lnet_unlink_t unlink_in, - lnet_ins_pos_t pos_in, - lnet_handle_me_t *handle_out); - -int LNetMEInsert(lnet_handle_me_t current_in, - lnet_process_id_t match_id_in, - __u64 match_bits_in, - __u64 ignore_bits_in, - lnet_unlink_t unlink_in, - lnet_ins_pos_t position_in, - lnet_handle_me_t *handle_out); - -int LNetMEUnlink(lnet_handle_me_t current_in); +struct lnet_me * +LNetMEAttach(unsigned int portal, + struct lnet_processid *match_id_in, + __u64 match_bits_in, + __u64 ignore_bits_in, + enum lnet_unlink unlink_in, + enum lnet_ins_pos pos_in); /** @} lnet_me */ /** \defgroup lnet_md Memory descriptors @@ -125,59 +115,20 @@ int LNetMEUnlink(lnet_handle_me_t current_in); * and LNetMDBind(); one operation to unlink and release the resources * associated with a MD: LNetMDUnlink(). * @{ */ -int LNetMDAttach(lnet_handle_me_t current_in, - lnet_md_t md_in, - lnet_unlink_t unlink_in, - lnet_handle_md_t *handle_out); +int LNetMDAttach(struct lnet_me *current_in, + const struct lnet_md *md_in, + enum lnet_unlink unlink_in, + struct lnet_handle_md *md_handle_out); -int LNetMDBind(lnet_md_t md_in, - lnet_unlink_t unlink_in, - lnet_handle_md_t *handle_out); +int LNetMDBind(const struct lnet_md *md_in, + enum lnet_unlink unlink_in, + struct lnet_handle_md *md_handle_out); -int LNetMDUnlink(lnet_handle_md_t md_in); -/** @} lnet_md */ - -/** \defgroup lnet_eq Events and event queues - * - * Event queues (abbreviated as EQ) are used to log operations performed on - * local MDs. In particular, they signal the completion of a data transmission - * into or out of a MD. They can also be used to hold acknowledgments for - * completed PUT operations and indicate when a MD has been unlinked. Multiple - * MDs can share a single EQ. An EQ may have an optional event handler - * associated with it. If an event handler exists, it will be run for each - * event that is deposited into the EQ. - * - * In addition to the lnet_handle_eq_t, the LNet API defines two types - * associated with events: The ::lnet_event_kind_t defines the kinds of events - * that can be stored in an EQ. The lnet_event_t defines a structure that - * holds the information about with an event. - * - * There are five functions for dealing with EQs: LNetEQAlloc() is used to - * create an EQ and allocate the resources needed, while LNetEQFree() - * releases these resources and free the EQ. LNetEQGet() retrieves the next - * event from an EQ, and LNetEQWait() can be used to block a process until - * an EQ has at least one event. LNetEQPoll() can be used to test or wait - * on multiple EQs. - * @{ */ -int LNetEQAlloc(unsigned int count_in, - lnet_eq_handler_t handler, - lnet_handle_eq_t *handle_out); - -int LNetEQFree(lnet_handle_eq_t eventq_in); - -int LNetEQGet(lnet_handle_eq_t eventq_in, - lnet_event_t *event_out); +int __LNetMDUnlink(struct lnet_handle_md md_in, bool discard); +#define LNetMDUnlink(handle) __LNetMDUnlink(handle, false) - -int LNetEQWait(lnet_handle_eq_t eventq_in, - lnet_event_t *event_out); - -int LNetEQPoll(lnet_handle_eq_t *eventqs_in, - int neq_in, - int timeout_ms, - lnet_event_t *event_out, - int *which_eq_out); -/** @} lnet_eq */ +void lnet_assert_handler_unused(lnet_handler_t handler); +/** @} lnet_md */ /** \defgroup lnet_data Data movement operations * @@ -185,20 +136,21 @@ int LNetEQPoll(lnet_handle_eq_t *eventqs_in, * and LNetGet(). * @{ */ int LNetPut(lnet_nid_t self, - lnet_handle_md_t md_in, - lnet_ack_req_t ack_req_in, - lnet_process_id_t target_in, + struct lnet_handle_md md_in, + enum lnet_ack_req ack_req_in, + struct lnet_process_id target_in, unsigned int portal_in, __u64 match_bits_in, unsigned int offset_in, __u64 hdr_data_in); int LNetGet(lnet_nid_t self, - lnet_handle_md_t md_in, - lnet_process_id_t target_in, + struct lnet_handle_md md_in, + struct lnet_process_id target_in, unsigned int portal_in, __u64 match_bits_in, - unsigned int offset_in); + unsigned int offset_in, + bool recovery); /** @} lnet_data */ @@ -209,7 +161,9 @@ int LNetGet(lnet_nid_t self, int LNetSetLazyPortal(int portal); int LNetClearLazyPortal(int portal); int LNetCtl(unsigned int cmd, void *arg); -void LNetDebugPeer(lnet_process_id_t id); +void LNetDebugPeer(struct lnet_process_id id); +int LNetGetPeerDiscoveryStatus(void); +int LNetAddPeer(lnet_nid_t *nids, __u32 num_nids); /** @} lnet_misc */