All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Drokin <green@linuxhacker.ru>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Oleg Drokin <green@linuxhacker.ru>
Subject: [lustre-devel] [PATCH 01/13] ksocknal_lib_recv_iov(): recvmsg doesn't bugger iovec anymore...
Date: Sat, 20 Aug 2016 17:34:18 -0400	[thread overview]
Message-ID: <1471728870-518753-2-git-send-email-green@linuxhacker.ru> (raw)
In-Reply-To: <1471728870-518753-1-git-send-email-green@linuxhacker.ru>

From: Al Viro <viro@zeniv.linux.org.uk>

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 .../lustre/lnet/klnds/socklnd/socklnd_lib.c        | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c
index fe7b9f9..77bb29ff 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c
@@ -201,14 +201,7 @@ ksocknal_lib_eager_ack(struct ksock_conn *conn)
 int
 ksocknal_lib_recv_iov(struct ksock_conn *conn)
 {
-#if SOCKNAL_SINGLE_FRAG_RX
-	struct kvec scratch;
-	struct kvec *scratchiov = &scratch;
-	unsigned int niov = 1;
-#else
-	struct kvec *scratchiov = conn->ksnc_scheduler->kss_scratch_iov;
 	unsigned int niov = conn->ksnc_rx_niov;
-#endif
 	struct kvec *iov = conn->ksnc_rx_iov;
 	struct msghdr msg = {
 		.msg_flags = 0
@@ -220,20 +213,15 @@ ksocknal_lib_recv_iov(struct ksock_conn *conn)
 	int sum;
 	__u32 saved_csum;
 
-	/*
-	 * NB we can't trust socket ops to either consume our iovs
-	 * or leave them alone.
-	 */
 	LASSERT(niov > 0);
 
-	for (nob = i = 0; i < niov; i++) {
-		scratchiov[i] = iov[i];
-		nob += scratchiov[i].iov_len;
-	}
+	for (nob = i = 0; i < niov; i++)
+		nob += iov[i].iov_len;
+
 	LASSERT(nob <= conn->ksnc_rx_nob_wanted);
 
-	rc = kernel_recvmsg(conn->ksnc_sock, &msg, scratchiov, niov, nob,
-			    MSG_DONTWAIT);
+	iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, iov, niov, nob);
+	rc = sock_recvmsg(conn->ksnc_sock, &msg, MSG_DONTWAIT);
 
 	saved_csum = 0;
 	if (conn->ksnc_proto == &ksocknal_protocol_v2x) {
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: Oleg Drokin <green@linuxhacker.ru>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Oleg Drokin <green@linuxhacker.ru>
Subject: [PATCH 01/13] ksocknal_lib_recv_iov(): recvmsg doesn't bugger iovec anymore...
Date: Sat, 20 Aug 2016 17:34:18 -0400	[thread overview]
Message-ID: <1471728870-518753-2-git-send-email-green@linuxhacker.ru> (raw)
In-Reply-To: <1471728870-518753-1-git-send-email-green@linuxhacker.ru>

From: Al Viro <viro@zeniv.linux.org.uk>

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 .../lustre/lnet/klnds/socklnd/socklnd_lib.c        | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c
index fe7b9f9..77bb29ff 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c
@@ -201,14 +201,7 @@ ksocknal_lib_eager_ack(struct ksock_conn *conn)
 int
 ksocknal_lib_recv_iov(struct ksock_conn *conn)
 {
-#if SOCKNAL_SINGLE_FRAG_RX
-	struct kvec scratch;
-	struct kvec *scratchiov = &scratch;
-	unsigned int niov = 1;
-#else
-	struct kvec *scratchiov = conn->ksnc_scheduler->kss_scratch_iov;
 	unsigned int niov = conn->ksnc_rx_niov;
-#endif
 	struct kvec *iov = conn->ksnc_rx_iov;
 	struct msghdr msg = {
 		.msg_flags = 0
@@ -220,20 +213,15 @@ ksocknal_lib_recv_iov(struct ksock_conn *conn)
 	int sum;
 	__u32 saved_csum;
 
-	/*
-	 * NB we can't trust socket ops to either consume our iovs
-	 * or leave them alone.
-	 */
 	LASSERT(niov > 0);
 
-	for (nob = i = 0; i < niov; i++) {
-		scratchiov[i] = iov[i];
-		nob += scratchiov[i].iov_len;
-	}
+	for (nob = i = 0; i < niov; i++)
+		nob += iov[i].iov_len;
+
 	LASSERT(nob <= conn->ksnc_rx_nob_wanted);
 
-	rc = kernel_recvmsg(conn->ksnc_sock, &msg, scratchiov, niov, nob,
-			    MSG_DONTWAIT);
+	iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, iov, niov, nob);
+	rc = sock_recvmsg(conn->ksnc_sock, &msg, MSG_DONTWAIT);
 
 	saved_csum = 0;
 	if (conn->ksnc_proto == &ksocknal_protocol_v2x) {
-- 
2.7.4

  reply	other threads:[~2016-08-20 21:34 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-20 21:34 [lustre-devel] [PATCH 00/13] Lustre patches Oleg Drokin
2016-08-20 21:34 ` Oleg Drokin
2016-08-20 21:34 ` Oleg Drokin [this message]
2016-08-20 21:34   ` [PATCH 01/13] ksocknal_lib_recv_iov(): recvmsg doesn't bugger iovec anymore Oleg Drokin
2016-08-20 21:34 ` [lustre-devel] [PATCH 02/13] ksocknal_lib_send_iov(): sendmsg doesn't bugger iovec Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin
2016-08-20 21:34 ` [lustre-devel] [PATCH 03/13] ksocknal_lib_send_kiov(): " Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin
2016-08-20 21:34 ` [lustre-devel] [PATCH 04/13] lustre: ->kss_scratch... are unused now Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin
2016-08-20 21:34 ` [lustre-devel] [PATCH 05/13] lustre: constify lib-move.c stuff Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin
2016-08-20 21:34 ` [lustre-devel] [PATCH 06/13] lustre: pass iov_iter to ->lnd_recv() Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin
2016-08-20 21:34 ` [lustre-devel] [PATCH 07/13] lustre: introduce lnet_copy_{k, }iov2iter(), kill lnet_copy_{k, }iov2{k, }iov() Oleg Drokin
2016-08-20 21:34   ` [PATCH 07/13] lustre: introduce lnet_copy_{k,}iov2iter(), kill lnet_copy_{k,}iov2{k,}iov() Oleg Drokin
2016-08-20 21:34 ` [lustre-devel] [PATCH 08/13] staging/lustre: Always return EEXIST on mkdir for existing names Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin
2016-08-20 21:34 ` [lustre-devel] [PATCH 09/13] staging/lustre: Add spaces preferred around that '{+, -, *, /, |, <<, >>, &}' Oleg Drokin
2016-08-20 21:34   ` [PATCH 09/13] staging/lustre: Add spaces preferred around that '{+,-,*,/,|,<<,>>,&}' Oleg Drokin
2016-08-21 14:11   ` [lustre-devel] [PATCH 09/13] staging/lustre: Add spaces preferred around that '{+, -, *, /, |, <<, >>, &}' Greg Kroah-Hartman
2016-08-21 14:11     ` Greg Kroah-Hartman
2016-08-20 21:34 ` [lustre-devel] [PATCH 10/13] staging/lustre: Fix unnecessary parentheses around variables Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin
2016-08-20 21:34 ` [lustre-devel] [PATCH 11/13] staging/lustre: Make alignment match open parenthesis Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin
2016-08-21 14:35   ` [lustre-devel] " Greg Kroah-Hartman
2016-08-21 14:35     ` Greg Kroah-Hartman
2016-08-20 21:34 ` [lustre-devel] [PATCH 12/13] staging/lustre: Remove unused cp_error from struct cl_page Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin
2016-08-21 14:36   ` [lustre-devel] " Greg Kroah-Hartman
2016-08-21 14:36     ` Greg Kroah-Hartman
2016-08-20 21:34 ` [lustre-devel] [PATCH 13/13] Add James Simmons as another Lustre maintainer Oleg Drokin
2016-08-20 21:34   ` Oleg Drokin

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=1471728870-518753-2-git-send-email-green@linuxhacker.ru \
    --to=green@linuxhacker.ru \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.