1 /* SPDX-License-Identifier: GPL-2.0 */
4 * Copyright (c) 2014, Intel Corporation.
6 * Copyright 2012 Xyratex Technology Limited
10 * This file is part of Lustre, http://www.lustre.org/
12 * Network Request Scheduler (NRS) Client Round Robin over NIDs (CRR-N) policy
15 #ifndef _LUSTRE_NRS_CRR_H
16 #define _LUSTRE_NRS_CRR_H
21 * CRR-N, Client Round Robin over NIDs
24 #include <libcfs/linux/linux-hash.h>
27 * private data structure for CRR-N NRS
30 struct ptlrpc_nrs_resource cn_res;
31 struct binheap *cn_binheap;
32 /* CRR-N NRS - NID hash body */
33 struct rhashtable cn_cli_hash;
35 * Used when a new scheduling round commences, in order to synchronize
36 * all clients with the new round number.
40 * Determines the relevant ordering amongst request batches within a
45 * Round Robin quantum; the maximum number of RPCs that each request
46 * batch for each client can have in a scheduling round.
52 * Object representing a client in CRR-N, as identified by its NID
54 struct nrs_crrn_client {
55 struct ptlrpc_nrs_resource cc_res;
56 struct rhash_head cc_rhead;
57 struct lnet_nid cc_nid;
59 * The round number against which this client is currently scheduling
64 * The sequence number used for requests scheduled by this client during
65 * the current round number.
70 * Round Robin quantum; the maximum number of RPCs the client is allowed
71 * to schedule in a single batch of each round.
75 * # of pending requests for this client, on all existing rounds
81 * CRR-N NRS request definition
85 * Round number for this request; shared with all other requests in the
90 * Sequence number for this request; shared with all other requests in
97 * CRR-N policy operations.
99 * Read the RR quantum size of a CRR-N policy.
101 #define NRS_CTL_CRRN_RD_QUANTUM PTLRPC_NRS_CTL_POL_SPEC_01
103 * Write the RR quantum size of a CRR-N policy.
105 #define NRS_CTL_CRRN_WR_QUANTUM PTLRPC_NRS_CTL_POL_SPEC_02