Displaying 20 results from an estimated 152 matches for "nr_frags".
2013 Jan 04
31
xennet: skb rides the rocket: 20 slots
...don''t have enough knowledge if this could/should be prevented from happening ?
[16798.629141] xennet: skb rides the rocket: 19 slots MAX_SKB_FRAGS: 17 div_roundup:1 xennet_count_skb_frag_slots:18 offset:106 skb_headlen:1622 skb->len:64294, skb->data_len:62672 skb->truesize:64976 nr_frags:4 page_size:4096 prot:0800
[16800.575182] xennet: skb rides the rocket: 19 slots MAX_SKB_FRAGS: 17 div_roundup:1 xennet_count_skb_frag_slots:18 offset:2154 skb_headlen:1622 skb->len:64294, skb->data_len:62672 skb->truesize:64976 nr_frags:4 page_size:4096 prot:0800
[16801.589166] xennet: sk...
2011 Oct 05
0
[PATCH 3/8] xen: netfront: convert to SKB paged frag API.
.../xen-netfront.c b/drivers/net/xen-netfront.c
index d7c8a98..6e5d4c0 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -275,7 +275,7 @@ no_skb:
break;
}
- skb_shinfo(skb)->frags[0].page = page;
+ __skb_fill_page_desc(skb, 0, page, 0, 0);
skb_shinfo(skb)->nr_frags = 1;
__skb_queue_tail(&np->rx_batch, skb);
}
@@ -309,8 +309,8 @@ no_skb:
BUG_ON((signed short)ref < 0);
np->grant_rx_ref[id] = ref;
- pfn = page_to_pfn(skb_shinfo(skb)->frags[0].page);
- vaddr = page_address(skb_shinfo(skb)->frags[0].page);
+ pfn = page_to_pfn(skb...
2013 Jul 02
3
[PATCH RFC] xen-netback: remove guest RX path dependence on MAX_SKB_FRAGS
...vif->rx.sring->req_event = vif->rx_req_cons_peek + 1;
mb(); /* request notification /then/ check the queue */
return xen_netbk_rx_ring_full(vif);
@@ -675,7 +662,6 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
struct sk_buff *skb;
LIST_HEAD(notify);
int ret;
- int nr_frags;
int count;
unsigned long offset;
struct skb_cb_overlay *sco;
@@ -690,20 +676,23 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
count = 0;
while ((skb = skb_dequeue(&netbk->rx_queue)) != NULL) {
+ unsigned int ring_slots_required;
vif = netdev_priv(skb->dev);...
2013 Jul 09
20
[PATCH 1/1] xen/netback: correctly calculate required slots of skb.
...unused frames from start of page */
+ page += offset >> PAGE_SHIFT;
+ offset &= ~PAGE_MASK;
- if (skb_shinfo(skb)->gso_size)
- count++;
+ while (size > 0) {
+ BUG_ON(offset >= PAGE_SIZE);
+ BUG_ON(*copy_off > MAX_BUFFER_OFFSET);
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
- unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
- unsigned long offset = skb_shinfo(skb)->frags[i].page_offset;
- unsigned long bytes;
+ bytes = PAGE_SIZE - offset;
- offset &= ~PAGE_MASK;
+ if (bytes > size)
+ bytes = size;
- while (size >...
2023 Mar 28
1
[PATCH net-next 4/8] virtio_net: separate the logic of freeing xdp shinfo
...int virtnet_xdp_xmit(struct net_device *dev,
return ret;
}
+static void put_xdp_frags(struct xdp_buff *xdp)
+{
+ struct skb_shared_info *shinfo;
+ struct page *xdp_page;
+ int i;
+
+ if (xdp_buff_has_frags(xdp)) {
+ shinfo = xdp_get_shared_info_from_buff(xdp);
+ for (i = 0; i < shinfo->nr_frags; i++) {
+ xdp_page = skb_frag_page(&shinfo->frags[i]);
+ put_page(xdp_page);
+ }
+ }
+}
+
static int virtnet_xdp_handler(struct bpf_prog *xdp_prog, struct xdp_buff *xdp,
struct net_device *dev,
unsigned int *xdp_xmit,
@@ -1312,12 +1327,9 @@ static struct sk_buff *...
2010 Sep 15
15
xenpaging fixes for kernel and hypervisor
Patrick,
there following patches fix xenpaging for me.
Granttable handling is incomplete. If a page is gone, a GNTST_eagain
should be returned to the caller to inidcate the hypercall has to be
retried after a while, until the page is available again.
Please review.
Olaf
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
2013 Oct 28
8
[PATCH net-next] virtio_net: migrate mergeable rx buffers to page frag allocators
...@ static void skb_xmit_done(struct virtqueue *vq)
netif_wake_subqueue(vi->dev, vq2txq(vq));
}
-static void set_skb_frag(struct sk_buff *skb, struct page *page,
- unsigned int offset, unsigned int *len)
-{
- int size = min((unsigned)PAGE_SIZE - offset, *len);
- int i = skb_shinfo(skb)->nr_frags;
-
- __skb_fill_page_desc(skb, i, page, offset, size);
-
- skb->data_len += size;
- skb->len += size;
- skb->truesize += PAGE_SIZE;
- skb_shinfo(skb)->nr_frags++;
- skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG;
- *len -= size;
-}
-
/* Called from bottom half context */
static str...
2013 Oct 28
8
[PATCH net-next] virtio_net: migrate mergeable rx buffers to page frag allocators
...@ static void skb_xmit_done(struct virtqueue *vq)
netif_wake_subqueue(vi->dev, vq2txq(vq));
}
-static void set_skb_frag(struct sk_buff *skb, struct page *page,
- unsigned int offset, unsigned int *len)
-{
- int size = min((unsigned)PAGE_SIZE - offset, *len);
- int i = skb_shinfo(skb)->nr_frags;
-
- __skb_fill_page_desc(skb, i, page, offset, size);
-
- skb->data_len += size;
- skb->len += size;
- skb->truesize += PAGE_SIZE;
- skb_shinfo(skb)->nr_frags++;
- skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG;
- *len -= size;
-}
-
/* Called from bottom half context */
static str...
2013 Oct 29
0
[PATCH net-next] virtio_net: migrate mergeable rx buffers to page frag allocators
...bqueue(vi->dev, vq2txq(vq));
> }
>
> -static void set_skb_frag(struct sk_buff *skb, struct page *page,
> - unsigned int offset, unsigned int *len)
> -{
> - int size = min((unsigned)PAGE_SIZE - offset, *len);
> - int i = skb_shinfo(skb)->nr_frags;
> -
> - __skb_fill_page_desc(skb, i, page, offset, size);
> -
> - skb->data_len += size;
> - skb->len += size;
> - skb->truesize += PAGE_SIZE;
> - skb_shinfo(skb)->nr_frags++;
> - skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_F...
2013 Jul 10
13
[PATCH v2 1/1] xen/netback: correctly calculate required slots of skb.
...offset &= ~PAGE_MASK;
- copy_off = skb_headlen(skb) % PAGE_SIZE;
+ while (size > 0) {
+ BUG_ON(offset >= PAGE_SIZE);
+ BUG_ON(*copy_off > MAX_BUFFER_OFFSET);
- if (skb_shinfo(skb)->gso_size)
- count++;
+ bytes = PAGE_SIZE - offset;
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
- unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
- unsigned long offset = skb_shinfo(skb)->frags[i].page_offset;
- unsigned long bytes;
+ if (bytes > size)
+ bytes = size;
- offset &= ~PAGE_MASK;
+ if (start_new_rx_buffer(*copy_off, bytes, *head))...
2013 Nov 27
4
[PATCH 1/2] virtio_net: fix error handling for mergeable buffers
...fset, len,
+ MERGE_BUFFER_LEN);
struct sk_buff *curr_skb = head_skb;
- char *buf;
- struct page *page;
- int num_buf, len, offset;
- num_buf = hdr->mhdr.num_buffers;
+ if (unlikely(!curr_skb))
+ goto err_skb;
+
while (--num_buf) {
- int num_skb_frags = skb_shinfo(curr_skb)->nr_frags;
+ int num_skb_frags;
+
buf = virtqueue_get_buf(rq->vq, &len);
if (unlikely(!buf)) {
- pr_debug("%s: rx error: %d buffers missing\n",
- head_skb->dev->name, hdr->mhdr.num_buffers);
- head_skb->dev->stats.rx_length_errors++;
- return -EINVAL;
+ pr_d...
2013 Nov 27
4
[PATCH 1/2] virtio_net: fix error handling for mergeable buffers
...fset, len,
+ MERGE_BUFFER_LEN);
struct sk_buff *curr_skb = head_skb;
- char *buf;
- struct page *page;
- int num_buf, len, offset;
- num_buf = hdr->mhdr.num_buffers;
+ if (unlikely(!curr_skb))
+ goto err_skb;
+
while (--num_buf) {
- int num_skb_frags = skb_shinfo(curr_skb)->nr_frags;
+ int num_skb_frags;
+
buf = virtqueue_get_buf(rq->vq, &len);
if (unlikely(!buf)) {
- pr_debug("%s: rx error: %d buffers missing\n",
- head_skb->dev->name, hdr->mhdr.num_buffers);
- head_skb->dev->stats.rx_length_errors++;
- return -EINVAL;
+ pr_d...
2013 Nov 28
4
[PATCH v2 1/2] virtio_net: fix error handling for mergeable buffers
...fset, len,
+ MERGE_BUFFER_LEN);
struct sk_buff *curr_skb = head_skb;
- char *buf;
- struct page *page;
- int num_buf, len, offset;
- num_buf = hdr->mhdr.num_buffers;
+ if (unlikely(!curr_skb))
+ goto err_skb;
+
while (--num_buf) {
- int num_skb_frags = skb_shinfo(curr_skb)->nr_frags;
+ int num_skb_frags;
+
buf = virtqueue_get_buf(rq->vq, &len);
if (unlikely(!buf)) {
- pr_debug("%s: rx error: %d buffers missing\n",
- head_skb->dev->name, hdr->mhdr.num_buffers);
- head_skb->dev->stats.rx_length_errors++;
- return -EINVAL;
+ pr_d...
2013 Nov 28
4
[PATCH v2 1/2] virtio_net: fix error handling for mergeable buffers
...fset, len,
+ MERGE_BUFFER_LEN);
struct sk_buff *curr_skb = head_skb;
- char *buf;
- struct page *page;
- int num_buf, len, offset;
- num_buf = hdr->mhdr.num_buffers;
+ if (unlikely(!curr_skb))
+ goto err_skb;
+
while (--num_buf) {
- int num_skb_frags = skb_shinfo(curr_skb)->nr_frags;
+ int num_skb_frags;
+
buf = virtqueue_get_buf(rq->vq, &len);
if (unlikely(!buf)) {
- pr_debug("%s: rx error: %d buffers missing\n",
- head_skb->dev->name, hdr->mhdr.num_buffers);
- head_skb->dev->stats.rx_length_errors++;
- return -EINVAL;
+ pr_d...
2013 Dec 27
2
[PATCH net-next RFC] virtio-net: drop rq->max and rq->num
...#39;ve ever had. */
- unsigned int num, max;
-
/* Chain pages by the private ptr. */
struct page *pages;
@@ -360,7 +357,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
}
page = virt_to_head_page(buf);
- --rq->num;
num_skb_frags = skb_shinfo(curr_skb)->nr_frags;
if (unlikely(num_skb_frags == MAX_SKB_FRAGS)) {
@@ -406,7 +402,6 @@ err_skb:
}
page = virt_to_head_page(buf);
put_page(page);
- --rq->num;
}
err_buf:
dev->stats.rx_dropped++;
@@ -628,10 +623,7 @@ static bool try_fill_recv(struct receive_queue *rq, gfp_t gfp)
oom = err ==...
2013 Dec 27
2
[PATCH net-next RFC] virtio-net: drop rq->max and rq->num
...#39;ve ever had. */
- unsigned int num, max;
-
/* Chain pages by the private ptr. */
struct page *pages;
@@ -360,7 +357,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
}
page = virt_to_head_page(buf);
- --rq->num;
num_skb_frags = skb_shinfo(curr_skb)->nr_frags;
if (unlikely(num_skb_frags == MAX_SKB_FRAGS)) {
@@ -406,7 +402,6 @@ err_skb:
}
page = virt_to_head_page(buf);
put_page(page);
- --rq->num;
}
err_buf:
dev->stats.rx_dropped++;
@@ -628,10 +623,7 @@ static bool try_fill_recv(struct receive_queue *rq, gfp_t gfp)
oom = err ==...
2013 Oct 31
6
[PATCH net-next 1/2] net: introduce skb_coalesce_rx_frag()
...*skb, int i,
void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off,
int size, unsigned int truesize);
+void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int off, int size,
+ unsigned int truesize);
+
#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb))
#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb))
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 0ab32fa..fdef994 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -476,6 +476,19 @@ void skb_add_rx_frag(st...
2013 Oct 31
6
[PATCH net-next 1/2] net: introduce skb_coalesce_rx_frag()
...*skb, int i,
void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off,
int size, unsigned int truesize);
+void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int off, int size,
+ unsigned int truesize);
+
#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb))
#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb))
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 0ab32fa..fdef994 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -476,6 +476,19 @@ void skb_add_rx_frag(st...
2013 Nov 28
0
[PATCH 1/2] virtio_net: fix error handling for mergeable buffers
...t sk_buff *curr_skb = head_skb;
> - char *buf;
> - struct page *page;
> - int num_buf, len, offset;
>
> - num_buf = hdr->mhdr.num_buffers;
> + if (unlikely(!curr_skb))
> + goto err_skb;
> +
> while (--num_buf) {
> - int num_skb_frags = skb_shinfo(curr_skb)->nr_frags;
> + int num_skb_frags;
> +
> buf = virtqueue_get_buf(rq->vq, &len);
> if (unlikely(!buf)) {
> - pr_debug("%s: rx error: %d buffers missing\n",
> - head_skb->dev->name, hdr->mhdr.num_buffers);
> - head_skb->dev->stats.rx_length_err...
2023 Mar 28
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...c struct sk_buff *receive_mergeable(struct net_device *dev,
goto err_xdp_frags;
}
err_xdp_frags:
- if (unlikely(xdp_page != page))
- __free_pages(xdp_page, 0);
-
if (xdp_buff_has_frags(&xdp)) {
shinfo = xdp_get_shared_info_from_buff(&xdp);
for (i = 0; i < shinfo->nr_frags; i++) {
--
2.32.0.3.g01195cf9f