#ifndef _LUSTRE_NET_H
#define _LUSTRE_NET_H
+/** \defgroup net net
+ *
+ * @{
+ */
+
#if defined(__linux__)
#include <linux/lustre_net.h>
#elif defined(__APPLE__)
#include <lustre_req_layout.h>
#include <obd_support.h>
+#include <lustre_ver.h>
/* MD flags we _always_ use */
#define PTLRPC_MD_OPTIONS 0
#define MDT_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
cfs_num_physpages >> (25 - CFS_PAGE_SHIFT)), \
2UL)
-#define FLD_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
- cfs_num_physpages >> (25 - CFS_PAGE_SHIFT)), \
- 2UL)
-#define SEQ_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
- cfs_num_physpages >> (25 - CFS_PAGE_SHIFT)), \
- 2UL)
/* Absolute limits */
#define MDS_THREADS_MIN 2
/* SEQ_MAXREPSIZE == lustre_msg + ptlrpc_body + lu_range */
#define SEQ_MAXREPSIZE (152)
-#define MGS_THREADS_AUTO_MIN 2
+/* MGS threads must be >= 3, see bug 22458 comment #28 */
+#define MGS_THREADS_AUTO_MIN 3
#define MGS_THREADS_AUTO_MAX 32
#define MGS_NBUFS (64 * cfs_num_online_cpus())
#define MGS_BUFSIZE (8 * 1024)
typedef int (*set_interpreter_func)(struct ptlrpc_request_set *, void *, int);
struct ptlrpc_request_set {
- int set_remaining; /* # uncompleted requests */
+ cfs_atomic_t set_remaining; /* # uncompleted requests */
cfs_waitq_t set_waitq;
cfs_waitq_t *set_wakeup_ptr;
cfs_list_t set_requests;
rq_hp:1, /* high priority RPC */
rq_at_linked:1, /* link into service's srv_at_array */
rq_reply_truncate:1,
- rq_committed:1;
+ rq_committed:1,
+ /* whether the "rq_set" is a valid one */
+ rq_invalid_rqset:1;
enum rq_phase rq_phase; /* one of RQ_PHASE_* */
enum rq_phase rq_next_phase; /* one of RQ_PHASE_* to be used next */
int rq_request_portal; /* XXX FIXME bug 249 */
int rq_reply_portal; /* XXX FIXME bug 249 */
- int rq_nob_received; /* client-side # reply bytes actually received */
-
+ int rq_nob_received; /* client-side:
+ * !rq_truncate : # reply bytes actually received,
+ * rq_truncate : required repbuf_len for resend */
int rq_reqlen;
struct lustre_msg *rq_reqmsg;
int rq_timeout; /* service time estimate (secs) */
/* Multi-rpc bits */
- cfs_list_t rq_set_chain;
+ cfs_list_t rq_set_chain;
+ cfs_waitq_t rq_set_waitq;
struct ptlrpc_request_set *rq_set;
/** Async completion handler */
ptlrpc_interpterer_t rq_interpret_reply;
FLAG(req->rq_restart, "T"), FLAG(req->rq_replay, "P"), \
FLAG(req->rq_no_resend, "N"), \
FLAG(req->rq_waiting, "W"), \
- FLAG(req->rq_wait_ctx, "C"), FLAG(req->rq_hp, "H")
+ FLAG(req->rq_wait_ctx, "C"), FLAG(req->rq_hp, "H"), \
+ FLAG(req->rq_committed, "M")
-#define REQ_FLAGS_FMT "%s:%s%s%s%s%s%s%s%s%s%s%s"
+#define REQ_FLAGS_FMT "%s:%s%s%s%s%s%s%s%s%s%s%s%s"
void _debug_req(struct ptlrpc_request *req, __u32 mask,
struct libcfs_debug_msg_data *data, const char *fmt, ...)
__u32 lustre_msg_get_timeout(struct lustre_msg *msg);
__u32 lustre_msg_get_service_time(struct lustre_msg *msg);
__u32 lustre_msg_get_cksum(struct lustre_msg *msg);
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 9, 0, 0)
+__u32 lustre_msg_calc_cksum(struct lustre_msg *msg, int compat18);
+#else
+# warning "remove checksum compatibility support for b1_8"
__u32 lustre_msg_calc_cksum(struct lustre_msg *msg);
+#endif
void lustre_msg_set_handle(struct lustre_msg *msg,struct lustre_handle *handle);
void lustre_msg_set_type(struct lustre_msg *msg, __u32 type);
void lustre_msg_set_opc(struct lustre_msg *msg, __u32 opc);
/* ptlrpc/llog_client.c */
extern struct llog_operations llog_client_ops;
+/** @} net */
+
#endif