mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Oleg Drokin <oleg.drokin@intel.com>,
	James Simmons <jsimmons@infradead.org>,
	Andreas Dilger <andreas.dilger@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	lustre <lustre-devel@lists.lustre.org>
Subject: [PATCH 21/21] staging: lustre: socklnd: simplify ksnc_rx_iov_space
Date: Tue, 20 Feb 2018 13:23:38 +1100	[thread overview]
Message-ID: <151909341826.25814.3735688359829435395.stgit@noble> (raw)
In-Reply-To: <151909308778.25814.9912662268627044409.stgit@noble>

ksnc_rx_iov_space is currently a union of two arrays,
one of 'struct kvec', the other of 'struct bio_vec'.

The 'struct bio_vec' option is never used.  The
array of kvec is used to read in a packet header, or
to read data that needs to be skipped so as to synchronize
with a packet boundary.
In each case the target memory location is a virtual address,
never a page, so 'struct bio_vec' is never needed.

When we read into a page, different code steps up a separate
array of 'struct bio_vec'.

So remove the bio_vec option, and remove the union ksock_rxiovspace..

Signed-off-by: NeilBrown <neilb@suse.com>
---
 .../staging/lustre/lnet/klnds/socklnd/socklnd.h    |   11 +----------
 .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c |    4 ++--
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
index d50ebdf863fa..570f54ed57b1 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
@@ -304,15 +304,6 @@ struct ksock_tx {			   /* transmit packet */
 
 /* network zero copy callback descriptor embedded in struct ksock_tx */
 
-/*
- * space for the rx frag descriptors; we either read a single contiguous
- * header, or up to LNET_MAX_IOV frags of payload of either type.
- */
-union ksock_rxiovspace {
-	struct kvec      iov[LNET_MAX_IOV];
-	struct bio_vec	kiov[LNET_MAX_IOV];
-};
-
 #define SOCKNAL_RX_KSM_HEADER   1 /* reading ksock message header */
 #define SOCKNAL_RX_LNET_HEADER  2 /* reading lnet message header */
 #define SOCKNAL_RX_PARSE        3 /* Calling lnet_parse() */
@@ -359,7 +350,7 @@ struct ksock_conn {
 	__u8               ksnc_rx_state;     /* what is being read */
 	int                ksnc_rx_nob_left;  /* # bytes to next hdr/body */
 	struct iov_iter    ksnc_rx_to;		/* copy destination */
-	union ksock_rxiovspace ksnc_rx_iov_space; /* space for frag descriptors */
+	struct kvec        ksnc_rx_iov_space[LNET_MAX_IOV]; /* space for frag descriptors */
 	__u32              ksnc_rx_csum;      /* partial checksum for incoming
 					       * data
 					       */
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 6ab002c006ab..036fecbcede8 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -986,7 +986,7 @@ int
 ksocknal_new_packet(struct ksock_conn *conn, int nob_to_skip)
 {
 	static char ksocknal_slop_buffer[4096];
-	struct kvec *kvec = (struct kvec *)&conn->ksnc_rx_iov_space;
+	struct kvec *kvec = conn->ksnc_rx_iov_space;
 
 	int nob;
 	unsigned int niov;
@@ -1059,7 +1059,7 @@ ksocknal_new_packet(struct ksock_conn *conn, int nob_to_skip)
 static int
 ksocknal_process_receive(struct ksock_conn *conn)
 {
-	struct kvec *kvec = (struct kvec *)&conn->ksnc_rx_iov_space;
+	struct kvec *kvec = conn->ksnc_rx_iov_space;
 	struct lnet_hdr *lhdr;
 	struct lnet_process_id *id;
 	int rc;

  parent reply	other threads:[~2018-02-20  2:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20  2:23 [PATCH 00/21] staging: assorted lustre clean-up NeilBrown
2018-02-20  2:23 ` [PATCH 06/21] staging: lustre: simplify linux-prim.c NeilBrown
2018-02-20  2:23 ` [PATCH 04/21] staging: lustre: remove unnecessary cfs_block_allsigs() calls NeilBrown
2018-02-20  2:23 ` [PATCH 08/21] staging: lustre: make signal-blocking functions inline NeilBrown
2018-02-20  2:23 ` [PATCH 11/21] staging: lustre: improve some libcfs_kvzalloc calls NeilBrown
2018-02-20  2:23 ` [PATCH 07/21] staging: lustre: improve API and implementation of blocking signals NeilBrown
2018-02-20  2:23 ` [PATCH 05/21] staging: lustre: lnet: remove cfs_block_allsigs calls NeilBrown
2018-02-20  2:23 ` [PATCH 12/21] staging: lustre: discard libcfs_kvzalloc and linux-mem.c NeilBrown
2018-02-20  2:23 ` [PATCH 10/21] staging: lustre: discard lu_buf allocation library NeilBrown
2018-02-20  2:23 ` [PATCH 09/21] staging: lustre: discard libcfs_kvzalloc_cpt() NeilBrown
2018-02-20  2:23 ` [PATCH 01/21] staging: lustre: replace all CFS_CAP_* macros with CAP_* NeilBrown
2018-02-20  2:23 ` [PATCH 03/21] staging: lustre: remove linux-curproc.c NeilBrown
2018-02-20  2:23 ` [PATCH 02/21] staging: lustre: opencode cfs_cap_{raise, lower, raised} NeilBrown
2018-02-20  2:23 ` [PATCH 18/21] staging: lustre: fid: remove seq_fid_alloc_fini() and simplify NeilBrown
2018-02-20  2:23 ` [PATCH 20/21] staging: lustre: fid: perform sanity checks before commiting NeilBrown
2018-02-20  2:23 ` [PATCH 13/21] staging: lustre: remove phantom struct cfs_crypto_hash_desc NeilBrown
2018-02-20  2:23 ` NeilBrown [this message]
2018-02-20  2:23 ` [PATCH 15/21] staging: lustre: ptlrpc: list_for_each improvements NeilBrown
2018-02-20  2:23 ` [PATCH 17/21] staging: lustre: fid: use wait_event_cmd() NeilBrown
2018-02-20  2:23 ` [PATCH 14/21] staging: lustre: fix assorted checkpatch errors NeilBrown
2018-02-20  8:07   ` [lustre-devel] " Eremin, Dmitry
2018-02-20  8:55     ` NeilBrown
2018-02-20 10:50       ` Eremin, Dmitry
2018-02-20 20:42   ` [PATCH 14/21 - v2] " NeilBrown
2018-02-20  2:23 ` [PATCH 16/21] staging: lustre: fid: convert lcs_mutex to a spinlock NeilBrown
2018-02-20  2:23 ` [PATCH 19/21] staging: lustre: fid: fix up debugfs access to ->lcs_space NeilBrown
2018-02-20  4:18 ` [lustre-devel] [PATCH 00/21] staging: assorted lustre clean-up Patrick Farrell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=151909341826.25814.3735688359829435395.stgit@noble \
    --to=neilb@suse.com \
    --cc=andreas.dilger@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®