[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 08/26: commit 042a53a9e437feaf2230dd2cadcecfae9c7bfe05
From: |
Samuel Thibault |
Subject: |
[hurd] 08/26: commit 042a53a9e437feaf2230dd2cadcecfae9c7bfe05 |
Date: |
Tue, 22 Sep 2015 21:51:47 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch dde
in repository hurd.
commit a4f0e9af03f163f2dd59e80c33de8aa3ea8511fd
Author: Eric Dumazet <address@hidden>
Date: Fri Jun 5 04:04:16 2009 +0000
commit 042a53a9e437feaf2230dd2cadcecfae9c7bfe05
net: skb_shared_info optimization
skb_dma_unmap() is quite expensive for small packets,
because we use two different cache lines from skb_shared_info.
One to access nr_frags, one to access dma_maps[0]
Instead of dma_maps being an array of MAX_SKB_FRAGS + 1 elements,
let dma_head alone in a new dma_head field, close to nr_frags,
to reduce cache lines misses.
Tested on my dev machine (bnx2 & tg3 adapters), nice speedup !
Signed-off-by: Eric Dumazet <address@hidden>
Signed-off-by: David S. Miller <address@hidden>
---
libdde_linux26/contrib/include/linux/skbuff.h | 5 ++++-
libdde_linux26/contrib/net/core/skb_dma_map.c | 12 ++++++------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/libdde_linux26/contrib/include/linux/skbuff.h
b/libdde_linux26/contrib/include/linux/skbuff.h
index a9e9534..6e8450c 100644
--- a/libdde_linux26/contrib/include/linux/skbuff.h
+++ b/libdde_linux26/contrib/include/linux/skbuff.h
@@ -142,6 +142,9 @@ struct skb_shared_info {
atomic_t dataref;
unsigned short nr_frags;
unsigned short gso_size;
+#ifdef CONFIG_HAS_DMA
+ dma_addr_t dma_head;
+#endif
/* Warning: this field is not always filled in (UFO)! */
unsigned short gso_segs;
unsigned short gso_type;
@@ -152,7 +155,7 @@ struct skb_shared_info {
struct sk_buff *frag_list;
skb_frag_t frags[MAX_SKB_FRAGS];
#ifdef CONFIG_HAS_DMA
- dma_addr_t dma_maps[MAX_SKB_FRAGS + 1];
+ dma_addr_t dma_maps[MAX_SKB_FRAGS];
#endif
};
diff --git a/libdde_linux26/contrib/net/core/skb_dma_map.c
b/libdde_linux26/contrib/net/core/skb_dma_map.c
index 8623492..07d4ac5 100644
--- a/libdde_linux26/contrib/net/core/skb_dma_map.c
+++ b/libdde_linux26/contrib/net/core/skb_dma_map.c
@@ -20,7 +20,7 @@ int skb_dma_map(struct device *dev, struct sk_buff *skb,
if (dma_mapping_error(dev, map))
goto out_err;
- sp->dma_maps[0] = map;
+ sp->dma_head = map;
for (i = 0; i < sp->nr_frags; i++) {
skb_frag_t *fp = &sp->frags[i];
@@ -28,7 +28,7 @@ int skb_dma_map(struct device *dev, struct sk_buff *skb,
fp->size, dir);
if (dma_mapping_error(dev, map))
goto unwind;
- sp->dma_maps[i + 1] = map;
+ sp->dma_maps[i] = map;
}
sp->num_dma_maps = i + 1;
@@ -38,10 +38,10 @@ unwind:
while (--i >= 0) {
skb_frag_t *fp = &sp->frags[i];
- dma_unmap_page(dev, sp->dma_maps[i + 1],
+ dma_unmap_page(dev, sp->dma_maps[i],
fp->size, dir);
}
- dma_unmap_single(dev, sp->dma_maps[0],
+ dma_unmap_single(dev, sp->dma_head,
skb_headlen(skb), dir);
out_err:
return -ENOMEM;
@@ -54,12 +54,12 @@ void skb_dma_unmap(struct device *dev, struct sk_buff *skb,
struct skb_shared_info *sp = skb_shinfo(skb);
int i;
- dma_unmap_single(dev, sp->dma_maps[0],
+ dma_unmap_single(dev, sp->dma_head,
skb_headlen(skb), dir);
for (i = 0; i < sp->nr_frags; i++) {
skb_frag_t *fp = &sp->frags[i];
- dma_unmap_page(dev, sp->dma_maps[i + 1],
+ dma_unmap_page(dev, sp->dma_maps[i],
fp->size, dir);
}
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 07/26: Fix build, (continued)
- [hurd] 07/26: Fix build, Samuel Thibault, 2015/09/22
- [hurd] 02/26: commit 260d703adc5f275e3ba7ddff6e2e0217bc613b35, Samuel Thibault, 2015/09/22
- [hurd] 01/26: commit dc1f8bf68b311b1537cb65893430b6796118498a, Samuel Thibault, 2015/09/22
- [hurd] 10/26: Add ethoc.h, Samuel Thibault, 2015/09/22
- [hurd] 13/26: udpate ethtool.h, Samuel Thibault, 2015/09/22
- [hurd] 11/26: Cherry-pick phy.h updates, Samuel Thibault, 2015/09/22
- [hurd] 05/26: commit 0c27922e4933ceb86644f4a9b1af212ffe5aad75, Samuel Thibault, 2015/09/22
- [hurd] 16/26: Add devres.c, Samuel Thibault, 2015/09/22
- [hurd] 18/26: commit d5a9e24afb4ab38110ebb777588ea0bd0eacbd0a, Samuel Thibault, 2015/09/22
- [hurd] 24/26: Merge remote-tracking branch 'incubator/dde' into dde-upstream, Samuel Thibault, 2015/09/22
- [hurd] 08/26: commit 042a53a9e437feaf2230dd2cadcecfae9c7bfe05,
Samuel Thibault <=
- [hurd] 22/26: Install missing queue.h, Samuel Thibault, 2015/09/22
- [hurd] 12/26: update pci_ids, Samuel Thibault, 2015/09/22
- [hurd] 17/26: Add pr_cont, Samuel Thibault, 2015/09/22
- [hurd] 26/26: Move files, Samuel Thibault, 2015/09/22
- [hurd] 14/26: update workqueue.h, Samuel Thibault, 2015/09/22
- [hurd] 25/26: Merge branch 'dde-upstream' into dde, Samuel Thibault, 2015/09/22
- [hurd] 23/26: Fix build with gcc 5, Samuel Thibault, 2015/09/22
- [hurd] 15/26: commit 9d21493b4beb8f918ba248032fefa393074a5e2b, Samuel Thibault, 2015/09/22
- [hurd] 21/26: Fix insecure format, Samuel Thibault, 2015/09/22
- [hurd] 03/26: commit f001fde5eadd915f4858d22ed70d7040f48767cf, Samuel Thibault, 2015/09/22