* [PATCH v2 06/18] rxrpc: make the users of rxrpc_kernel_send_data() set kvec-backed msg_iter properly
From: Al Viro @ 2015-02-02 7:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20150131035513.GK29656@ZenIV.linux.org.uk>
From: Al Viro <viro@zeniv.linux.org.uk>
Use iov_iter_kvec() there, get rid of set_fs() games - now that
rxrpc_send_data() uses iov_iter primitives, it'll handle ITER_KVEC just
fine.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/afs/rxrpc.c | 14 +++++++-------
net/rxrpc/ar-output.c | 3 ---
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 06e14bf..dbc732e 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -306,8 +306,8 @@ static int afs_send_pages(struct afs_call *call, struct msghdr *msg,
_debug("- range %u-%u%s",
offset, to, msg->msg_flags ? " [more]" : "");
- iov_iter_init(&msg->msg_iter, WRITE,
- (struct iovec *) iov, 1, to - offset);
+ iov_iter_kvec(&msg->msg_iter, WRITE | ITER_KVEC,
+ iov, 1, to - offset);
/* have to change the state *before* sending the last
* packet as RxRPC might give us the reply before it
@@ -384,7 +384,7 @@ int afs_make_call(struct in_addr *addr, struct afs_call *call, gfp_t gfp,
msg.msg_name = NULL;
msg.msg_namelen = 0;
- iov_iter_init(&msg.msg_iter, WRITE, (struct iovec *)iov, 1,
+ iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, iov, 1,
call->request_size);
msg.msg_control = NULL;
msg.msg_controllen = 0;
@@ -770,7 +770,7 @@ static int afs_deliver_cm_op_id(struct afs_call *call, struct sk_buff *skb,
void afs_send_empty_reply(struct afs_call *call)
{
struct msghdr msg;
- struct iovec iov[1];
+ struct kvec iov[1];
_enter("");
@@ -778,7 +778,7 @@ void afs_send_empty_reply(struct afs_call *call)
iov[0].iov_len = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
- iov_iter_init(&msg.msg_iter, WRITE, iov, 0, 0); /* WTF? */
+ iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, iov, 0, 0); /* WTF? */
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
@@ -805,7 +805,7 @@ void afs_send_empty_reply(struct afs_call *call)
void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len)
{
struct msghdr msg;
- struct iovec iov[1];
+ struct kvec iov[1];
int n;
_enter("");
@@ -814,7 +814,7 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len)
iov[0].iov_len = len;
msg.msg_name = NULL;
msg.msg_namelen = 0;
- iov_iter_init(&msg.msg_iter, WRITE, iov, 1, len);
+ iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, iov, 1, len);
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
index 963a5b9..8331c95 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
@@ -232,10 +232,7 @@ int rxrpc_kernel_send_data(struct rxrpc_call *call, struct msghdr *msg,
call->state != RXRPC_CALL_SERVER_SEND_REPLY) {
ret = -EPROTO; /* request phase complete for this client call */
} else {
- mm_segment_t oldfs = get_fs();
- set_fs(KERNEL_DS);
ret = rxrpc_send_data(NULL, call->socket, call, msg, len);
- set_fs(oldfs);
}
release_sock(&call->socket->sk);
--
2.1.4
^ permalink raw reply related
* [PATCH v2 05/18] rxrpc: switch rxrpc_send_data() to iov_iter primitives
From: Al Viro @ 2015-02-02 7:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20150131035513.GK29656@ZenIV.linux.org.uk>
From: Al Viro <viro@zeniv.linux.org.uk>
Convert skb_add_data() to iov_iter; allows to get rid of the explicit
messing with iovec in its only caller - skb_add_data() will keep advancing
->msg_iter for us, so there's no need to similate that manually.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
include/linux/skbuff.h | 11 +++++------
net/rxrpc/ar-output.c | 43 ++++++++++---------------------------------
2 files changed, 15 insertions(+), 39 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 85ab7d7..9a8bafe 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2484,19 +2484,18 @@ static inline int skb_put_padto(struct sk_buff *skb, unsigned int len)
}
static inline int skb_add_data(struct sk_buff *skb,
- char __user *from, int copy)
+ struct iov_iter *from, int copy)
{
const int off = skb->len;
if (skb->ip_summed == CHECKSUM_NONE) {
- int err = 0;
- __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy),
- copy, 0, &err);
- if (!err) {
+ __wsum csum = 0;
+ if (csum_and_copy_from_iter(skb_put(skb, copy), copy,
+ &csum, from) == copy) {
skb->csum = csum_block_add(skb->csum, csum, off);
return 0;
}
- } else if (!copy_from_user(skb_put(skb, copy), from, copy))
+ } else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy)
return 0;
__skb_trim(skb, off);
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
index e1a9373..963a5b9 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
@@ -529,13 +529,11 @@ static int rxrpc_send_data(struct kiocb *iocb,
struct msghdr *msg, size_t len)
{
struct rxrpc_skb_priv *sp;
- unsigned char __user *from;
struct sk_buff *skb;
- const struct iovec *iov;
struct sock *sk = &rx->sk;
long timeo;
bool more;
- int ret, ioc, segment, copied;
+ int ret, copied;
timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
@@ -545,25 +543,17 @@ static int rxrpc_send_data(struct kiocb *iocb,
if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
return -EPIPE;
- iov = msg->msg_iter.iov;
- ioc = msg->msg_iter.nr_segs - 1;
- from = iov->iov_base;
- segment = iov->iov_len;
- iov++;
more = msg->msg_flags & MSG_MORE;
skb = call->tx_pending;
call->tx_pending = NULL;
copied = 0;
- do {
+ if (len > iov_iter_count(&msg->msg_iter))
+ len = iov_iter_count(&msg->msg_iter);
+ while (len) {
int copy;
- if (segment > len)
- segment = len;
-
- _debug("SEGMENT %d @%p", segment, from);
-
if (!skb) {
size_t size, chunk, max, space;
@@ -631,13 +621,13 @@ static int rxrpc_send_data(struct kiocb *iocb,
/* append next segment of data to the current buffer */
copy = skb_tailroom(skb);
ASSERTCMP(copy, >, 0);
- if (copy > segment)
- copy = segment;
+ if (copy > len)
+ copy = len;
if (copy > sp->remain)
copy = sp->remain;
_debug("add");
- ret = skb_add_data(skb, from, copy);
+ ret = skb_add_data(skb, &msg->msg_iter, copy);
_debug("added");
if (ret < 0)
goto efault;
@@ -646,18 +636,6 @@ static int rxrpc_send_data(struct kiocb *iocb,
copied += copy;
len -= copy;
- segment -= copy;
- from += copy;
- while (segment == 0 && ioc > 0) {
- from = iov->iov_base;
- segment = iov->iov_len;
- iov++;
- ioc--;
- }
- if (len == 0) {
- segment = 0;
- ioc = 0;
- }
/* check for the far side aborting the call or a network error
* occurring */
@@ -665,7 +643,7 @@ static int rxrpc_send_data(struct kiocb *iocb,
goto call_aborted;
/* add the packet to the send queue if it's now full */
- if (sp->remain <= 0 || (segment == 0 && !more)) {
+ if (sp->remain <= 0 || (!len && !more)) {
struct rxrpc_connection *conn = call->conn;
uint32_t seq;
size_t pad;
@@ -711,11 +689,10 @@ static int rxrpc_send_data(struct kiocb *iocb,
memcpy(skb->head, &sp->hdr,
sizeof(struct rxrpc_header));
- rxrpc_queue_packet(call, skb, segment == 0 && !more);
+ rxrpc_queue_packet(call, skb, !iov_iter_count(&msg->msg_iter) && !more);
skb = NULL;
}
-
- } while (segment > 0);
+ }
success:
ret = copied;
--
2.1.4
^ permalink raw reply related
* [PATCH v2 07/18] ip: stash a pointer to msghdr in struct ping_fakehdr
From: Al Viro @ 2015-02-02 7:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20150131035513.GK29656@ZenIV.linux.org.uk>
From: Al Viro <viro@zeniv.linux.org.uk>
... instead of storing its ->mgs_iter.iov there
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
include/net/ping.h | 2 +-
net/ipv4/ping.c | 7 +++----
net/ipv6/ping.c | 3 +--
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/include/net/ping.h b/include/net/ping.h
index f074060..cc16d41 100644
--- a/include/net/ping.h
+++ b/include/net/ping.h
@@ -59,7 +59,7 @@ extern struct pingv6_ops pingv6_ops;
struct pingfakehdr {
struct icmphdr icmph;
- struct iovec *iov;
+ struct msghdr *msg;
sa_family_t family;
__wsum wcheck;
};
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 2a3720f..9e15ba7 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -602,14 +602,14 @@ int ping_getfrag(void *from, char *to,
if (fraglen < sizeof(struct icmphdr))
BUG();
if (csum_partial_copy_fromiovecend(to + sizeof(struct icmphdr),
- pfh->iov, 0, fraglen - sizeof(struct icmphdr),
+ pfh->msg->msg_iter.iov, 0, fraglen - sizeof(struct icmphdr),
&pfh->wcheck))
return -EFAULT;
} else if (offset < sizeof(struct icmphdr)) {
BUG();
} else {
if (csum_partial_copy_fromiovecend
- (to, pfh->iov, offset - sizeof(struct icmphdr),
+ (to, pfh->msg->msg_iter.iov, offset - sizeof(struct icmphdr),
fraglen, &pfh->wcheck))
return -EFAULT;
}
@@ -811,8 +811,7 @@ back_from_confirm:
pfh.icmph.checksum = 0;
pfh.icmph.un.echo.id = inet->inet_sport;
pfh.icmph.un.echo.sequence = user_icmph.un.echo.sequence;
- /* XXX: stripping const */
- pfh.iov = (struct iovec *)msg->msg_iter.iov;
+ pfh.msg = msg;
pfh.wcheck = 0;
pfh.family = AF_INET;
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index 2d31483..bd46f73 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -163,8 +163,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
pfh.icmph.checksum = 0;
pfh.icmph.un.echo.id = inet->inet_sport;
pfh.icmph.un.echo.sequence = user_icmph.icmp6_sequence;
- /* XXX: stripping const */
- pfh.iov = (struct iovec *)msg->msg_iter.iov;
+ pfh.msg = msg;
pfh.wcheck = 0;
pfh.family = AF_INET6;
--
2.1.4
^ permalink raw reply related
* [PATCH v2 04/18] vmci: propagate msghdr all way down to __qp_memcpy_to_queue()
From: Al Viro @ 2015-02-02 7:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20150131035513.GK29656@ZenIV.linux.org.uk>
From: Al Viro <viro@zeniv.linux.org.uk>
Switch from passing msg->iov_iter.iov to passing msg itself
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
drivers/misc/vmw_vmci/vmci_queue_pair.c | 16 ++++++++--------
include/linux/vmw_vmci_api.h | 2 +-
net/vmw_vsock/vmci_transport.c | 3 +--
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c
index 7aaaf51..35f19a6 100644
--- a/drivers/misc/vmw_vmci/vmci_queue_pair.c
+++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c
@@ -370,12 +370,12 @@ static int __qp_memcpy_to_queue(struct vmci_queue *queue,
to_copy = size - bytes_copied;
if (is_iovec) {
- struct iovec *iov = (struct iovec *)src;
+ struct msghdr *msg = (struct msghdr *)src;
int err;
/* The iovec will track bytes_copied internally. */
- err = memcpy_fromiovec((u8 *)va + page_offset,
- iov, to_copy);
+ err = memcpy_from_msg((u8 *)va + page_offset,
+ msg, to_copy);
if (err != 0) {
if (kernel_if->host)
kunmap(kernel_if->u.h.page[page_index]);
@@ -580,7 +580,7 @@ static int qp_memcpy_from_queue(void *dest,
*/
static int qp_memcpy_to_queue_iov(struct vmci_queue *queue,
u64 queue_offset,
- const void *src,
+ const void *msg,
size_t src_offset, size_t size)
{
@@ -588,7 +588,7 @@ static int qp_memcpy_to_queue_iov(struct vmci_queue *queue,
* We ignore src_offset because src is really a struct iovec * and will
* maintain offset internally.
*/
- return __qp_memcpy_to_queue(queue, queue_offset, src, size, true);
+ return __qp_memcpy_to_queue(queue, queue_offset, msg, size, true);
}
/*
@@ -3223,13 +3223,13 @@ EXPORT_SYMBOL_GPL(vmci_qpair_peek);
* of bytes enqueued or < 0 on error.
*/
ssize_t vmci_qpair_enquev(struct vmci_qp *qpair,
- void *iov,
+ struct msghdr *msg,
size_t iov_size,
int buf_type)
{
ssize_t result;
- if (!qpair || !iov)
+ if (!qpair)
return VMCI_ERROR_INVALID_ARGS;
qp_lock(qpair);
@@ -3238,7 +3238,7 @@ ssize_t vmci_qpair_enquev(struct vmci_qp *qpair,
result = qp_enqueue_locked(qpair->produce_q,
qpair->consume_q,
qpair->produce_q_size,
- iov, iov_size,
+ msg, iov_size,
qp_memcpy_to_queue_iov);
if (result == VMCI_ERROR_QUEUEPAIR_NOT_READY &&
diff --git a/include/linux/vmw_vmci_api.h b/include/linux/vmw_vmci_api.h
index 5691f75..63df3a2a 100644
--- a/include/linux/vmw_vmci_api.h
+++ b/include/linux/vmw_vmci_api.h
@@ -74,7 +74,7 @@ ssize_t vmci_qpair_dequeue(struct vmci_qp *qpair,
ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size,
int mode);
ssize_t vmci_qpair_enquev(struct vmci_qp *qpair,
- void *iov, size_t iov_size, int mode);
+ struct msghdr *msg, size_t iov_size, int mode);
ssize_t vmci_qpair_dequev(struct vmci_qp *qpair,
struct msghdr *msg, size_t iov_size, int mode);
ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, struct msghdr *msg, size_t iov_size,
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
index 02d2e52..7f32550 100644
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -1850,8 +1850,7 @@ static ssize_t vmci_transport_stream_enqueue(
struct msghdr *msg,
size_t len)
{
- /* XXX: stripping const */
- return vmci_qpair_enquev(vmci_trans(vsk)->qpair, (struct iovec *)msg->msg_iter.iov, len, 0);
+ return vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0);
}
static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk)
--
2.1.4
^ permalink raw reply related
* [PATCH v2 03/18] ipv6: rawv6_send_hdrinc(): pass msghdr
From: Al Viro @ 2015-02-02 7:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20150131035513.GK29656@ZenIV.linux.org.uk>
From: Al Viro <viro@zeniv.linux.org.uk>
Switch from passing msg->iov_iter.iov to passing msg itself
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
net/ipv6/raw.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index ee25631..0dbb328 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -609,7 +609,7 @@ out:
return err;
}
-static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
+static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,
struct flowi6 *fl6, struct dst_entry **dstp,
unsigned int flags)
{
@@ -648,7 +648,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
skb->ip_summed = CHECKSUM_NONE;
skb->transport_header = skb->network_header;
- err = memcpy_fromiovecend((void *)iph, from, 0, length);
+ err = memcpy_fromiovecend((void *)iph, msg->msg_iter.iov, 0, length);
if (err)
goto error_fault;
@@ -886,8 +886,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
back_from_confirm:
if (inet->hdrincl)
- /* XXX: stripping const */
- err = rawv6_send_hdrinc(sk, (struct iovec *)msg->msg_iter.iov, len, &fl6, &dst, msg->msg_flags);
+ err = rawv6_send_hdrinc(sk, msg, len, &fl6, &dst, msg->msg_flags);
else {
lock_sock(sk);
err = ip6_append_data(sk, raw6_getfrag, &rfv,
--
2.1.4
^ permalink raw reply related
* [PATCH v2 01/18] netlink: make the check for "send from tx_ring" deterministic
From: Al Viro @ 2015-02-02 7:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20150131035513.GK29656@ZenIV.linux.org.uk>
From: Al Viro <viro@zeniv.linux.org.uk>
As it is, zero msg_iovlen means that the first iovec in the kernel
array of iovecs is left uninitialized, so checking if its ->iov_base
is NULL is random. Since the real users of that thing are doing
sendto(fd, NULL, 0, ...), they are getting msg_iovlen = 1 and
msg_iov[0] = {NULL, 0}, which is what this test is trying to catch.
As suggested by davem, let's just check that msg_iovlen was 1 and
msg_iov[0].iov_base was NULL - _that_ is well-defined and it catches
what we want to catch.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
net/netlink/af_netlink.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index a36777b..af51d58 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2298,7 +2298,11 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
goto out;
}
+ /* It's a really convoluted way for userland to ask for mmaped
+ * sendmsg(), but that's what we've got... */
if (netlink_tx_is_mmaped(sk) &&
+ msg->msg_iter.type == ITER_IOVEC &&
+ msg->msg_iter.nr_segs == 1 &&
msg->msg_iter.iov->iov_base == NULL) {
err = netlink_mmap_sendmsg(sk, msg, dst_portid, dst_group,
&scm);
--
2.1.4
^ permalink raw reply related
* [PATCH v2 02/18] ipv4: raw_send_hdrinc(): pass msghdr
From: Al Viro @ 2015-02-02 7:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20150131035513.GK29656@ZenIV.linux.org.uk>
From: Al Viro <viro@zeniv.linux.org.uk>
Switch from passing msg->iov_iter.iov to passing msg itself
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
net/ipv4/raw.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 0bb68df..2c9d252 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -337,7 +337,7 @@ int raw_rcv(struct sock *sk, struct sk_buff *skb)
}
static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
- void *from, size_t length,
+ struct msghdr *msg, size_t length,
struct rtable **rtp,
unsigned int flags)
{
@@ -382,7 +382,7 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
skb->transport_header = skb->network_header;
err = -EFAULT;
- if (memcpy_fromiovecend((void *)iph, from, 0, length))
+ if (memcpy_fromiovecend((void *)iph, msg->msg_iter.iov, 0, length))
goto error_free;
iphlen = iph->ihl * 4;
@@ -625,8 +625,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
back_from_confirm:
if (inet->hdrincl)
- /* XXX: stripping const */
- err = raw_send_hdrinc(sk, &fl4, (struct iovec *)msg->msg_iter.iov, len,
+ err = raw_send_hdrinc(sk, &fl4, msg, len,
&rt, msg->msg_flags);
else {
--
2.1.4
^ permalink raw reply related
* [PATCH v2 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()
From: Al Viro @ 2015-02-02 7:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Michael S. Tsirkin, Nicholas A. Bellinger, kvm
In-Reply-To: <20150131035513.GK29656@ZenIV.linux.org.uk>
From: Al Viro <viro@zeniv.linux.org.uk>
it has just verified that it asks no more than the length of the
first segment of iovec.
And with that the last user of stuff in lib/iovec.c is gone.
RIP.
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
Cc: kvm@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
drivers/vhost/scsi.c | 2 +-
include/linux/uio.h | 2 --
lib/Makefile | 2 +-
lib/iovec.c | 36 ------------------------------------
4 files changed, 2 insertions(+), 40 deletions(-)
delete mode 100644 lib/iovec.c
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index d695b16..dc78d87 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1079,7 +1079,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
req_size, vq->iov[0].iov_len);
break;
}
- ret = memcpy_fromiovecend(req, &vq->iov[0], 0, req_size);
+ ret = copy_from_user(req, vq->iov[0].iov_base, req_size);
if (unlikely(ret)) {
vq_err(vq, "Faulted on virtio_scsi_cmd_req\n");
break;
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 02bd8a9..3e0cb4e 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -135,6 +135,4 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count)
size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
-int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
- int offset, int len);
#endif
diff --git a/lib/Makefile b/lib/Makefile
index 3c3b30b..1071d06 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -24,7 +24,7 @@ obj-y += lockref.o
obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
- gcd.o lcm.o list_sort.o uuid.o flex_array.o iovec.o clz_ctz.o \
+ gcd.o lcm.o list_sort.o uuid.o flex_array.o clz_ctz.o \
bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \
percpu-refcount.o percpu_ida.o rhashtable.o reciprocal_div.o
obj-y += string_helpers.o
diff --git a/lib/iovec.c b/lib/iovec.c
deleted file mode 100644
index d8f17a9..0000000
--- a/lib/iovec.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <linux/uaccess.h>
-#include <linux/export.h>
-#include <linux/uio.h>
-
-/*
- * Copy iovec to kernel. Returns -EFAULT on error.
- */
-
-int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
- int offset, int len)
-{
- /* No data? Done! */
- if (len == 0)
- return 0;
-
- /* Skip over the finished iovecs */
- while (offset >= iov->iov_len) {
- offset -= iov->iov_len;
- iov++;
- }
-
- while (len > 0) {
- u8 __user *base = iov->iov_base + offset;
- int copy = min_t(unsigned int, len, iov->iov_len - offset);
-
- offset = 0;
- if (copy_from_user(kdata, base, copy))
- return -EFAULT;
- len -= copy;
- kdata += copy;
- iov++;
- }
-
- return 0;
-}
-EXPORT_SYMBOL(memcpy_fromiovecend);
--
2.1.4
^ permalink raw reply related
* Re: [PATCH] tun: orphan an skb on tx
From: David Woodhouse @ 2015-02-02 7:27 UTC (permalink / raw)
To: David Miller
Cc: mst, herbert, eric.dumazet, jan.kiszka, netdev, linux-kernel,
qemu-devel
In-Reply-To: <20150201.210716.588479604128207372.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 2997 bytes --]
On Sun, 2015-02-01 at 21:07 -0800, David Miller wrote:
> From: David Woodhouse <dwmw2@infradead.org>
> Date: Sun, 01 Feb 2015 21:29:43 +0000
>
> > I really was looking for some way to push down something like an XFRM
> > state into the tun device and just say "shove them out here until I tell
> > you otherwise".
>
> People decided to use TUN and push VPN stuff back into userspace,
> and there are repercussions for that decision.
>
> I'm not saying this to be mean or whatever, but I was very
> disappointed when userland IPSEC solutions using TUN started showing
> up.
Yeah. That's a valid criticism of vpnc, certainly. I never did
understand why it reimplemented the IPSec stack.
For my OpenConnect client it's somewhat more justified though — the
initial data transport there is over TLS, which the kernel doesn't
support. And if we *can* establish UDP communication, that's over DTLS
which the kernel doesn't support either. It's not even the *standard*
version of DTLS because Cisco are still using a pre-RFC4347 version of
the protocol. And we also need to probe the UDP connectivity and do
keepalives and manage the fallback to using the TCP data transport.
It's not like vpnc where it really is just a case of setting up the ESP
context and letting it run.
It's only now I've added Juniper support, which uses ESP-in-UDP for the
data transport, that I'm doing something that the kernel supports at
all. And now I'm looking at how to make use of that.
> We might as well have not have implemented the IPSEC stack at all,
> because as a result of the userland VPN stuff our IPSEC stack is
> largely unused except by a very narrow group of users.
Well, I'd love to make better use of it if I can. I do suspect it makes
most sense for userspace to continue to manage the probing of UDP
connectivity, and the fallback to TCP mode — and I suspect it also makes
sense to continue to use tun for passing packets up to the VPN client
when it's using the TCP transport.
So the question would be how we handle redirecting the packet flow to
the optional UDP transport, when the VPN client determines that it's
available. For the sake of the user setting up firewall and routing
rules, I do think it's important that it continues to appear to
userspace as the *same* device for the entire lifetime of the session,
regardless of which transport the packets happen to be using at a given
moment in time. It doesn't *have* to be tun, though.
You don't seem to like my suggestion of somehow pushing down an XFRM
state to the tun device to direct the packets out there instead of up to
userspace. Do you have an alternative suggestion... or a specific
concern that would help me come up with something you like better?
I'm guessing you don't want to push the *whole* management of the TLS
control connection *and* the UDP transport, and probing the latter with
keepalives, into the kernel? I certainly don't :)
--
dwmw2
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5745 bytes --]
^ permalink raw reply
* Re: [PATCH] net: rocker: Add support for retrieving port level statistics
From: David Miller @ 2015-02-02 7:17 UTC (permalink / raw)
To: dsahern; +Cc: netdev, sfeldma
In-Reply-To: <1422590373-22807-1-git-send-email-dsahern@gmail.com>
From: David Ahern <dsahern@gmail.com>
Date: Thu, 29 Jan 2015 20:59:33 -0700
> Add support for retrieving port level statistics from device.
> Hook is added for ethtool's stats functionality. For example,
>
> $ ethtool -S eth3
> NIC statistics:
> rx_packets: 12
> rx_bytes: 2790
> rx_dropped: 0
> rx_errors: 0
> tx_packets: 8
> tx_bytes: 728
> tx_dropped: 0
> tx_errors: 0
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net-next v4 0/7] switchdev offload flags
From: David Miller @ 2015-02-02 7:16 UTC (permalink / raw)
To: roopa
Cc: jiri, sfeldma, jhs, bcrl, tgraf, john.fastabend, stephen,
vyasevic, ronen.arad, netdev, shm, gospo
In-Reply-To: <1422600017-42393-1-git-send-email-roopa@cumulusnetworks.com>
From: roopa@cumulusnetworks.com
Date: Thu, 29 Jan 2015 22:40:10 -0800
> This patch series introduces new offload flags for switchdev.
> Kernel network subsystems can use this flag to accelerate
> network functions by offloading to hw.
Series applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH v2] stmmac: DMA threshold mode or SF mode can be different among multiple device instance
From: David Miller @ 2015-02-02 7:14 UTC (permalink / raw)
To: sonic.adi; +Cc: peppe.cavallaro, netdev, adi-buildroot-devel, sonic.zhang
In-Reply-To: <1422596972-18559-1-git-send-email-sonic.adi@gmail.com>
From: Sonic Zhang <sonic.adi@gmail.com>
Date: Fri, 30 Jan 2015 13:49:32 +0800
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> - In tx_hard_error_bump_tc interrupt, tc should be bumped only when current
> device instance is in DMA threshold mode. Check per device xstats.threshold
> other than global tc.
>
> - Set per device xstats.threshold to SF_DMA_MODE when current device
> instance is set to SF mode.
>
> v2-changes:
> - fix ident style
>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: Fwd: Throughput regression with `tcp: refine TSO autosizing`
From: David Lang @ 2015-02-02 7:07 UTC (permalink / raw)
To: Avery Pennarun
Cc: dstanley, Andrew McGregor, Stig Thormodsrud, netdev,
linux-wireless, Jesper Dangaard Brouer, Derrick Pallas,
Matt Mathis, cerowrt-devel@lists.bufferbloat.net, Jonathan Morton,
Mahesh Paolini-Subramanya, Kathy Giori, Tim Shepard
In-Reply-To: <CAPp0ZBa43kVBWN5iGgmW=-YQAkdm2DrmMN0URvVu=yXA-_TZCQ@mail.gmail.com>
On Sun, 1 Feb 2015, Avery Pennarun wrote:
> On Sun, Feb 1, 2015 at 9:43 AM, <dpreed@reed.com> wrote:
>> I personally think that things like promoting semi-closed, essentially
>> proprietary ESSID-based bridged distribution systems as "good ideas" are
>> counterproductive to this goal. But that's perhaps too radical for this
>> crowd.
>
> Not sure what you mean here. ESSID-based distribution systems seem
> pretty well defined to me. The only proprietary part is the
> decision-making process for assisted roaming (ie. the "inter-AP
> protocol") which is only an optional performance optimization. There
> really should be an open source version of this, and I'm in fact
> feebly attempting to build one, but I don't feel like the world is
> falling apart through not having it. You can build a bridged
> multi-BSS ESSID today with plain out-of-the-box hostapd.
I will be running a fully opensource bridged ESSID system at SCaLE this month.
last year we had ~2500 people and devices with ~50 APs deployed, and it worked
well. The only problem was that I needed to deploy a few more APs to cover some
of the hallway areas more reliably.
There are tricks that the commercial systems pull that I can't currently
duplicate with opensource tools. But as Avery says, they are optimizations, not
something required for successful operation. It would be nice to get the
assisted roaming portion available. But it's not required.
David Lang
^ permalink raw reply
* Re: [PATCH] ipv4: tcp: get rid of ugly unicast_sock
From: David Miller @ 2015-02-02 7:06 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1422596105.21689.66.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 29 Jan 2015 21:35:05 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> In commit be9f4a44e7d41 ("ipv4: tcp: remove per net tcp_sock")
> I tried to address contention on a socket lock, but the solution
> I chose was horrible :
>
> commit 3a7c384ffd57e ("ipv4: tcp: unicast_sock should not land outside
> of TCP stack") addressed a selinux regression.
>
> commit 0980e56e506b ("ipv4: tcp: set unicast_sock uc_ttl to -1")
> took care of another regression.
>
> commit b5ec8eeac46 ("ipv4: fix ip_send_skb()") fixed another regression.
>
> commit 811230cd85 ("tcp: ipv4: initialize unicast_sock sk_pacing_rate")
> was another shot in the dark.
>
> Really, just use a proper socket per cpu, and remove the skb_orphan()
> call, to re-enable flow control.
>
> This solves a serious problem with FQ packet scheduler when used in
> hostile environments, as we do not want to allocate a flow structure
> for every RST packet sent in response to a spoofed packet.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: [RFC][PATCHSET] more iov_iter conversion in net/*
From: David Miller @ 2015-02-02 7:05 UTC (permalink / raw)
To: viro; +Cc: netdev
In-Reply-To: <20150202065339.GU29656@ZenIV.linux.org.uk>
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: Mon, 2 Feb 2015 06:53:39 +0000
> Point... Are you OK with tcp_send_syn_data() change in 8/18? Basically,
> tcp_sendmsg() treats short copy from userland as "send as much as we can,
> stop at the first point where copy_from_user() fails", same as write(),
> etc.; that much is unchanged, but the current mainline has a strange behaviour
> in case when short copy happens within what would be packed into SYN packet -
> if that happens, it still sends as much as possible, but it falls back to
> separate SYN. With this patch it simply sends shorter SYN+data packet instead.
> The reason I went that way is that I wanted to avoid copying the same data
> from userland twice and it was easy to do; I can preserve the current mainline
> behaviour, but it'll cost making a backup copy of ->msg_iter in
> tcp_send_syn_data(), only to never use it in normal case *and* do piles
> of extra work (extra packet to send, repeated copying from userland) in case
> of short copy. Is there any reason not to combine SYN+data in case of short
> copy? Again, we do send exact same data, return the same value, etc. - you
> need tcpdump to see the difference.
I think dropping down to plain SYN in the short copy case was just based
upon a blanket decision to not do SYN+DATA if anything out of the
ordinary happens, rathe than an explicit policy decision. So that change
should be OK.
^ permalink raw reply
* Re: [RFC][PATCHSET] more iov_iter conversion in net/*
From: Al Viro @ 2015-02-02 6:53 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20150201.222646.1280320067605385223.davem@davemloft.net>
On Sun, Feb 01, 2015 at 10:26:46PM -0800, David Miller wrote:
> From: Al Viro <viro@ZenIV.linux.org.uk>
> Date: Sat, 31 Jan 2015 03:55:13 +0000
>
> > ->sendmsg() side of that business, now. By the end of it, we
> > get all ->sendmsg() instances leaving iovec unchanged and ->msg_iter -
> > drained.
> ...
> > The pile after that one will be dealing with the kernel_sendmsg and
> > kernel_recvmg callers - at that point we can start reaping benefits of
> > consistent way ->msg_iter is handled. Note that after these changes if
> > iov_iter_kvec() is used to initialize ->msg_iter, we don't need the games
> > with get_fs()/set_fs() anymore; just sock_sendmsg()/sock_recvmsg() will do,
> > so quite a few of those kernel_{send,recv}msg() callers will turn into
> > sock_{send,recv}msg() ones.
>
> The content of this series looks fine, but I really would like you
> to put proper "subsystem: " prefixes into the commit log header
> lines of these commits.
>
> Patch 2 and 3 should use "ipv6: ", patch #4 should use whatever the
> name of that device driver "vmw_vmci: " or similar, etc.
Point... Are you OK with tcp_send_syn_data() change in 8/18? Basically,
tcp_sendmsg() treats short copy from userland as "send as much as we can,
stop at the first point where copy_from_user() fails", same as write(),
etc.; that much is unchanged, but the current mainline has a strange behaviour
in case when short copy happens within what would be packed into SYN packet -
if that happens, it still sends as much as possible, but it falls back to
separate SYN. With this patch it simply sends shorter SYN+data packet instead.
The reason I went that way is that I wanted to avoid copying the same data
from userland twice and it was easy to do; I can preserve the current mainline
behaviour, but it'll cost making a backup copy of ->msg_iter in
tcp_send_syn_data(), only to never use it in normal case *and* do piles
of extra work (extra packet to send, repeated copying from userland) in case
of short copy. Is there any reason not to combine SYN+data in case of short
copy? Again, we do send exact same data, return the same value, etc. - you
need tcpdump to see the difference.
Al, off to figure out the proper Cc: for all those commits, so that
git-send-email would DTRT - if I need to edit commit messages, might
as well do that at the same time...
^ permalink raw reply
* RE: [PATCH net] hyperv: Fix the error processing in netvsc_send()
From: Jason Wang @ 2015-02-02 6:49 UTC (permalink / raw)
To: Haiyang Zhang
Cc: olaf@aepfle.de, netdev@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, davem@davemloft.net
In-Reply-To: <BN1PR0301MB0770FCDA58F3BC9E25382D95CA310@BN1PR0301MB0770.namprd03.prod.out look.com>
On Fri, Jan 30, 2015 at 11:05 PM, Haiyang Zhang
<haiyangz@microsoft.com> wrote:
>
>
>> -----Original Message-----
>> From: Jason Wang [mailto:jasowang@redhat.com]
>> Sent: Friday, January 30, 2015 5:25 AM
>> > + if (ret != 0) {
>> > + if (section_index != NETVSC_INVALID_INDEX)
>> > + netvsc_free_send_slot(net_device, section_index);
>>
>> What if ret is -EINVAL or -ENOSPC? Looks like we need free the skb
>> in
>> this case also.
>
> In these cases, skb is freed in netvsc_start_xmit().
>
>
>> >
>> > + } else if (skb) {
>> > + dev_kfree_skb_any(skb);
>>
>> The caller - netvsc_start_xmit() do this also, may be handle this in
>> caller is better since netvsc_start_xmit() is the only user that
>> tries
>> to send a skb?
>
> When the packet is sent out normally, we frees it in netvsc_send() if
> it's
> copied to send-buffer. The free is done in netvsc_send(), because the
> copy
> is also in this function. If it's not copied, it will be freed in
> another
> function -- netvsc_xmit_completion().
>
> netvsc_start_xmit() only does free skb in error case.
Ok.
>
>
>> btw, I find during netvsc_start_xmit(), ret was change to -ENOSPC
>> when
>> queue_sends[q_idx] < 1. But non of the caller check -ENOSPC in fact?
>
> In this case, we don't request re-send, so set ret to a value other
> than
> -EAGAIN.
Why not? We have available slots for it to be sent now. Dropping the
packet in this case may cause out of order sending.
> It's handled in the same way as errors != -EAGAIN, so we don't
> need to check this value specifically.
Thanks
^ permalink raw reply
* [PATCH net v3] net: ipv6: allow explicitly choosing optimistic addresses
From: Erik Kline @ 2015-02-02 6:39 UTC (permalink / raw)
To: netdev; +Cc: lorenzo, hannes, Erik Kline
RFC 4429 ("Optimistic DAD") states that optimistic addresses
should be treated as deprecated addresses. From section 2.1:
Unless noted otherwise, components of the IPv6 protocol stack
should treat addresses in the Optimistic state equivalently to
those in the Deprecated state, indicating that the address is
available for use but should not be used if another suitable
address is available.
Optimistic addresses are indeed avoided when other addresses are
available (i.e. at source address selection time), but they have
not heretofore been available for things like explicit bind() and
sendmsg() with struct in6_pktinfo, etc.
This change makes optimistic addresses treated more like
deprecated addresses than tentative ones.
Signed-off-by: Erik Kline <ek@google.com>
---
include/net/addrconf.h | 3 +++
net/ipv6/addrconf.c | 17 +++++++++++++++--
net/ipv6/ndisc.c | 4 +++-
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index d13573b..80456f7 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -62,6 +62,9 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg);
int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
const struct net_device *dev, int strict);
+int ipv6_chk_addr_and_flags(struct net *net, const struct in6_addr *addr,
+ const struct net_device *dev, int strict,
+ u32 banned_flags);
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index f7c8bbe..e9b795f 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1519,6 +1519,14 @@ static int ipv6_count_addresses(struct inet6_dev *idev)
int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
const struct net_device *dev, int strict)
{
+ return ipv6_chk_addr_and_flags(net, addr, dev, strict, IFA_F_TENTATIVE);
+}
+EXPORT_SYMBOL(ipv6_chk_addr);
+
+int ipv6_chk_addr_and_flags(struct net *net, const struct in6_addr *addr,
+ const struct net_device *dev, int strict,
+ u32 banned_flags)
+{
struct inet6_ifaddr *ifp;
unsigned int hash = inet6_addr_hash(addr);
@@ -1526,8 +1534,13 @@ int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
hlist_for_each_entry_rcu(ifp, &inet6_addr_lst[hash], addr_lst) {
if (!net_eq(dev_net(ifp->idev->dev), net))
continue;
+ /* Permit optimistic addresses, but only under explicitly
+ * defined circumstances.
+ */
+ bool optimistic_ok = (ifp->flags & IFA_F_OPTIMISTIC) &&
+ (banned_flags == IFA_F_TENTATIVE);
if (ipv6_addr_equal(&ifp->addr, addr) &&
- !(ifp->flags&IFA_F_TENTATIVE) &&
+ (!(ifp->flags&banned_flags) || optimistic_ok) &&
(dev == NULL || ifp->idev->dev == dev ||
!(ifp->scope&(IFA_LINK|IFA_HOST) || strict))) {
rcu_read_unlock_bh();
@@ -1538,7 +1551,7 @@ int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
rcu_read_unlock_bh();
return 0;
}
-EXPORT_SYMBOL(ipv6_chk_addr);
+EXPORT_SYMBOL(ipv6_chk_addr_and_flags);
static bool ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr,
struct net_device *dev)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 6828667..113fc6c 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -655,7 +655,9 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
struct in6_addr *target = (struct in6_addr *)&neigh->primary_key;
int probes = atomic_read(&neigh->probes);
- if (skb && ipv6_chk_addr(dev_net(dev), &ipv6_hdr(skb)->saddr, dev, 1))
+ if (skb && ipv6_chk_addr_and_flags(dev_net(dev), &ipv6_hdr(skb)->saddr,
+ dev, 1,
+ IFA_F_TENTATIVE|IFA_F_OPTIMISTIC))
saddr = &ipv6_hdr(skb)->saddr;
probes -= NEIGH_VAR(neigh->parms, UCAST_PROBES);
if (probes < 0) {
--
2.2.0.rc0.207.ga3a616c
^ permalink raw reply related
* Re: [PATCHv2 net-next] cxgb4: Remove preprocessor check for CONFIG_CXGB4_DCB
From: David Miller @ 2015-02-02 6:37 UTC (permalink / raw)
To: hariprasad; +Cc: netdev, leedom, anish, nirranjan, praveenm
In-Reply-To: <1422587967-18405-1-git-send-email-hariprasad@chelsio.com>
From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Fri, 30 Jan 2015 08:49:27 +0530
> In commit dc9daab226aa ("cxgb4: Added support in debugfs to dump
> sge_qinfo") a preprocessor check for CONFIG_CXGB4_DCB got added, which should
> have been CONFIG_CHELSIO_T4_DCB. After adding the right preprocessor, build
> fails due to missing function ethqset2pinfo. Fixing that as well.
>
> Reported-by: Paul Bolle <pebolle@tiscal.nl>
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
>
> V2: Updated description since the patch also fixes build failure
Applied, thanks.
^ permalink raw reply
* Re: [PATCH target] vhost/scsi: vhost_skip_iovec_bytes() can be static
From: Fam Zheng @ 2015-02-02 6:35 UTC (permalink / raw)
To: kbuild test robot
Cc: kvm, Michael S. Tsirkin, netdev, linux-kernel, virtualization,
kbuild-all
In-Reply-To: <20150202062521.GA18113@snb>
On Mon, 02/02 14:25, kbuild test robot wrote:
> drivers/vhost/scsi.c:1081:5: sparse: symbol 'vhost_skip_iovec_bytes' was not declared. Should it be static?
>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> scsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index d888bd9..8ac003f 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -1078,7 +1078,7 @@ vhost_scsi_send_bad_target(struct vhost_scsi *vs,
> pr_err("Faulted on virtio_scsi_cmd_resp\n");
> }
>
> -int vhost_skip_iovec_bytes(size_t bytes, int max_niov,
> +static int vhost_skip_iovec_bytes(size_t bytes, int max_niov,
> struct iovec *iov_in, size_t off_in,
> struct iovec **iov_out, size_t *off_out)
Probably keep the parameter list lines aligned?
Fam
^ permalink raw reply
* Re: [PATCH v2 0/3] Restore UFO support to virtio_net devices
From: David Miller @ 2015-02-02 6:28 UTC (permalink / raw)
To: vyasevich
Cc: netdev, virtualization, mst, ben, eric.dumazet, hannes, vyasevic
In-Reply-To: <20150201.221935.283572621026340671.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Sun, 01 Feb 2015 22:19:35 -0800 (PST)
> Series applied and queued up for -stable.
I have to revert, this breaks the build.
net/built-in.o: In function `udp6_ufo_fragment':
udp_offload.c:(.text+0x103380): undefined reference to `ipv6_select_ident'
^ permalink raw reply
* Re: Is sch_teql still useful?
From: David Miller @ 2015-02-02 6:27 UTC (permalink / raw)
To: cwang; +Cc: jhs, netdev, stephen
In-Reply-To: <CAHA+R7NDfn705P0OrgpMfx7nbsNcHh-cXrPVQezG9WtH1Ya3Yg@mail.gmail.com>
From: Cong Wang <cwang@twopensource.com>
Date: Fri, 30 Jan 2015 20:23:32 -0800
> Since we have bonding alb, is it still needed to have sch_teql since
> they do the same thing, load balancing over multiple interfaces? Also
> sch_teql mixes netdevice with qdisc, which somewhat breaks the
> abstraction?
>
> I don't dig the history so I could easily miss something here.
I can't comment as to it's usefulness, but I will note that we don't
have the option of removing it if you are thinking about doing so.
^ permalink raw reply
* Re: [RFC][PATCHSET] more iov_iter conversion in net/*
From: David Miller @ 2015-02-02 6:26 UTC (permalink / raw)
To: viro; +Cc: netdev
In-Reply-To: <20150131035513.GK29656@ZenIV.linux.org.uk>
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: Sat, 31 Jan 2015 03:55:13 +0000
> ->sendmsg() side of that business, now. By the end of it, we
> get all ->sendmsg() instances leaving iovec unchanged and ->msg_iter -
> drained.
...
> The pile after that one will be dealing with the kernel_sendmsg and
> kernel_recvmg callers - at that point we can start reaping benefits of
> consistent way ->msg_iter is handled. Note that after these changes if
> iov_iter_kvec() is used to initialize ->msg_iter, we don't need the games
> with get_fs()/set_fs() anymore; just sock_sendmsg()/sock_recvmsg() will do,
> so quite a few of those kernel_{send,recv}msg() callers will turn into
> sock_{send,recv}msg() ones.
The content of this series looks fine, but I really would like you
to put proper "subsystem: " prefixes into the commit log header
lines of these commits.
Patch 2 and 3 should use "ipv6: ", patch #4 should use whatever the
name of that device driver "vmw_vmci: " or similar, etc.
Thanks.
^ permalink raw reply
* [PATCH target] vhost/scsi: vhost_skip_iovec_bytes() can be static
From: kbuild test robot @ 2015-02-02 6:25 UTC (permalink / raw)
To: Nicholas Bellinger
Cc: kbuild-all, Michael S. Tsirkin, kvm, virtualization, netdev,
linux-kernel
In-Reply-To: <201502021411.KBLYtCzS%fengguang.wu@intel.com>
drivers/vhost/scsi.c:1081:5: sparse: symbol 'vhost_skip_iovec_bytes' was not declared. Should it be static?
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
scsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index d888bd9..8ac003f 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1078,7 +1078,7 @@ vhost_scsi_send_bad_target(struct vhost_scsi *vs,
pr_err("Faulted on virtio_scsi_cmd_resp\n");
}
-int vhost_skip_iovec_bytes(size_t bytes, int max_niov,
+static int vhost_skip_iovec_bytes(size_t bytes, int max_niov,
struct iovec *iov_in, size_t off_in,
struct iovec **iov_out, size_t *off_out)
{
^ permalink raw reply related
* [target:for-next 16/21] drivers/vhost/scsi.c:1081:5: sparse: symbol 'vhost_skip_iovec_bytes' was not declared. Should it be static?
From: kbuild test robot @ 2015-02-02 6:25 UTC (permalink / raw)
To: Nicholas Bellinger
Cc: kvm, Michael S. Tsirkin, netdev, linux-kernel, virtualization,
kbuild-all
tree: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next
head: 2936f1d4f3e8247bd519feba7892371d5e4c6603
commit: 105acf608f25d5e0d9fef669299a5438b7b114ee [16/21] vhost/scsi: Add ANY_LAYOUT vhost_skip_iovec_bytes helper
reproduce:
# apt-get install sparse
git checkout 105acf608f25d5e0d9fef669299a5438b7b114ee
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
>> drivers/vhost/scsi.c:1081:5: sparse: symbol 'vhost_skip_iovec_bytes' was not declared. Should it be static?
drivers/vhost/scsi.c:969:1: warning: 'vhost_scsi_mapal' defined but not used [-Wunused-function]
vhost_scsi_mapal(struct tcm_vhost_cmd *cmd, int max_niov,
^
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox