History

Merge tag 'nfs-rdma-for-5.1-1' of git://git.linux-nfs.org/projects/anna/linux-nfs

NFSoRDMA client updates for 5.1 New features: - Convert rpc auth layer to use xdr_streams - Config option to disable insecure enctypes - Reduce size of RPC receive buffers Bugfixes and cleanups: - Fix sparse warnings - Check inline size before providing a write chunk - Reduce the receive doorbell rate - Various tracepoint improvements [Trond: Fix up merge conflicts] Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

Trond Myklebust committed 7 years ago

Commit 06b5fc32 parents 5085607 2c94b8e47 files · +2078 −1581Browse files

Showing the changes to include/linux (5 of 47 files). Show all

Unified · Split

5 files
  1. include/linux/sunrpc/auth.h +26 −18
  2. include/linux/sunrpc/clnt.h +3 −0
  3. include/linux/sunrpc/gss_krb5_enctypes.h +41 −1
  4. include/linux/sunrpc/xdr.h +19 −4
  5. include/linux/sunrpc/xprt.h +0 −7
include/linux/sunrpc/auth.h+26−18
@@ -74,14 +74,12 @@ struct rpc_cred_cache; · 73 unmodified lines
7474 struct rpc_authops;
7575 struct rpc_auth {
7676 unsigned int au_cslack; /* call cred size estimate */
77− /* guess at number of u32's auth adds before
78− * reply data; normally the verifier size: */
79− unsigned int au_rslack;
80− /* for gss, used to calculate au_rslack: */
81− unsigned int au_verfsize;
82−
83− unsigned int au_flags; /* various flags */
84− const struct rpc_authops *au_ops; /* operations */
77+ unsigned int au_rslack; /* reply cred size estimate */
78+ unsigned int au_verfsize; /* size of reply verifier */
79+ unsigned int au_ralign; /* words before UL header */
80+
81+ unsigned int au_flags;
82+ const struct rpc_authops *au_ops;
8583 rpc_authflavor_t au_flavor; /* pseudoflavor (note may
8684 * differ from the flavor in
8785 * au_ops->au_flavor in gss
@@ -131,13 +129,15 @@ struct rpc_credops { · 43 unmodified lines
131129 void (*crdestroy)(struct rpc_cred *);
132130
133131 int (*crmatch)(struct auth_cred *, struct rpc_cred *, int);
134− __be32 * (*crmarshal)(struct rpc_task *, __be32 *);
132+ int (*crmarshal)(struct rpc_task *task,
133+ struct xdr_stream *xdr);
135134 int (*crrefresh)(struct rpc_task *);
136− __be32 * (*crvalidate)(struct rpc_task *, __be32 *);
137− int (*crwrap_req)(struct rpc_task *, kxdreproc_t,
138− void *, __be32 *, void *);
139− int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t,
140− void *, __be32 *, void *);
135+ int (*crvalidate)(struct rpc_task *task,
136+ struct xdr_stream *xdr);
137+ int (*crwrap_req)(struct rpc_task *task,
138+ struct xdr_stream *xdr);
139+ int (*crunwrap_resp)(struct rpc_task *task,
140+ struct xdr_stream *xdr);
141141 int (*crkey_timeout)(struct rpc_cred *);
142142 char * (*crstringify_acceptor)(struct rpc_cred *);
143143 bool (*crneed_reencode)(struct rpc_task *);
@@ -165,10 +165,18 @@ struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred * · 21 unmodified lines
165165 void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
166166 struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
167167 void put_rpccred(struct rpc_cred *);
168−__be32 * rpcauth_marshcred(struct rpc_task *, __be32 *);
169−__be32 * rpcauth_checkverf(struct rpc_task *, __be32 *);
170−int rpcauth_wrap_req(struct rpc_task *task, kxdreproc_t encode, void *rqstp, __be32 *data, void *obj);
171−int rpcauth_unwrap_resp(struct rpc_task *task, kxdrdproc_t decode, void *rqstp, __be32 *data, void *obj);
168+int rpcauth_marshcred(struct rpc_task *task,
169+ struct xdr_stream *xdr);
170+int rpcauth_checkverf(struct rpc_task *task,
171+ struct xdr_stream *xdr);
172+int rpcauth_wrap_req_encode(struct rpc_task *task,
173+ struct xdr_stream *xdr);
174+int rpcauth_wrap_req(struct rpc_task *task,
175+ struct xdr_stream *xdr);
176+int rpcauth_unwrap_resp_decode(struct rpc_task *task,
177+ struct xdr_stream *xdr);
178+int rpcauth_unwrap_resp(struct rpc_task *task,
179+ struct xdr_stream *xdr);
172180 bool rpcauth_xmit_need_reencode(struct rpc_task *task);
173181 int rpcauth_refreshcred(struct rpc_task *);
174182 void rpcauth_invalcred(struct rpc_task *);
include/linux/sunrpc/clnt.h+3−0
@@ -169,6 +169,9 @@ int rpcb_v4_register(struct net *net, const u32 program, · 168 unmodified lines
169169 const char *netid);
170170 void rpcb_getport_async(struct rpc_task *);
171171
172+void rpc_prepare_reply_pages(struct rpc_rqst *req, struct page **pages,
173+ unsigned int base, unsigned int len,
174+ unsigned int hdrsize);
172175 void rpc_call_start(struct rpc_task *);
173176 int rpc_call_async(struct rpc_clnt *clnt,
174177 const struct rpc_message *msg, int flags,
include/linux/sunrpc/gss_krb5_enctypes.h+41−1
@@ -1,4 +1,44 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
2− * Dumb way to share this static piece of information with nfsd
3+ * Define the string that exports the set of kernel-supported
4+ * Kerberos enctypes. This list is sent via upcall to gssd, and
5+ * is also exposed via the nfsd /proc API. The consumers generally
6+ * treat this as an ordered list, where the first item in the list
7+ * is the most preferred.
8+ */
9+
10+#ifndef _LINUX_SUNRPC_GSS_KRB5_ENCTYPES_H
11+#define _LINUX_SUNRPC_GSS_KRB5_ENCTYPES_H
12+
13+#ifdef CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES
14+
15+/*
16+ * NB: This list includes encryption types that were deprecated
17+ * by RFC 8429 (DES3_CBC_SHA1 and ARCFOUR_HMAC).
18+ *
19+ * ENCTYPE_AES256_CTS_HMAC_SHA1_96
20+ * ENCTYPE_AES128_CTS_HMAC_SHA1_96
21+ * ENCTYPE_DES3_CBC_SHA1
22+ * ENCTYPE_ARCFOUR_HMAC
23+ */
24+#define KRB5_SUPPORTED_ENCTYPES "18,17,16,23"
25+
26+#else /* CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES */
27+
28+/*
29+ * NB: This list includes encryption types that were deprecated
30+ * by RFC 8429 and RFC 6649.
31+ *
32+ * ENCTYPE_AES256_CTS_HMAC_SHA1_96
33+ * ENCTYPE_AES128_CTS_HMAC_SHA1_96
34+ * ENCTYPE_DES3_CBC_SHA1
35+ * ENCTYPE_ARCFOUR_HMAC
36+ * ENCTYPE_DES_CBC_MD5
37+ * ENCTYPE_DES_CBC_CRC
38+ * ENCTYPE_DES_CBC_MD4
339 */
440 #define KRB5_SUPPORTED_ENCTYPES "18,17,16,23,3,1,2"
41+
42+#endif /* CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES */
43+
44+#endif /* _LINUX_SUNRPC_GSS_KRB5_ENCTYPES_H */
include/linux/sunrpc/xdr.h+19−4
@@ -87,6 +87,16 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 86 unmodified lines
8787 #define xdr_one cpu_to_be32(1)
8888 #define xdr_two cpu_to_be32(2)
8989
90+#define rpc_auth_null cpu_to_be32(RPC_AUTH_NULL)
91+#define rpc_auth_unix cpu_to_be32(RPC_AUTH_UNIX)
92+#define rpc_auth_short cpu_to_be32(RPC_AUTH_SHORT)
93+#define rpc_auth_gss cpu_to_be32(RPC_AUTH_GSS)
94+
95+#define rpc_call cpu_to_be32(RPC_CALL)
96+#define rpc_reply cpu_to_be32(RPC_REPLY)
97+
98+#define rpc_msg_accepted cpu_to_be32(RPC_MSG_ACCEPTED)
99+
90100 #define rpc_success cpu_to_be32(RPC_SUCCESS)
91101 #define rpc_prog_unavail cpu_to_be32(RPC_PROG_UNAVAIL)
92102 #define rpc_prog_mismatch cpu_to_be32(RPC_PROG_MISMATCH)
@@ -95,6 +105,9 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 2 unmodified lines
95105 #define rpc_system_err cpu_to_be32(RPC_SYSTEM_ERR)
96106 #define rpc_drop_reply cpu_to_be32(RPC_DROP_REPLY)
97107
108+#define rpc_mismatch cpu_to_be32(RPC_MISMATCH)
109+#define rpc_auth_error cpu_to_be32(RPC_AUTH_ERROR)
110+
98111 #define rpc_auth_ok cpu_to_be32(RPC_AUTH_OK)
99112 #define rpc_autherr_badcred cpu_to_be32(RPC_AUTH_BADCRED)
100113 #define rpc_autherr_rejectedcred cpu_to_be32(RPC_AUTH_REJECTEDCRED)
@@ -103,7 +116,6 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 2 unmodified lines
103116 #define rpc_autherr_tooweak cpu_to_be32(RPC_AUTH_TOOWEAK)
104117 #define rpcsec_gsserr_credproblem cpu_to_be32(RPCSEC_GSS_CREDPROBLEM)
105118 #define rpcsec_gsserr_ctxproblem cpu_to_be32(RPCSEC_GSS_CTXPROBLEM)
106−#define rpc_autherr_oldseqnum cpu_to_be32(101)
107119
108120 /*
109121 * Miscellaneous XDR helper functions
@@ -167,7 +179,6 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p) · 57 unmodified lines
167179 extern void xdr_shift_buf(struct xdr_buf *, size_t);
168180 extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
169181 extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int);
170−extern void xdr_buf_trim(struct xdr_buf *, unsigned int);
171182 extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int);
172183 extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
173184 extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
@@ -217,6 +228,8 @@ struct xdr_stream { · 43 unmodified lines
217228 struct kvec scratch; /* Scratch buffer */
218229 struct page **page_ptr; /* pointer to the current page */
219230 unsigned int nwords; /* Remaining decode buffer length */
231+
232+ struct rpc_rqst *rqst; /* For debugging */
220233 };
221234
222235 /*
@@ -227,7 +240,8 @@ typedef void (*kxdreproc_t)(struct rpc_rqst *rqstp, struct xdr_stream *xdr, · 4 unmodified lines
227240 typedef int (*kxdrdproc_t)(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
228241 void *obj);
229242
230−extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
243+extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf,
244+ __be32 *p, struct rpc_rqst *rqst);
231245 extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes);
232246 extern void xdr_commit_encode(struct xdr_stream *xdr);
233247 extern void xdr_truncate_encode(struct xdr_stream *xdr, size_t len);
@@ -235,7 +249,8 @@ extern int xdr_restrict_buflen(struct xdr_stream *xdr, int newbuflen); · 1 unmodified line
235249 extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages,
236250 unsigned int base, unsigned int len);
237251 extern unsigned int xdr_stream_pos(const struct xdr_stream *xdr);
238−extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
252+extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf,
253+ __be32 *p, struct rpc_rqst *rqst);
239254 extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf,
240255 struct page **pages, unsigned int len);
241256 extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen);
include/linux/sunrpc/xprt.h+0−7
@@ -196,8 +196,6 @@ struct rpc_xprt { · 195 unmodified lines
196196
197197 size_t max_payload; /* largest RPC payload size,
198198 in bytes */
199− unsigned int tsh_size; /* size of transport specific
200− header */
201199
202200 struct rpc_wait_queue binding; /* requests waiting on rpcbind */
203201 struct rpc_wait_queue sending; /* requests waiting to send */
@@ -362,11 +360,6 @@ struct rpc_xprt * xprt_alloc(struct net *net, size_t size, · 158 unmodified lines
362360 unsigned int max_req);
363361 void xprt_free(struct rpc_xprt *);
364362
365−static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p)
366−{
367− return p + xprt->tsh_size;
368−}
369−
370363 static inline int
371364 xprt_enable_swap(struct rpc_xprt *xprt)
372365 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t