* [PATCHv3 net-next 6/8] vhost: move -net specific code out
From: Michael S. Tsirkin @ 2012-11-01 19:16 UTC (permalink / raw)
Cc: Vlad Yasevich, Alexander Duyck, Ian Campbell, kvm, netdev,
linux-kernel, virtualization, Eric Dumazet, Andrew Morton,
David S. Miller
In-Reply-To: <cover.1351797353.git.mst@redhat.com>
Zerocopy handling code is vhost-net specific.
Move it from vhost.c/vhost.h out to net.c
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/vhost/net.c | 45 ++++++++++++++++++++++++++++++++++++++++
drivers/vhost/tcm_vhost.c | 1 +
drivers/vhost/vhost.c | 53 +++++++----------------------------------------
drivers/vhost/vhost.h | 21 +++----------------
4 files changed, 56 insertions(+), 64 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index f80ae5f..532fc88 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -126,6 +126,42 @@ static void tx_poll_start(struct vhost_net *net, struct socket *sock)
net->tx_poll_state = VHOST_NET_POLL_STARTED;
}
+/* In case of DMA done not in order in lower device driver for some reason.
+ * upend_idx is used to track end of used idx, done_idx is used to track head
+ * of used idx. Once lower device DMA done contiguously, we will signal KVM
+ * guest used idx.
+ */
+int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq)
+{
+ int i;
+ int j = 0;
+
+ for (i = vq->done_idx; i != vq->upend_idx; i = (i + 1) % UIO_MAXIOV) {
+ if (VHOST_DMA_IS_DONE(vq->heads[i].len)) {
+ vq->heads[i].len = VHOST_DMA_CLEAR_LEN;
+ vhost_add_used_and_signal(vq->dev, vq,
+ vq->heads[i].id, 0);
+ ++j;
+ } else
+ break;
+ }
+ if (j)
+ vq->done_idx = i;
+ return j;
+}
+
+static void vhost_zerocopy_callback(struct ubuf_info *ubuf, int status)
+{
+ struct vhost_ubuf_ref *ubufs = ubuf->ctx;
+ struct vhost_virtqueue *vq = ubufs->vq;
+
+ vhost_poll_queue(&vq->poll);
+ /* set len to mark this desc buffers done DMA */
+ vq->heads[ubuf->desc].len = status ?
+ VHOST_DMA_FAILED_LEN : VHOST_DMA_DONE_LEN;
+ vhost_ubuf_put(ubufs);
+}
+
/* Expects to be always run from workqueue - which acts as
* read-size critical section for our kind of RCU. */
static void handle_tx(struct vhost_net *net)
@@ -594,9 +630,18 @@ static int vhost_net_release(struct inode *inode, struct file *f)
struct vhost_net *n = f->private_data;
struct socket *tx_sock;
struct socket *rx_sock;
+ int i;
vhost_net_stop(n, &tx_sock, &rx_sock);
vhost_net_flush(n);
+ vhost_dev_stop(&n->dev);
+ for (i = 0; i < n->dev.nvqs; ++i) {
+ /* Wait for all lower device DMAs done. */
+ if (n->dev.vqs[i].ubufs)
+ vhost_ubuf_put_and_wait(n->dev.vqs[i].ubufs);
+
+ vhost_zerocopy_signal_used(n, &n->dev.vqs[i]);
+ }
vhost_dev_cleanup(&n->dev, false);
if (tx_sock)
fput(tx_sock->file);
diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
index aa31692..23c138f 100644
--- a/drivers/vhost/tcm_vhost.c
+++ b/drivers/vhost/tcm_vhost.c
@@ -895,6 +895,7 @@ static int vhost_scsi_release(struct inode *inode, struct file *f)
vhost_scsi_clear_endpoint(s, &backend);
}
+ vhost_dev_stop(&s->dev);
vhost_dev_cleanup(&s->dev, false);
kfree(s);
return 0;
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 5affce3..ef8f598 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -26,10 +26,6 @@
#include <linux/kthread.h>
#include <linux/cgroup.h>
-#include <linux/net.h>
-#include <linux/if_packet.h>
-#include <linux/if_arp.h>
-
#include "vhost.h"
enum {
@@ -414,28 +410,16 @@ long vhost_dev_reset_owner(struct vhost_dev *dev)
return 0;
}
-/* In case of DMA done not in order in lower device driver for some reason.
- * upend_idx is used to track end of used idx, done_idx is used to track head
- * of used idx. Once lower device DMA done contiguously, we will signal KVM
- * guest used idx.
- */
-int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq)
+void vhost_dev_stop(struct vhost_dev *dev)
{
int i;
- int j = 0;
-
- for (i = vq->done_idx; i != vq->upend_idx; i = (i + 1) % UIO_MAXIOV) {
- if (VHOST_DMA_IS_DONE(vq->heads[i].len)) {
- vq->heads[i].len = VHOST_DMA_CLEAR_LEN;
- vhost_add_used_and_signal(vq->dev, vq,
- vq->heads[i].id, 0);
- ++j;
- } else
- break;
+
+ for (i = 0; i < dev->nvqs; ++i) {
+ if (dev->vqs[i].kick && dev->vqs[i].handle_kick) {
+ vhost_poll_stop(&dev->vqs[i].poll);
+ vhost_poll_flush(&dev->vqs[i].poll);
+ }
}
- if (j)
- vq->done_idx = i;
- return j;
}
/* Caller should have device mutex if and only if locked is set */
@@ -444,17 +428,6 @@ void vhost_dev_cleanup(struct vhost_dev *dev, bool locked)
int i;
for (i = 0; i < dev->nvqs; ++i) {
- if (dev->vqs[i].kick && dev->vqs[i].handle_kick) {
- vhost_poll_stop(&dev->vqs[i].poll);
- vhost_poll_flush(&dev->vqs[i].poll);
- }
- /* Wait for all lower device DMAs done. */
- if (dev->vqs[i].ubufs)
- vhost_ubuf_put_and_wait(dev->vqs[i].ubufs);
-
- /* Signal guest as appropriate. */
- vhost_zerocopy_signal_used(&dev->vqs[i]);
-
if (dev->vqs[i].error_ctx)
eventfd_ctx_put(dev->vqs[i].error_ctx);
if (dev->vqs[i].error)
@@ -1599,15 +1572,3 @@ void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *ubufs)
wait_event(ubufs->wait, !atomic_read(&ubufs->kref.refcount));
kfree(ubufs);
}
-
-void vhost_zerocopy_callback(struct ubuf_info *ubuf, int status)
-{
- struct vhost_ubuf_ref *ubufs = ubuf->ctx;
- struct vhost_virtqueue *vq = ubufs->vq;
-
- vhost_poll_queue(&vq->poll);
- /* set len to mark this desc buffers done DMA */
- vq->heads[ubuf->desc].len = status ?
- VHOST_DMA_FAILED_LEN : VHOST_DMA_DONE_LEN;
- kref_put(&ubufs->kref, vhost_zerocopy_done_signal);
-}
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index 464469d..5e19e3d 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -7,27 +7,11 @@
#include <linux/mutex.h>
#include <linux/poll.h>
#include <linux/file.h>
-#include <linux/skbuff.h>
#include <linux/uio.h>
#include <linux/virtio_config.h>
#include <linux/virtio_ring.h>
#include <linux/atomic.h>
-/*
- * For transmit, used buffer len is unused; we override it to track buffer
- * status internally; used for zerocopy tx only.
- */
-/* Lower device DMA failed */
-#define VHOST_DMA_FAILED_LEN 3
-/* Lower device DMA done */
-#define VHOST_DMA_DONE_LEN 2
-/* Lower device DMA in progress */
-#define VHOST_DMA_IN_PROGRESS 1
-/* Buffer unused */
-#define VHOST_DMA_CLEAR_LEN 0
-
-#define VHOST_DMA_IS_DONE(len) ((len) >= VHOST_DMA_DONE_LEN)
-
struct vhost_device;
struct vhost_work;
@@ -80,6 +64,8 @@ struct vhost_ubuf_ref *vhost_ubuf_alloc(struct vhost_virtqueue *, bool zcopy);
void vhost_ubuf_put(struct vhost_ubuf_ref *);
void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *);
+struct ubuf_info;
+
/* The virtqueue structure describes a queue attached to a device. */
struct vhost_virtqueue {
struct vhost_dev *dev;
@@ -177,6 +163,7 @@ long vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue *vqs, int nvqs);
long vhost_dev_check_owner(struct vhost_dev *);
long vhost_dev_reset_owner(struct vhost_dev *);
void vhost_dev_cleanup(struct vhost_dev *, bool locked);
+void vhost_dev_stop(struct vhost_dev *);
long vhost_dev_ioctl(struct vhost_dev *, unsigned int ioctl, unsigned long arg);
int vhost_vq_access_ok(struct vhost_virtqueue *vq);
int vhost_log_access_ok(struct vhost_dev *);
@@ -201,8 +188,6 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *);
int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
unsigned int log_num, u64 len);
-void vhost_zerocopy_callback(struct ubuf_info *, bool);
-int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq);
#define vq_err(vq, fmt, ...) do { \
pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \
--
MST
^ permalink raw reply related
* [PATCHv3 net-next 5/8] vhost: track zero copy failures using DMA length
From: Michael S. Tsirkin @ 2012-11-01 19:16 UTC (permalink / raw)
Cc: Vlad Yasevich, Alexander Duyck, Ian Campbell, kvm, netdev,
linux-kernel, virtualization, Eric Dumazet, Andrew Morton,
David S. Miller
In-Reply-To: <cover.1351797353.git.mst@redhat.com>
This will be used to disable zerocopy when error rate
is high.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/vhost/vhost.c | 7 ++++---
drivers/vhost/vhost.h | 4 ++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index f23cf89..5affce3 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -425,7 +425,7 @@ int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq)
int j = 0;
for (i = vq->done_idx; i != vq->upend_idx; i = (i + 1) % UIO_MAXIOV) {
- if ((vq->heads[i].len == VHOST_DMA_DONE_LEN)) {
+ if (VHOST_DMA_IS_DONE(vq->heads[i].len)) {
vq->heads[i].len = VHOST_DMA_CLEAR_LEN;
vhost_add_used_and_signal(vq->dev, vq,
vq->heads[i].id, 0);
@@ -1600,13 +1600,14 @@ void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *ubufs)
kfree(ubufs);
}
-void vhost_zerocopy_callback(struct ubuf_info *ubuf, bool status)
+void vhost_zerocopy_callback(struct ubuf_info *ubuf, int status)
{
struct vhost_ubuf_ref *ubufs = ubuf->ctx;
struct vhost_virtqueue *vq = ubufs->vq;
vhost_poll_queue(&vq->poll);
/* set len to mark this desc buffers done DMA */
- vq->heads[ubuf->desc].len = VHOST_DMA_DONE_LEN;
+ vq->heads[ubuf->desc].len = status ?
+ VHOST_DMA_FAILED_LEN : VHOST_DMA_DONE_LEN;
kref_put(&ubufs->kref, vhost_zerocopy_done_signal);
}
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index b6538ee..464469d 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -17,6 +17,8 @@
* For transmit, used buffer len is unused; we override it to track buffer
* status internally; used for zerocopy tx only.
*/
+/* Lower device DMA failed */
+#define VHOST_DMA_FAILED_LEN 3
/* Lower device DMA done */
#define VHOST_DMA_DONE_LEN 2
/* Lower device DMA in progress */
@@ -24,6 +26,8 @@
/* Buffer unused */
#define VHOST_DMA_CLEAR_LEN 0
+#define VHOST_DMA_IS_DONE(len) ((len) >= VHOST_DMA_DONE_LEN)
+
struct vhost_device;
struct vhost_work;
--
MST
^ permalink raw reply related
* [PATCHv3 net-next 4/8] vhost-net: cleanup macros for DMA status tracking
From: Michael S. Tsirkin @ 2012-11-01 19:16 UTC (permalink / raw)
Cc: Vlad Yasevich, Alexander Duyck, Ian Campbell, kvm, netdev,
linux-kernel, virtualization, Eric Dumazet, Andrew Morton,
David S. Miller
In-Reply-To: <cover.1351797353.git.mst@redhat.com>
Better document macros for DMA tracking. Add an
explicit one for DMA in progress instead of
relying on user supplying len != 1.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/vhost/net.c | 3 ++-
drivers/vhost/vhost.c | 2 +-
drivers/vhost/vhost.h | 12 +++++++++---
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 072cbba..f80ae5f 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -237,7 +237,8 @@ static void handle_tx(struct vhost_net *net)
} else {
struct ubuf_info *ubuf = &vq->ubuf_info[head];
- vq->heads[vq->upend_idx].len = len;
+ vq->heads[vq->upend_idx].len =
+ VHOST_DMA_IN_PROGRESS;
ubuf->callback = vhost_zerocopy_callback;
ubuf->ctx = vq->ubufs;
ubuf->desc = vq->upend_idx;
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 73d08db..f23cf89 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1606,7 +1606,7 @@ void vhost_zerocopy_callback(struct ubuf_info *ubuf, bool status)
struct vhost_virtqueue *vq = ubufs->vq;
vhost_poll_queue(&vq->poll);
- /* set len = 1 to mark this desc buffers done DMA */
+ /* set len to mark this desc buffers done DMA */
vq->heads[ubuf->desc].len = VHOST_DMA_DONE_LEN;
kref_put(&ubufs->kref, vhost_zerocopy_done_signal);
}
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index 2de4ce2..b6538ee 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -13,9 +13,15 @@
#include <linux/virtio_ring.h>
#include <linux/atomic.h>
-/* This is for zerocopy, used buffer len is set to 1 when lower device DMA
- * done */
-#define VHOST_DMA_DONE_LEN 1
+/*
+ * For transmit, used buffer len is unused; we override it to track buffer
+ * status internally; used for zerocopy tx only.
+ */
+/* Lower device DMA done */
+#define VHOST_DMA_DONE_LEN 2
+/* Lower device DMA in progress */
+#define VHOST_DMA_IN_PROGRESS 1
+/* Buffer unused */
#define VHOST_DMA_CLEAR_LEN 0
struct vhost_device;
--
MST
^ permalink raw reply related
* [PATCHv3 net-next 3/8] tun: report orphan frags errors to zero copy callback
From: Michael S. Tsirkin @ 2012-11-01 19:16 UTC (permalink / raw)
Cc: Vlad Yasevich, Alexander Duyck, Ian Campbell, kvm, netdev,
linux-kernel, virtualization, Eric Dumazet, Andrew Morton,
David S. Miller
In-Reply-To: <cover.1351797353.git.mst@redhat.com>
When tun transmits a zero copy skb, it orphans the frags
which might need to allocate extra memory, in atomic context.
If that fails, notify ubufs callback before freeing the skb
as a hint that device should disable zerocopy mode.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/net/tun.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 9e28768..b44d7b7 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -728,6 +728,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
drop:
dev->stats.tx_dropped++;
+ skb_tx_error(skb);
kfree_skb(skb);
rcu_read_unlock();
return NETDEV_TX_OK;
--
MST
^ permalink raw reply related
* [PATCHv3 net-next 2/8] skb: api to report errors for zero copy skbs
From: Michael S. Tsirkin @ 2012-11-01 19:16 UTC (permalink / raw)
Cc: Vlad Yasevich, David S. Miller, Eric Dumazet, Andrew Morton,
Alexander Duyck, Ian Campbell, kvm, virtualization, netdev,
linux-kernel
In-Reply-To: <cover.1351797353.git.mst@redhat.com>
Orphaning frags for zero copy skbs needs to allocate data in atomic
context so is has a chance to fail. If it does we currently discard
the skb which is safe, but we don't report anything to the caller,
so it can not recover by e.g. disabling zero copy.
Add an API to free skb reporting such errors: this is used
by tun in case orphaning frags fails.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/linux/skbuff.h | 1 +
net/core/skbuff.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e5eae5b..f2af494 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -568,6 +568,7 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb)
}
extern void kfree_skb(struct sk_buff *skb);
+extern void skb_tx_error(struct sk_buff *skb);
extern void consume_skb(struct sk_buff *skb);
extern void __kfree_skb(struct sk_buff *skb);
extern struct kmem_cache *skbuff_head_cache;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 4abdf71..d9addea 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -635,6 +635,26 @@ void kfree_skb(struct sk_buff *skb)
EXPORT_SYMBOL(kfree_skb);
/**
+ * skb_tx_error - report an sk_buff xmit error
+ * @skb: buffer that triggered an error
+ *
+ * Report xmit error if a device callback is tracking this skb.
+ * skb must be freed afterwards.
+ */
+void skb_tx_error(struct sk_buff *skb)
+{
+ if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
+ struct ubuf_info *uarg;
+
+ uarg = skb_shinfo(skb)->destructor_arg;
+ if (uarg->callback)
+ uarg->callback(uarg, false);
+ skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
+ }
+}
+EXPORT_SYMBOL(skb_tx_error);
+
+/**
* consume_skb - free an skbuff
* @skb: buffer to free
*
--
MST
^ permalink raw reply related
* [PATCHv3 net-next 1/8] skb: report completion status for zero copy skbs
From: Michael S. Tsirkin @ 2012-11-01 19:16 UTC (permalink / raw)
Cc: Vlad Yasevich, Alexander Duyck, Ian Campbell, kvm, netdev,
linux-kernel, virtualization, Eric Dumazet, Andrew Morton,
David S. Miller
In-Reply-To: <cover.1351797353.git.mst@redhat.com>
Even if skb is marked for zero copy, net core might still decide
to copy it later which is somewhat slower than a copy in user context:
besides copying the data we need to pin/unpin the pages.
Add a parameter reporting such cases through zero copy callback:
if this happens a lot, device can take this into account
and switch to copying in user context.
This patch updates all users but ignores the passed value for now:
it will be used by follow-up patches.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/vhost/vhost.c | 2 +-
drivers/vhost/vhost.h | 2 +-
include/linux/skbuff.h | 4 +++-
net/core/skbuff.c | 4 ++--
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 99ac2cb..73d08db 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1600,7 +1600,7 @@ void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *ubufs)
kfree(ubufs);
}
-void vhost_zerocopy_callback(struct ubuf_info *ubuf)
+void vhost_zerocopy_callback(struct ubuf_info *ubuf, bool status)
{
struct vhost_ubuf_ref *ubufs = ubuf->ctx;
struct vhost_virtqueue *vq = ubufs->vq;
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index 1125af3..2de4ce2 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -191,7 +191,7 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *);
int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
unsigned int log_num, u64 len);
-void vhost_zerocopy_callback(struct ubuf_info *);
+void vhost_zerocopy_callback(struct ubuf_info *, bool);
int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq);
#define vq_err(vq, fmt, ...) do { \
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a2a0bdb..e5eae5b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -235,11 +235,13 @@ enum {
/*
* The callback notifies userspace to release buffers when skb DMA is done in
* lower device, the skb last reference should be 0 when calling this.
+ * The zerocopy_success argument is true if zero copy transmit occurred,
+ * false on data copy or out of memory error caused by data copy attempt.
* The ctx field is used to track device context.
* The desc field is used to track userspace buffer index.
*/
struct ubuf_info {
- void (*callback)(struct ubuf_info *);
+ void (*callback)(struct ubuf_info *, bool zerocopy_success);
void *ctx;
unsigned long desc;
};
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 6e04b1f..4abdf71 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -519,7 +519,7 @@ static void skb_release_data(struct sk_buff *skb)
uarg = skb_shinfo(skb)->destructor_arg;
if (uarg->callback)
- uarg->callback(uarg);
+ uarg->callback(uarg, true);
}
if (skb_has_frag_list(skb))
@@ -797,7 +797,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
for (i = 0; i < num_frags; i++)
skb_frag_unref(skb, i);
- uarg->callback(uarg);
+ uarg->callback(uarg, false);
/* skb frags point to kernel buffers */
for (i = num_frags - 1; i >= 0; i--) {
--
MST
^ permalink raw reply related
* [PATCHv3 net-next 0/8] enable/disable zero copy tx dynamically
From: Michael S. Tsirkin @ 2012-11-01 19:16 UTC (permalink / raw)
Cc: Vlad Yasevich, David S. Miller, Eric Dumazet, Andrew Morton,
Alexander Duyck, Ian Campbell, kvm, virtualization, netdev,
linux-kernel
tun supports zero copy transmit since 0690899b4d4501b3505be069b9a687e68ccbe15b,
however you can only enable this mode if you know your workload does not
trigger heavy guest to host/host to guest traffic - otherwise you
get a (minor) performance regression.
This patchset addresses this problem by notifying the owner
device when callback is invoked because of a data copy.
This makes it possible to detect whether zero copy is appropriate
dynamically: we start in zero copy mode, when we detect
data copied we disable zero copy for a while.
With this patch applied, I get the same performance for
guest to host and guest to guest both with and without zero copy tx.
Changes from v2:
change callback parameter from int to bool
accordingly, drop err parameter from skb_tx_error
Changes from v1:
Comment fixups in patches 2 and 8 suggested by Vlad Yasevich,
no changes to other patches
Michael S. Tsirkin (8):
skb: report completion status for zero copy skbs
skb: api to report errors for zero copy skbs
tun: report orphan frags errors to zero copy callback
vhost-net: cleanup macros for DMA status tracking
vhost: track zero copy failures using DMA length
vhost: move -net specific code out
vhost-net: select tx zero copy dynamically
vhost-net: reduce vq polling on tx zerocopy
drivers/net/tun.c | 1 +
drivers/vhost/net.c | 111 +++++++++++++++++++++++++++++++++++++++++++---
drivers/vhost/tcm_vhost.c | 1 +
drivers/vhost/vhost.c | 52 +++-------------------
drivers/vhost/vhost.h | 11 ++---
include/linux/skbuff.h | 5 ++-
net/core/skbuff.c | 24 +++++++++-
7 files changed, 144 insertions(+), 61 deletions(-)
--
MST
^ permalink raw reply
* [PATCH net-next 3/3] eth: Rename and properly align br_reserved_address array
From: Ben Hutchings @ 2012-11-01 19:12 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers, John Fastabend, Stephen Hemminger
Since this array is no longer part of the bridge driver, it should
have an 'eth' prefix not 'br'.
We also assume that either it's 16-bit-aligned or the architecture has
efficient unaligned access. Ensure the first of these is true by
explicitly aligning it.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
include/linux/etherdevice.h | 5 +++--
net/bridge/br_device.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 7cf2516..243eea1 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -52,7 +52,8 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count)
/* Reserved Ethernet Addresses per IEEE 802.1Q */
-static const u8 br_reserved_address[ETH_ALEN] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
+static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
+{ 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
/**
* is_link_local_ether_addr - Determine if given Ethernet address is link-local
@@ -64,7 +65,7 @@ static const u8 br_reserved_address[ETH_ALEN] = { 0x01, 0x80, 0xc2, 0x00, 0x00,
static inline bool is_link_local_ether_addr(const u8 *addr)
{
__be16 *a = (__be16 *)addr;
- static const __be16 *b = (const __be16 *)br_reserved_address;
+ static const __be16 *b = (const __be16 *)eth_reserved_addr_base;
static const __be16 m = cpu_to_be16(0xfff0);
return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 4245e99..7c78e26 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -358,7 +358,7 @@ void br_dev_setup(struct net_device *dev)
br->bridge_id.prio[0] = 0x80;
br->bridge_id.prio[1] = 0x00;
- memcpy(br->group_addr, br_reserved_address, ETH_ALEN);
+ memcpy(br->group_addr, eth_reserved_addr_base, ETH_ALEN);
br->stp_enabled = BR_NO_STP;
br->group_fwd_mask = BR_GROUPFWD_DEFAULT;
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH net-next 2/3] eth: Make is_link_local() consistent with other address tests
From: Ben Hutchings @ 2012-11-01 19:11 UTC (permalink / raw)
To: David Miller; +Cc: netdev, John Fastabend, Stephen Hemminger
Function name should include '_ether_addr'.
Return type should be bool.
Parameter name should be 'addr' not 'dest' (also matching kernel-doc).
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
drivers/net/ethernet/intel/ixgbevf/vf.c | 2 +-
include/linux/etherdevice.h | 6 +++---
net/bridge/br_input.c | 2 +-
net/bridge/br_sysfs_br.c | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index e5f993e..d65e941 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6973,7 +6973,7 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
return -EINVAL;
}
- if (is_unicast_ether_addr(addr) || is_link_local(addr)) {
+ if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
u32 rar_uc_entries = IXGBE_MAX_PF_MACVLANS;
if (netdev_uc_count(dev) < rar_uc_entries)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index c281ee9..f3d3947 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -2979,7 +2979,7 @@ static int ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
unsigned short f;
#endif
u8 *dst_mac = skb_header_pointer(skb, 0, 0, NULL);
- if (!dst_mac || is_link_local(dst_mac)) {
+ if (!dst_mac || is_link_local_ether_addr(dst_mac)) {
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c
index c0fd1ef..0c94557 100644
--- a/drivers/net/ethernet/intel/ixgbevf/vf.c
+++ b/drivers/net/ethernet/intel/ixgbevf/vf.c
@@ -331,7 +331,7 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw,
netdev_for_each_mc_addr(ha, netdev) {
if (i == cnt)
break;
- if (is_link_local(ha->addr))
+ if (is_link_local_ether_addr(ha->addr))
continue;
vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr);
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 45ded4b..7cf2516 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -55,15 +55,15 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
static const u8 br_reserved_address[ETH_ALEN] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
/**
- * is_link_local - Determine if given Eth addr is a link local mcast address.
+ * is_link_local_ether_addr - Determine if given Ethernet address is link-local
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
* IEEE 802.1Q 8.6.3 Frame filtering.
*/
-static inline int is_link_local(const unsigned char *dest)
+static inline bool is_link_local_ether_addr(const u8 *addr)
{
- __be16 *a = (__be16 *)dest;
+ __be16 *a = (__be16 *)addr;
static const __be16 *b = (const __be16 *)br_reserved_address;
static const __be16 m = cpu_to_be16(0xfff0);
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index d047978..4b34207 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -147,7 +147,7 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
p = br_port_get_rcu(skb->dev);
- if (unlikely(is_link_local(dest))) {
+ if (unlikely(is_link_local_ether_addr(dest))) {
/*
* See IEEE 802.1D Table 7-10 Reserved addresses
*
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 82385fd..cffb76e 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -309,7 +309,7 @@ static ssize_t store_group_addr(struct device *d,
&new_addr[3], &new_addr[4], &new_addr[5]) != 6)
return -EINVAL;
- if (!is_link_local(new_addr))
+ if (!is_link_local_ether_addr(new_addr))
return -EINVAL;
if (new_addr[5] == 1 || /* 802.3x Pause address */
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH net-next 1/3] bridge: Use is_link_local() in store_group_addr()
From: Ben Hutchings @ 2012-11-01 19:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Stephen Hemminger
Parse the string into an array of bytes rather than ints, so we can
use is_link_local() rather than reimplementing it.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
net/bridge/br_sysfs_br.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index e157b0d..82385fd 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -298,23 +298,18 @@ static ssize_t store_group_addr(struct device *d,
const char *buf, size_t len)
{
struct net_bridge *br = to_bridge(d);
- unsigned int new_addr[6];
+ u8 new_addr[6];
int i;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
- if (sscanf(buf, "%x:%x:%x:%x:%x:%x",
+ if (sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
&new_addr[0], &new_addr[1], &new_addr[2],
&new_addr[3], &new_addr[4], &new_addr[5]) != 6)
return -EINVAL;
- /* Must be 01:80:c2:00:00:0X */
- for (i = 0; i < 5; i++)
- if (new_addr[i] != br_reserved_address[i])
- return -EINVAL;
-
- if (new_addr[5] & ~0xf)
+ if (!is_link_local(new_addr))
return -EINVAL;
if (new_addr[5] == 1 || /* 802.3x Pause address */
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* RE: [PATCH net-next 0/3] Enable PPS and PTP clocks automatically
From: Keller, Jacob E @ 2012-11-01 18:59 UTC (permalink / raw)
To: Ben Hutchings, Richard Cochran
Cc: David Miller, Rodolfo Giometti, netdev@vger.kernel.org,
linux-net-drivers@solarflare.com
In-Reply-To: <1351788416.2883.6.camel@bwh-desktop.uk.solarflarecom.com>
> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of Ben Hutchings
> Sent: Thursday, November 01, 2012 9:47 AM
> To: Richard Cochran
> Cc: David Miller; Rodolfo Giometti; netdev@vger.kernel.org; linux-net-
> drivers@solarflare.com
> Subject: Re: [PATCH net-next 0/3] Enable PPS and PTP clocks automatically
>
> On Thu, 2012-11-01 at 09:19 +0100, Richard Cochran wrote:
> > Ben,
> >
> > I really like this idea, but I have a couple of questions, below.
> >
> > On Thu, Nov 01, 2012 at 01:29:57AM +0000, Ben Hutchings wrote:
> >
> > > Ben Hutchings (3):
> > > pps, ptp: Remove dependencies on EXPERIMENTAL
> >
> > Kees Cook just posted a massive series to remove EXPERIMENTAL
> > everywhere. Maybe it would make sense to have this series follow that
> > one?
>
> If some other tree gets a commit to remove these, they should still
> merge cleanly.
>
> > > ptp: Make PTP_1588_CLOCK select rather than depend on PPS
> > > ptp: Enable clock drivers along with associated net/PHY drivers
> > >
> > > drivers/net/ethernet/intel/Kconfig | 28 +----------
> --------
> > > drivers/net/ethernet/intel/igb/Makefile | 4 +--
> > > drivers/net/ethernet/intel/igb/igb.h | 6 ----
> > > drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 -
> > > drivers/net/ethernet/intel/igb/igb_main.c | 28 -----------
> ---------
> >
> > The #ifdefs in the Intel and PCH drivers are meant to streamline the
> > code for users who are not interested in time stamping. Although the
> > overhead of the additional is minimal (it really just a bunch of
> > tests), and I wouldn't mind removing the conditionals, I suspect that
> > some people won't like it.
>
> Then they may object to this and maybe get some drivers changed back.
> However I didn't get any objections when I previously outlined these
> changes.
>
> Ben.
>
> --
Last I checked at least for ixgbe, we recently fixed the performance regression when PTP was enabled, and now it doesn't appear to cause lower performance when enabled in kernel but not enabled via the hwtstamp_ioctl.
- Jake
^ permalink raw reply
* [3.5/6.x][e1000e] - Regression - Unable to receive packets if MTU == 1500
From: Shawn Starr @ 2012-11-01 17:58 UTC (permalink / raw)
To: netdev
Hello network driver folks,
I recently decided to reinstall my Lenovo W500 laptop and found I wasn't able
to get DHCP leases, I wasn't able to install over PXE (when getting the IP a
second time within the OS)
Fedora is currently using kernel-3.6.2-2.fc18.x86_64 (Pre-beta)
The only difference I noticed was in my old install of Fedora, I had added
MTU=9000 to the interface config while using a 3.5 kernel, not knowing 3.6.x
seems to break things.
My Cisco DPC3825 Switch/Cable modem has an MTU setting but this is from Cable
provider <-> WAN interface only. I tried changing to 1500 but by default it
uses this anyway.
I had noticed tx unit hang errors sometimes, but not when MTU is above 1500.
PCI info:
00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network
Connection (rev 03)
Subsystem: Lenovo Device 20ee
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 46
Region 0: Memory at fc000000 (32-bit, non-prefetchable) [size=128K]
Region 1: Memory at fc025000 (32-bit, non-prefetchable) [size=4K]
Region 2: I/O ports at 1840 [size=32]
Capabilities: [c8] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee0100c Data: 41a2
Capabilities: [e0] PCI Advanced Features
AFCap: TP+ FLR+
AFCtrl: FLR-
AFStatus: TP-
Kernel driver in use: e1000e
e1000e conversation log:
[ 12.653816] e1000e: Intel(R) PRO/1000 Network Driver - 2.0.0-k
[ 12.653819] e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
[ 12.653855] e1000e 0000:00:19.0: setting latency timer to 64
[ 12.653938] e1000e 0000:00:19.0: Interrupt Throttling Rate (ints/sec) set
to dynamic conservative mode
[ 12.653980] e1000e 0000:00:19.0: irq 46 for MSI/MSI-X
[ 12.844121] e1000e 0000:00:19.0: eth0: (PCI Express:2.5GT/s:Width x1)
00:22:68:0c:96:e3
[ 12.844124] e1000e 0000:00:19.0: eth0: Intel(R) PRO/1000 Network Connection
[ 12.844150] e1000e 0000:00:19.0: eth0: MAC: 7, PHY: 8, PBA No: 1008FF-0FF
[ 17.459570] e1000e 0000:00:19.0: eth0: changing MTU from 1500 to 9000
[ 17.459577] e1000e 0000:00:19.0: Interrupt Throttle Rate turned off
[ 17.948121] e1000e 0000:00:19.0: irq 46 for MSI/MSI-X
[ 18.049164] e1000e 0000:00:19.0: irq 46 for MSI/MSI-X
[ 20.442936] e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow
Control: Rx/Tx
When I set MTU = 1500 (2000 works), it will stop receiving packets, it also
disables Interrupt Throttling when MTU is set higher.
After testing reasons why it wasn't get a DHCP lease, I decided to bump the
MTU to 9000 for Jumbo Frames and as soon as I did this, I was able to get a
lease and the network functioned resumes receiving packets.
Can anyone else report regressions or might know whats going on?
Thanks,
Shawn.
^ permalink raw reply
* Re: Fw: [Bug 42764] BUG at net/core/skbuff.c:147
From: Ben Hutchings @ 2012-11-01 16:53 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Michael Chan, netdev
In-Reply-To: <20121031135106.453cbe4d@s6510.linuxnetplumber.net>
On Wed, 2012-10-31 at 13:51 -0700, Stephen Hemminger wrote:
[...]
> This machine does a lot of network traffic, because it load data from a
> database every night.
>
> Kernel version is 3.0.34
>
> Sorry for not reporting hardware, I thought it was a protocol bug not related
> to a specific card.
>
> ------------[ cut here ]------------
> kernel BUG at net/core/skbuff.c:147!
> invalid opcode: 0000 [#1] SMP
> CPU 2
> Modules linked in: af_packet ipmi_devintf ipmi_si ipmi_msghandler ipv6 fuse
> loop sr_mod cdrom mptsas mptscsih mptbase scsi_transport_sas tpm_tis tpm bnx2
> tpm_bios sg i2c_piix4 i2c_core shpchp pci_hotplug button serio_raw linear
> scsi_dh_alua scsi_dh_rdac scsi_dh_hp_sw scsi_dh_emc dm_round_robin sd_mod
> crc_t10dif qla2xxx scsi_transport_fc scsi_tgt dm_snapshot dm_multipath scsi_dh
> scsi_mod edd dm_mod ext3 mbcache jbd fan thermal processor thermal_sys hwmon
> [last unloaded: usbcore]
>
> Pid: 21566, comm: nscd Not tainted 3.0.34-inps #5 IBM BladeCenter LS42
> -[7902CQG]-/Server Blade
> RIP: 0010:[<ffffffff8123fd12>] [<ffffffff8123fd12>] skb_push+0x75/0x7e
> RSP: 0018:ffff880b956c39d8 EFLAGS: 00010292
> RAX: 0000000000000083 RBX: 0000000000000800 RCX: 0000000000023382
> RDX: 0000000000007878 RSI: 0000000000000046 RDI: ffffffff8152ee9c
> RBP: ffff880b956c39f8 R08: 0000000000000000 R09: 0720072007200720
> R10: ffff880b956c37c8 R11: 0720072007200720 R12: 0000000000000000
> R13: ffff8810231fb718 R14: 0000000000000055 R15: ffff880c25d24000
> FS: 00007fd9a9222950(0000) GS:ffff880c3fc00000(0000) knlGS:00000000e8dafb90
> CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> CR2: 00007fd9b403a000 CR3: 0000000c265e8000 CR4: 00000000000006e0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process nscd (pid: 21566, threadinfo ffff880b956c2000, task ffff8803e50e4790)
> Stack:
> 0000000000000057 0000000000000080 ffff880c25d24000 ffff880c71806440
> ffff880b956c3a38 ffffffff8125e0c5 ffff880b956c3a28 0000000000000036
> ffff8810231fb680 ffff8810231fb718 ffff880b2cc49380 ffff8810231fb710
> Call Trace:
> [<ffffffff8125e0c5>] eth_header+0x29/0xa8
> [<ffffffff81251a59>] neigh_resolve_output+0x284/0x2ed
[...]
The symptoms seem to match this fix:
commit e1f165032c8bade3a6bdf546f8faf61fda4dd01c
Author: ramesh.nagappa@gmail.com <ramesh.nagappa@gmail.com>
Date: Fri Oct 5 19:10:15 2012 +0000
net: Fix skb_under_panic oops in neigh_resolve_output
The retry loop in neigh_resolve_output() and neigh_connected_output()
call dev_hard_header() with out reseting the skb to network_header.
This causes the retry to fail with skb_under_panic. The fix is to
reset the network_header within the retry loop.
which was backported into 3.0.49 and other stable branches.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next 0/3] Enable PPS and PTP clocks automatically
From: Ben Hutchings @ 2012-11-01 16:46 UTC (permalink / raw)
To: Richard Cochran; +Cc: David Miller, Rodolfo Giometti, netdev, linux-net-drivers
In-Reply-To: <20121101081924.GB2637@netboy.at.omicron.at>
On Thu, 2012-11-01 at 09:19 +0100, Richard Cochran wrote:
> Ben,
>
> I really like this idea, but I have a couple of questions, below.
>
> On Thu, Nov 01, 2012 at 01:29:57AM +0000, Ben Hutchings wrote:
>
> > Ben Hutchings (3):
> > pps, ptp: Remove dependencies on EXPERIMENTAL
>
> Kees Cook just posted a massive series to remove EXPERIMENTAL
> everywhere. Maybe it would make sense to have this series follow that
> one?
If some other tree gets a commit to remove these, they should still
merge cleanly.
> > ptp: Make PTP_1588_CLOCK select rather than depend on PPS
> > ptp: Enable clock drivers along with associated net/PHY drivers
> >
> > drivers/net/ethernet/intel/Kconfig | 28 +------------------
> > drivers/net/ethernet/intel/igb/Makefile | 4 +--
> > drivers/net/ethernet/intel/igb/igb.h | 6 ----
> > drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 -
> > drivers/net/ethernet/intel/igb/igb_main.c | 28 --------------------
>
> The #ifdefs in the Intel and PCH drivers are meant to streamline the
> code for users who are not interested in time stamping. Although the
> overhead of the additional is minimal (it really just a bunch of
> tests), and I wouldn't mind removing the conditionals, I suspect that
> some people won't like it.
Then they may object to this and maybe get some drivers changed back.
However I didn't get any objections when I previously outlined these
changes.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next] ppp: make ppp_get_stats64 static
From: David Miller @ 2012-11-01 16:39 UTC (permalink / raw)
To: shemminger; +Cc: paulus, linux-ppp, netdev
In-Reply-To: <20121029113402.10736805@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 29 Oct 2012 11:34:02 -0700
> This was picked up by sparse.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH 0/4] Support the MX6 FEC as a PTP hardware clock
From: David Miller @ 2012-11-01 16:30 UTC (permalink / raw)
To: Frank.Li; +Cc: lznua, richardcochran, shawn.guo, linux-arm-kernel, netdev
In-Reply-To: <1351657480-24745-1-git-send-email-Frank.Li@freescale.com>
From: Frank Li <Frank.Li@freescale.com>
Date: Wed, 31 Oct 2012 12:24:40 +0800
> This patch series enables hardware time stamping and a PTP hardware clock
> for mx6 ENET controller.
>
> Frank Li (4):
> net: fec: move fec_enet_private to header file
> ARM: dts: imx6q: Add ENET PTP clock pin and clock source
> ARM: imx6q: Set enet tx reference clk from anatop to support 1588
> FEC: Add time stamping code and a PTP hardware clock
All applied to net-next.
Please make sure your changes are in sync with Ben's PTP/PPS
Kconfig changes of today, and send me any changes if necessary.
^ permalink raw reply
* Re: [PATCH] veth: allow changing the mac address while interface is up
From: David Miller @ 2012-11-01 16:26 UTC (permalink / raw)
To: hannes; +Cc: netdev
In-Reply-To: <20121031022201.GH18860@order.stressinduktion.org>
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Wed, 31 Oct 2012 03:22:01 +0100
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net-next V3 00/10] Support the CPTS as a PTP Hardware Clock
From: David Miller @ 2012-11-01 16:24 UTC (permalink / raw)
To: richardcochran; +Cc: netdev, linux-arm-kernel, cyril, mugunthanvnm
In-Reply-To: <cover.1351535536.git.richardcochran@gmail.com>
All applied to net-next
Ben made some changes today to how PTP/PPS is Kconfig'd etc.
so please make sure your driver is in sync with that.
Thanks.
^ permalink raw reply
* Re: [PATCHv2 net-next 1/8] skb: report completion status for zero copy skbs
From: David Miller @ 2012-11-01 16:20 UTC (permalink / raw)
To: mst
Cc: vyasevic, alexander.h.duyck, Ian.Campbell, kvm, netdev,
linux-kernel, virtualization, edumazet, akpm
In-Reply-To: <20121101161611.GA9410@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Thu, 1 Nov 2012 18:16:11 +0200
> Do you think it's over-engineering, or a good idea?
Engineer what you need, not what you might need.
^ permalink raw reply
* Re: [PATCHv2 net-next 1/8] skb: report completion status for zero copy skbs
From: Michael S. Tsirkin @ 2012-11-01 16:16 UTC (permalink / raw)
To: David Miller
Cc: vyasevic, alexander.h.duyck, Ian.Campbell, kvm, netdev,
linux-kernel, virtualization, edumazet, akpm
In-Reply-To: <20121101.115024.1422610516561380154.davem@davemloft.net>
On Thu, Nov 01, 2012 at 11:50:24AM -0400, David Miller wrote:
> From: "Michael S. Tsirkin" <mst@redhat.com>
> Date: Wed, 31 Oct 2012 12:31:06 +0200
>
> > -void vhost_zerocopy_callback(struct ubuf_info *ubuf)
> > +void vhost_zerocopy_callback(struct ubuf_info *ubuf, int zerocopy_status)
>
> If you're only reporting true/false values, even just for now,
> please use 'bool' for this.
In fact next patch reports -ENOMEM when tun hits OOM so callback can
distinguish between copy (>0 value) and error (<0 value)
and reduce zerocopy more aggressively in case of errors.
The *callback* in vhost-net currently handles all non-zero
values identically, but I am not sure it's the optimal behaviour
so I thought it's worth it to give callbacks the info.
Do you think it's over-engineering, or a good idea?
--
MST
^ permalink raw reply
* Re: [PATCH v2 RESEND 3/6] net: calxedaxgmac: use relaxed i/o accessors in rx and tx paths
From: David Miller @ 2012-11-01 16:05 UTC (permalink / raw)
To: rob.herring; +Cc: netdev, eric.dumazet
In-Reply-To: <50929BCF.3070503@calxeda.com>
From: Rob Herring <rob.herring@calxeda.com>
Date: Thu, 01 Nov 2012 10:57:03 -0500
> Or would you be okay with using __raw_readl/__raw_writel?
Those should be provided by all HAS_IOMEM platforms, so yes.
^ permalink raw reply
* Re: [PATCH v2 RESEND 3/6] net: calxedaxgmac: use relaxed i/o accessors in rx and tx paths
From: Rob Herring @ 2012-11-01 15:57 UTC (permalink / raw)
To: David Miller; +Cc: netdev, eric.dumazet
In-Reply-To: <20121101.112141.2093388998181270335.davem@davemloft.net>
On 11/01/2012 10:21 AM, David Miller wrote:
> From: Rob Herring <robherring2@gmail.com>
> Date: Thu, 1 Nov 2012 05:41:01 -0500
>
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> The standard readl/writel accessors involve a spinlock and cache sync
>> operation on ARM platforms with an outer cache. Only DMA triggering
>> accesses need this, so use the relaxed variants instead.
>>
>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>> ---
>> drivers/net/ethernet/calxeda/Kconfig | 2 +-
>> drivers/net/ethernet/calxeda/xgmac.c | 12 ++++++------
>> 2 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/calxeda/Kconfig b/drivers/net/ethernet/calxeda/Kconfig
>> index aba435c..6a4ddf6 100644
>> --- a/drivers/net/ethernet/calxeda/Kconfig
>> +++ b/drivers/net/ethernet/calxeda/Kconfig
>> @@ -1,6 +1,6 @@
>> config NET_CALXEDA_XGMAC
>> tristate "Calxeda 1G/10G XGMAC Ethernet driver"
>> - depends on HAS_IOMEM
>> + depends on HAS_IOMEM && ARM
>> select CRC32
>> help
>> This is the driver for the XGMAC Ethernet IP block found on Calxeda
>
> This is a regression. Now I can't built test this driver on x86
> or sparc.
>
> I'm not applying this series. You can argue until the cows come home
> about why you absolutley have to add this restriction, but I simply
> don't care, this issue is too important to me.
I did first try fixing this in the ARM L2 code, but that was rejected as
well. It is a 20-30% performance difference.
It would be nice if we had unified accessors on all platforms. Are you
okay with adding "!(BLACKFIN || HEXAGON || M68K || MICROBLAZE ||
OPENRISC || S390 || SCORE || UNICORE32)"?
Or would you be okay with using __raw_readl/__raw_writel?
Rob
^ permalink raw reply
* Re: [PATCH v4 0/21] qlcnic: patches for new adapter - Qlogic 83XX CNA
From: David Miller @ 2012-11-01 16:03 UTC (permalink / raw)
To: sony.chacko; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1351556092-16417-1-git-send-email-sony.chacko@qlogic.com>
Patch #17 did not make it to the list, you have to make it smaller
so that it fits.
^ permalink raw reply
* Re: [PATCH net] tcp: Fix double sizeof in new tcp_metrics code
From: David Miller @ 2012-11-01 16:00 UTC (permalink / raw)
To: ja; +Cc: netdev
In-Reply-To: <1351634589-4861-1-git-send-email-ja@ssi.bg>
From: Julian Anastasov <ja@ssi.bg>
Date: Wed, 31 Oct 2012 00:03:09 +0200
> Fix double sizeof when parsing IPv6 address from
> user space because it breaks get/del by specific IPv6 address.
>
> Problem noticed by David Binderman:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=49171
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
Applied, thanks.
^ permalink raw reply
* Re: [net PATCH V2] net: fix divide by zero in tcp algorithm illinois
From: David Miller @ 2012-11-01 15:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: brouer, netdev, pmatouse, shemminger
In-Reply-To: <1351703678.32673.414.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 31 Oct 2012 18:14:38 +0100
> On Wed, 2012-10-31 at 13:45 +0100, Jesper Dangaard Brouer wrote:
>> Reading TCP stats when using TCP Illinois congestion control algorithm
>> can cause a divide by zero kernel oops.
>>
>> The division by zero occur in tcp_illinois_info() at:
>> do_div(t, ca->cnt_rtt);
>> where ca->cnt_rtt can become zero (when rtt_reset is called)
>>
>
>> Cc: Petr Matousek <pmatouse@redhat.com>
>> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
>>
>> ---
>
> Acked-by: Eric Dumazet <edumazet@google.com>
Applied, thanks everyone.
^ 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