Commit 8bcaef92 authored by Liang Zhen's avatar Liang Zhen Committed by Greg Kroah-Hartman
Browse files

staging: lustre: ptlrpc: mbits is sent within ptlrpc_body



ptlrpc is using rq_xid as matchbits of bulk data, which means it
has to change rq_xid for bulk resend to avoid several bulk data
landing into the same buffer from different resends.

This patch uses one of reserved __u64 of ptlrpc_body to transfer
mbits to peer, matchbits is now separated from xid. With this change,
ptlrpc can keep rq_xid unchanged on resend, it only updates matchbits
for bulk data.

This protocol change is only applied if both sides of connection have
OBD_CONNECT_BULK_MBITS, otherwise, ptlrpc still uses old approach and
update xid while resending bulk.

Signed-off-by: default avatarLiang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3534
Reviewed-on: http://review.whamcloud.com/15421


Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarAlex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dff37ca9
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1007,8 +1007,11 @@ struct ptlrpc_body_v3 {
	__u64 pb_slv;
	/* VBR: pre-versions */
	__u64 pb_pre_versions[PTLRPC_NUM_VERSIONS];
	__u64 pb_mbits; /**< match bits for bulk request */
	/* padding for future needs */
	__u64 pb_padding[4];
	__u64 pb_padding64_0;
	__u64 pb_padding64_1;
	__u64 pb_padding64_2;
	char  pb_jobid[LUSTRE_JOBID_SIZE];
};

@@ -1037,8 +1040,11 @@ struct ptlrpc_body_v2 {
	__u64 pb_slv;
	/* VBR: pre-versions */
	__u64 pb_pre_versions[PTLRPC_NUM_VERSIONS];
	__u64 pb_mbits; /**< unused in V2 */
	/* padding for future needs */
	__u64 pb_padding[4];
	__u64 pb_padding64_0;
	__u64 pb_padding64_1;
	__u64 pb_padding64_2;
};

void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
@@ -1183,6 +1189,8 @@ void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
						       *  RPCs in parallel
						       */
#define OBD_CONNECT_DIR_STRIPE	 0x400000000000000ULL/* striped DNE dir */
/** bulk matchbits is sent within ptlrpc_body */
#define OBD_CONNECT_BULK_MBITS	 0x2000000000000000ULL

/* XXX README XXX:
 * Please DO NOT add flag values here before first ensuring that this same
+4 −1
Original line number Diff line number Diff line
@@ -797,6 +797,8 @@ struct ptlrpc_request {
	__u64 rq_transno;
	/** xid */
	__u64 rq_xid;
	/** bulk match bits */
	u64				rq_mbits;
	/**
	 * List item to for replay list. Not yet committed requests get linked
	 * there.
@@ -1209,7 +1211,7 @@ struct ptlrpc_bulk_desc {
	int		    bd_nob;	  /* # bytes covered */
	int		    bd_nob_transferred; /* # bytes GOT/PUT */

	__u64		  bd_last_xid;
	u64			bd_last_mbits;

	struct ptlrpc_cb_id    bd_cbid;	 /* network callback info */
	lnet_nid_t	     bd_sender;       /* stash event::sender */
@@ -2081,6 +2083,7 @@ void lustre_msg_set_timeout(struct lustre_msg *msg, __u32 timeout);
void lustre_msg_set_service_time(struct lustre_msg *msg, __u32 service_time);
void lustre_msg_set_jobid(struct lustre_msg *msg, char *jobid);
void lustre_msg_set_cksum(struct lustre_msg *msg, __u32 cksum);
void lustre_msg_set_mbits(struct lustre_msg *msg, u64 mbits);

static inline void
lustre_shrink_reply(struct ptlrpc_request *req, int segment,
+5 −2
Original line number Diff line number Diff line
@@ -191,7 +191,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
				  OBD_CONNECT_FLOCK_DEAD |
				  OBD_CONNECT_DISP_STRIPE | OBD_CONNECT_LFSCK |
				  OBD_CONNECT_OPEN_BY_FID |
				  OBD_CONNECT_DIR_STRIPE;
				  OBD_CONNECT_DIR_STRIPE |
				  OBD_CONNECT_BULK_MBITS;

	if (sbi->ll_flags & LL_SBI_LRU_RESIZE)
		data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
@@ -352,7 +353,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
				  OBD_CONNECT_64BITHASH | OBD_CONNECT_MAXBYTES |
				  OBD_CONNECT_EINPROGRESS |
				  OBD_CONNECT_JOBSTATS | OBD_CONNECT_LVB_TYPE |
				  OBD_CONNECT_LAYOUTLOCK | OBD_CONNECT_PINGLESS;
				  OBD_CONNECT_LAYOUTLOCK |
				  OBD_CONNECT_PINGLESS | OBD_CONNECT_LFSCK |
				  OBD_CONNECT_BULK_MBITS;

	if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_CKSUM)) {
		/* OBD_CONNECT_CKSUM should always be set, even if checksums are
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ static const char * const obd_connect_names[] = {
	"unlink_close",
	"multi_mod_rpcs",
	"dir_stripe",
	"bulk_mbits",
	"unknown",
	NULL
};
+1 −1
Original line number Diff line number Diff line
@@ -382,7 +382,7 @@ int lustre_start_mgc(struct super_block *sb)
	/* We connect to the MGS at setup, and don't disconnect until cleanup */
	data->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_AT |
				  OBD_CONNECT_FULL20 | OBD_CONNECT_IMP_RECOV |
				  OBD_CONNECT_LVB_TYPE;
				  OBD_CONNECT_LVB_TYPE | OBD_CONNECT_BULK_MBITS;

#if OBD_OCD_VERSION(3, 0, 53, 0) > LUSTRE_VERSION_CODE
	data->ocd_connect_flags |= OBD_CONNECT_MNE_SWAB;
Loading