Displaying 20 results from an estimated 71 matches for "net_ip_align".
2009 Feb 10
1
[PATCH 1/2] Fix ixgbe RSS operation
...lags & IXGBE_FLAG_VMDQ_ENABLED)
+ skb->proto_data_valid = 1;
#endif
}
@@ -1060,9 +1057,8 @@
skb = rx_buffer_info->skb;
rx_buffer_info->skb = NULL;
#ifdef CONFIG_XEN_NETDEV2_BACKEND
- if(!rx_ring->queue_index || !skb_shinfo(skb)->nr_frags) {
- prefetch(skb->data - NET_IP_ALIGN);
- } else {
+ if ((adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) &&
+ rx_ring->queue_index) {
/* for Xen VMDq, packet data goes in first page of
* skb, instead of data.
*/
@@ -1071,6 +1067,8 @@
PAGE_SIZE, PCI_DMA_FROMDEVICE);
skb->len +...
2009 Jan 27
5
[PATCH 2/2] Add VMDq support to ixgbe
...c even if buffer_addrs didn''t change because
* each write-back erases this info. */
if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) {
@@ -1019,9 +1058,23 @@ static bool ixgbe_clean_rx_irq(struct ix
cleaned = true;
skb = rx_buffer_info->skb;
- prefetch(skb->data - NET_IP_ALIGN);
rx_buffer_info->skb = NULL;
-
+#ifdef CONFIG_XEN_NETDEV2_BACKEND
+ if(!rx_ring->queue_index || !skb_shinfo(skb)->nr_frags) {
+ prefetch(skb->data - NET_IP_ALIGN);
+ } else {
+ /* for Xen VMDq, packet data goes in first page of
+ * skb, instead of data.
+ */
+ // TODO...
2006 Oct 18
21
[PATCH][RESEND] PV drivers for HVM guests
I am enclosing the patch I have been working on. I have tested this on sles9 (2.6.5) and RHEL 4 (2.6.9). The patch applies cleanly on ChangeSet 11635. This patch was cleaned up based on Ian''s and DOI''s work.
Signed-off-by: K. Y. Srinivasan (ksrinivasan@novell.com)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
2018 Sep 06
1
[PATCH net-next 02/11] tuntap: switch to use XDP_PACKET_HEADROOM
...>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 2c548bd20393..d3677a544b56 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -113,7 +113,6 @@ do { \
> } while (0)
> #endif
>
> -#define TUN_HEADROOM 256
> #define TUN_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD)
>
> /* TUN device flags */
> @@ -1654,7 +1653,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,
> rcu_read_lock();
> xdp_prog = rcu_dereference(tun->xdp_prog);
> if (xdp_prog)
> - pad += TUN_HEADROOM;
> + pad += XDP_PACKET_HEADROO...
2008 Aug 26
0
[PATCH] xen-netfront: Avoid unaligned accesses to IP header.
...et_alloc_rx_buffers(struct net_device *dev)
*/
batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) {
- skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD,
+ skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD + NET_IP_ALIGN,
GFP_ATOMIC | __GFP_NOWARN);
if (unlikely(!skb))
goto no_skb;
+ /* Align ip header to a 16 bytes boundary */
+ skb_reserve(skb, NET_IP_ALIGN);
+
page = alloc_page(GFP_ATOMIC | __GFP_NOWARN);
if (!page) {
kfree_skb(skb);
--
1.6.0.rc0.42.g186458
2008 Jul 03
0
[PATCH] xen/netfront: Avoid unaligned accesses to IP datagrams.
...et_alloc_rx_buffers(struct net_device *dev)
*/
batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) {
- skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD,
+ skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD + NET_IP_ALIGN,
GFP_ATOMIC | __GFP_NOWARN);
if (unlikely(!skb))
goto no_skb;
+ /* Align ip header to a 16 bytes boundary */
+ skb_reserve(skb, NET_IP_ALIGN);
+
page = alloc_page(GFP_ATOMIC | __GFP_NOWARN);
if (!page) {
kfree_skb(skb);
--
1.5.3
--
yamahata
2008 Aug 26
0
[PATCH] xen-netfront: Avoid unaligned accesses to IP header.
...et_alloc_rx_buffers(struct net_device *dev)
*/
batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) {
- skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD,
+ skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD + NET_IP_ALIGN,
GFP_ATOMIC | __GFP_NOWARN);
if (unlikely(!skb))
goto no_skb;
+ /* Align ip header to a 16 bytes boundary */
+ skb_reserve(skb, NET_IP_ALIGN);
+
page = alloc_page(GFP_ATOMIC | __GFP_NOWARN);
if (!page) {
kfree_skb(skb);
--
1.6.0.rc0.42.g186458
2008 Aug 26
0
[PATCH] xen-netfront: Avoid unaligned accesses to IP header.
...et_alloc_rx_buffers(struct net_device *dev)
*/
batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) {
- skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD,
+ skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD + NET_IP_ALIGN,
GFP_ATOMIC | __GFP_NOWARN);
if (unlikely(!skb))
goto no_skb;
+ /* Align ip header to a 16 bytes boundary */
+ skb_reserve(skb, NET_IP_ALIGN);
+
page = alloc_page(GFP_ATOMIC | __GFP_NOWARN);
if (!page) {
kfree_skb(skb);
--
1.6.0.rc0.42.g186458
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 |
2018 May 21
2
[RFC PATCH net-next 10/12] vhost_net: build xdp buff
...639d7..1209e84 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -492,6 +492,80 @@ static bool vhost_has_more_pkts(struct vhost_net *net,
> likely(!vhost_exceeds_maxpend(net));
> }
>
> +#define VHOST_NET_HEADROOM 256
> +#define VHOST_NET_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD)
> +
> +static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq,
> + struct iov_iter *from,
> + struct xdp_buff *xdp)
> +{
> + struct vhost_virtqueue *vq = &nvq->vq;
> + struct page_frag *alloc_frag = ¤t->task_frag;
>...
2005 Feb 09
1
RE: [PATCH 2/2] netfront skb padding
...(0)
>
> -/* Allow headroom on each rx pkt for Ethernet header,
> alignment padding, ... */
> -#define RX_HEADROOM 200
> +/*
> + * Allow headroom on each rx pkt for Ethernet header,
> alignment padding,
> + * CRC, and VLAN
> + */
> +#define RX_HEADROOM ETH_HLEN + NET_IP_ALIGN + 8
>
> /*
> * If the backend driver is pipelining transmit requests
> then we can be very
> @@ -1248,7 +1253,8 @@ static int __init netif_init(void)
> if (xen_start_info.flags & SIF_INITDOMAIN)
> return 0;
>
> - IPRINTK("Initialising vi...
2018 Sep 06
2
[PATCH net-next 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
..., out, in, msg, busyloop_intr);
>
> if (ret < 0 || ret == vq->num)
> return ret;
> @@ -540,6 +574,83 @@ static bool tx_can_batch(struct vhost_virtqueue *vq, size_t total_len)
> !vhost_vq_avail_empty(vq->dev, vq);
> }
>
> +#define VHOST_NET_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD)
I wonder whether NET_IP_ALIGN make sense for XDP.
> +
> +static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq,
> + struct iov_iter *from)
> +{
> + struct vhost_virtqueue *vq = &nvq->vq;
> + struct socket *sock = vq->private_data;
>...
2018 Sep 06
2
[PATCH net-next 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
..., out, in, msg, busyloop_intr);
>
> if (ret < 0 || ret == vq->num)
> return ret;
> @@ -540,6 +574,83 @@ static bool tx_can_batch(struct vhost_virtqueue *vq, size_t total_len)
> !vhost_vq_avail_empty(vq->dev, vq);
> }
>
> +#define VHOST_NET_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD)
I wonder whether NET_IP_ALIGN make sense for XDP.
> +
> +static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq,
> + struct iov_iter *from)
> +{
> + struct vhost_virtqueue *vq = &nvq->vq;
> + struct socket *sock = vq->private_data;
>...
2016 Feb 21
1
[PATCH] virtio_net: switch to build_skb for mrg_rxbuf
...--------
1 file changed, 35 insertions(+), 9 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 767ab11..20f8dda 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -347,6 +347,26 @@ err:
return NULL;
}
+#define VNET_SKB_PAD (NET_SKB_PAD + NET_IP_ALIGN)
+#define VNET_SKB_BUG (VNET_SKB_PAD < sizeof(struct virtio_net_hdr_mrg_rxbuf))
+#define VNET_SKB_LEN(len) ((len) - sizeof(struct virtio_net_hdr_mrg_rxbuf))
+#define VNET_SKB_OFF VNET_SKB_LEN(VNET_SKB_PAD)
+
+static struct sk_buff *vnet_build_skb(struct virtnet_info *vi,
+ void *buf,
+...
2016 Feb 21
1
[PATCH] virtio_net: switch to build_skb for mrg_rxbuf
...--------
1 file changed, 35 insertions(+), 9 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 767ab11..20f8dda 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -347,6 +347,26 @@ err:
return NULL;
}
+#define VNET_SKB_PAD (NET_SKB_PAD + NET_IP_ALIGN)
+#define VNET_SKB_BUG (VNET_SKB_PAD < sizeof(struct virtio_net_hdr_mrg_rxbuf))
+#define VNET_SKB_LEN(len) ((len) - sizeof(struct virtio_net_hdr_mrg_rxbuf))
+#define VNET_SKB_OFF VNET_SKB_LEN(VNET_SKB_PAD)
+
+static struct sk_buff *vnet_build_skb(struct virtnet_info *vi,
+ void *buf,
+...
2018 Sep 07
0
[PATCH net-next 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
...t;
>> if (ret < 0 || ret == vq->num)
>> return ret;
>> @@ -540,6 +574,83 @@ static bool tx_can_batch(struct vhost_virtqueue *vq, size_t total_len)
>> !vhost_vq_avail_empty(vq->dev, vq);
>> }
>>
>> +#define VHOST_NET_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD)
> I wonder whether NET_IP_ALIGN make sense for XDP.
XDP is not the only consumer, socket may build skb based on this.
>
>> +
>> +static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq,
>> + struct iov_iter *from)
>> +{
>> + struc...
2018 Sep 06
0
[PATCH net-next 02/11] tuntap: switch to use XDP_PACKET_HEADROOM
...| 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 2c548bd20393..d3677a544b56 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -113,7 +113,6 @@ do { \
} while (0)
#endif
-#define TUN_HEADROOM 256
#define TUN_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD)
/* TUN device flags */
@@ -1654,7 +1653,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,
rcu_read_lock();
xdp_prog = rcu_dereference(tun->xdp_prog);
if (xdp_prog)
- pad += TUN_HEADROOM;
+ pad += XDP_PACKET_HEADROOM;
buflen += SKB_DATA_ALIGN(len + pad)...
2018 May 21
0
[RFC PATCH net-next 10/12] vhost_net: build xdp buff
...ost/net.c b/drivers/vhost/net.c
index f0639d7..1209e84 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -492,6 +492,80 @@ static bool vhost_has_more_pkts(struct vhost_net *net,
likely(!vhost_exceeds_maxpend(net));
}
+#define VHOST_NET_HEADROOM 256
+#define VHOST_NET_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD)
+
+static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq,
+ struct iov_iter *from,
+ struct xdp_buff *xdp)
+{
+ struct vhost_virtqueue *vq = &nvq->vq;
+ struct page_frag *alloc_frag = ¤t->task_frag;
+ struct virtio_net_hdr *gso;
+ size_t...
2014 Oct 23
0
[PATCH RFC] tun: fix sparse warnings for virtio headers
...dr_len > len)
+ if (__virtio16_to_cpu(false, gso.hdr_len) > len)
return -EINVAL;
offset += tun->vnet_hdr_sz;
}
@@ -1054,7 +1054,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
align += NET_IP_ALIGN;
if (unlikely(len < ETH_HLEN ||
- (gso.hdr_len && gso.hdr_len < ETH_HLEN)))
+ (gso.hdr_len && __virtio16_to_cpu(false, gso.hdr_len) < ETH_HLEN)))
return -EINVAL;
}
@@ -1065,7 +1065,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_...