Displaying 20 results from an estimated 30 matches for "netdev_alloc_skb".
2009 Aug 19
1
[PATCH v2 1/2] virtio: Add a can_add_buf helper
This helper returns 1 if a call to add_buf will not fail
with -ENOSPC.
This will help callers that do
while(1) {
alloc()
if (add_buf()) {
free();
break;
}
}
This will result in one less alloc/free exercise.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
---
v2:
return true/false instead of 1/0
drivers/virtio/virtio_ring.c | 8 ++++++++
include/linux/virtio.h |
2009 Aug 19
1
[PATCH v2 1/2] virtio: Add a can_add_buf helper
This helper returns 1 if a call to add_buf will not fail
with -ENOSPC.
This will help callers that do
while(1) {
alloc()
if (add_buf()) {
free();
break;
}
}
This will result in one less alloc/free exercise.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
---
v2:
return true/false instead of 1/0
drivers/virtio/virtio_ring.c | 8 ++++++++
include/linux/virtio.h |
2009 Jan 27
5
[PATCH 2/2] Add VMDq support to ixgbe
...a valid checksum */
skb->ip_summed = CHECKSUM_UNNECESSARY;
adapter->hw_csum_rx_good++;
+
+#ifdef CONFIG_XEN_NETDEV2_BACKEND
+ skb->proto_data_valid = 1;
+#endif
}
/**
@@ -554,13 +569,33 @@ static void ixgbe_alloc_rx_buffers(struc
}
if (!bi->skb) {
- struct sk_buff *skb = netdev_alloc_skb(adapter->netdev,
- bufsz);
+ struct sk_buff *skb;
+#ifdef CONFIG_XEN_NETDEV2_BACKEND
+ if ((adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) &&
+ rx_ring->queue_index) {
+ skb = vmq_alloc_skb(adapter->netdev,
+...
2014 Aug 27
2
[PATCH 1/1] add selftest for virtio-net
...mp;vi->dev->dev, "Failed to set loopback.\n");
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int virtnet_run_loopback_test(struct virtnet_info *vi)
+{
+ int i;
+ netdev_tx_t rc;
+ struct sk_buff *skb;
+ unsigned int size = GOOD_COPY_LEN;
+
+ for (i = 0; i < 100; i++) {
+ skb = netdev_alloc_skb(vi->dev, size);
+ if (!skb)
+ return -ENOMEM;
+
+ skb->queue_mapping = 0;
+ skb_put(skb, size);
+ virtnet_create_lb_frame(skb, size);
+ rc = start_xmit(skb, vi->dev);
+ if (rc != NETDEV_TX_OK)
+ return -EPIPE;
+ atomic_inc(&vi->lb_count);
+ }
+ /* Give queue time to settl...
2014 Aug 27
2
[PATCH 1/1] add selftest for virtio-net
...mp;vi->dev->dev, "Failed to set loopback.\n");
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int virtnet_run_loopback_test(struct virtnet_info *vi)
+{
+ int i;
+ netdev_tx_t rc;
+ struct sk_buff *skb;
+ unsigned int size = GOOD_COPY_LEN;
+
+ for (i = 0; i < 100; i++) {
+ skb = netdev_alloc_skb(vi->dev, size);
+ if (!skb)
+ return -ENOMEM;
+
+ skb->queue_mapping = 0;
+ skb_put(skb, size);
+ virtnet_create_lb_frame(skb, size);
+ rc = start_xmit(skb, vi->dev);
+ if (rc != NETDEV_TX_OK)
+ return -EPIPE;
+ atomic_inc(&vi->lb_count);
+ }
+ /* Give queue time to settl...
2014 Sep 05
1
[PATCH 1/1] add selftest for virtio-net v1.0
...EINVAL;
+ }
+ for (i = 0; i < vi->curr_queue_pairs; i++)
+ napi_disable(&vi->rq[i].napi);
+ return 0;
+}
+
+static int virtnet_run_loopback_test(struct virtnet_info *vi)
+{
+ int i;
+ struct sk_buff *skb;
+ unsigned int size = GOOD_COPY_LEN;
+
+ for (i = 0; i < 100; i++) {
+ skb = netdev_alloc_skb(vi->dev, size);
+ if (!skb)
+ return -ENOMEM;
+
+ skb->queue_mapping = 0;
+ skb_put(skb, size);
+ virtnet_create_lb_frame(skb, size);
+ start_xmit(skb, vi->dev);
+ atomic_inc(&vi->lb_count);
+ }
+ free_old_xmit_skbs(&vi->sq[skb->queue_mapping]);
+ /* Give queue tim...
2014 Sep 05
1
[PATCH 1/1] add selftest for virtio-net v1.0
...EINVAL;
+ }
+ for (i = 0; i < vi->curr_queue_pairs; i++)
+ napi_disable(&vi->rq[i].napi);
+ return 0;
+}
+
+static int virtnet_run_loopback_test(struct virtnet_info *vi)
+{
+ int i;
+ struct sk_buff *skb;
+ unsigned int size = GOOD_COPY_LEN;
+
+ for (i = 0; i < 100; i++) {
+ skb = netdev_alloc_skb(vi->dev, size);
+ if (!skb)
+ return -ENOMEM;
+
+ skb->queue_mapping = 0;
+ skb_put(skb, size);
+ virtnet_create_lb_frame(skb, size);
+ start_xmit(skb, vi->dev);
+ atomic_inc(&vi->lb_count);
+ }
+ free_old_xmit_skbs(&vi->sq[skb->queue_mapping]);
+ /* Give queue tim...
2009 Aug 18
2
[PATCH 1/2] virtio: Add a can_add_buf helper
This helper returns 1 if a call to add_buf will not fail
with -ENOSPC.
This will help callers that do
while(1) {
alloc()
if (add_buf()) {
free();
break;
}
}
This will result in one less alloc/free exercise.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
---
drivers/virtio/virtio_ring.c | 8 ++++++++
include/linux/virtio.h | 5 +++++
2 files changed, 13
2009 Aug 18
2
[PATCH 1/2] virtio: Add a can_add_buf helper
This helper returns 1 if a call to add_buf will not fail
with -ENOSPC.
This will help callers that do
while(1) {
alloc()
if (add_buf()) {
free();
break;
}
}
This will result in one less alloc/free exercise.
Signed-off-by: Amit Shah <amit.shah at redhat.com>
---
drivers/virtio/virtio_ring.c | 8 ++++++++
include/linux/virtio.h | 5 +++++
2 files changed, 13
2014 Aug 27
0
[PATCH 1/1] add selftest for virtio-net
...rd does not support loop back in some way.
> +}
> +
> +static int virtnet_run_loopback_test(struct virtnet_info *vi)
> +{
> + int i;
> + netdev_tx_t rc;
> + struct sk_buff *skb;
> + unsigned int size = GOOD_COPY_LEN;
> +
> + for (i = 0; i < 100; i++) {
> + skb = netdev_alloc_skb(vi->dev, size);
> + if (!skb)
> + return -ENOMEM;
> +
> + skb->queue_mapping = 0;
> + skb_put(skb, size);
> + virtnet_create_lb_frame(skb, size);
> + rc = start_xmit(skb, vi->dev);
virtio_net does not use tx interrupt to free old xmit skbs. It poll tx
completio...
2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
Hi again all,
It turns out that networking really wants ordered requests, which the
previous patches didn't allow. This patch changes it to a callback
mechanism; kudos to Avi.
The downside is that locking is more complicated, and after a few dead
ends I implemented the simplest solution: the struct virtio_device
contains the spinlock to use, and it's held when your callbacks get
2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
Hi again all,
It turns out that networking really wants ordered requests, which the
previous patches didn't allow. This patch changes it to a callback
mechanism; kudos to Avi.
The downside is that locking is more complicated, and after a few dead
ends I implemented the simplest solution: the struct virtio_device
contains the spinlock to use, and it's held when your callbacks get
2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
Hi again all,
It turns out that networking really wants ordered requests, which the
previous patches didn't allow. This patch changes it to a callback
mechanism; kudos to Avi.
The downside is that locking is more complicated, and after a few dead
ends I implemented the simplest solution: the struct virtio_device
contains the spinlock to use, and it's held when your callbacks get
2007 May 31
5
[PATCH RFC 1/3] virtio infrastructure
This attempts to implement a "virtual I/O" layer which should allow
common drivers to be efficiently used across most virtual I/O
mechanisms. It will no-doubt need further enhancement.
The details of probing the device are left to hypervisor-specific
code: it simple constructs the "struct virtio_device" and hands it to
the probe function (eg. virtnet_probe() or
2007 May 31
5
[PATCH RFC 1/3] virtio infrastructure
This attempts to implement a "virtual I/O" layer which should allow
common drivers to be efficiently used across most virtual I/O
mechanisms. It will no-doubt need further enhancement.
The details of probing the device are left to hypervisor-specific
code: it simple constructs the "struct virtio_device" and hands it to
the probe function (eg. virtnet_probe() or
2007 May 31
5
[PATCH RFC 1/3] virtio infrastructure
This attempts to implement a "virtual I/O" layer which should allow
common drivers to be efficiently used across most virtual I/O
mechanisms. It will no-doubt need further enhancement.
The details of probing the device are left to hypervisor-specific
code: it simple constructs the "struct virtio_device" and hands it to
the probe function (eg. virtnet_probe() or
2007 Jul 03
6
[PATCH 1/3] Virtio draft IV
In response to Avi's excellent analysis, I've updated virtio as promised
(apologies for the delay, travel got in the way).
===
This attempts to implement a "virtual I/O" layer which should allow
common drivers to be efficiently used across most virtual I/O
mechanisms. It will no-doubt need further enhancement.
The details of probing the device are left to hypervisor-specific
2007 May 09
3
[patch 7/9] lguest: the net driver
...et(dev, skb, i);
+ }
+ dev_kfree_skb(skb);
+ return 0;
+}
+
+/* Find a new skb to put in this slot in shared mem. */
+static int fill_slot(struct net_device *dev, unsigned int slot)
+{
+ struct lguestnet_info *info = dev->priv;
+ /* Try to create and register a new one. */
+ info->skb[slot] = netdev_alloc_skb(dev, ETH_HLEN + ETH_DATA_LEN);
+ if (!info->skb[slot]) {
+ printk("%s: could not fill slot %i\n", dev->name, slot);
+ return -ENOMEM;
+ }
+
+ skb_to_dma(info->skb[slot], ETH_HLEN + ETH_DATA_LEN, &info->dma[slot]);
+ wmb();
+ /* Now we tell hypervisor it can use the slot....
2007 Jul 03
6
[PATCH 1/3] Virtio draft IV
In response to Avi's excellent analysis, I've updated virtio as promised
(apologies for the delay, travel got in the way).
===
This attempts to implement a "virtual I/O" layer which should allow
common drivers to be efficiently used across most virtual I/O
mechanisms. It will no-doubt need further enhancement.
The details of probing the device are left to hypervisor-specific
2007 May 09
3
[patch 7/9] lguest: the net driver
...et(dev, skb, i);
+ }
+ dev_kfree_skb(skb);
+ return 0;
+}
+
+/* Find a new skb to put in this slot in shared mem. */
+static int fill_slot(struct net_device *dev, unsigned int slot)
+{
+ struct lguestnet_info *info = dev->priv;
+ /* Try to create and register a new one. */
+ info->skb[slot] = netdev_alloc_skb(dev, ETH_HLEN + ETH_DATA_LEN);
+ if (!info->skb[slot]) {
+ printk("%s: could not fill slot %i\n", dev->name, slot);
+ return -ENOMEM;
+ }
+
+ skb_to_dma(info->skb[slot], ETH_HLEN + ETH_DATA_LEN, &info->dma[slot]);
+ wmb();
+ /* Now we tell hypervisor it can use the slot....