Remove skb_dma_map/unmap calls
Subsystems (2)
cover Remove skb_dma_map/unmap calls
This patch series removes the skb_dma_map and skb_dma_unmap function calls. The reason for this change is because the use of skb_dma_map/unmap can lead to serious issues when HW IOMMU is enabled. This is because each mapping of the skb with a HW IOMMU enabled results in a new set of DMA mappings. This in turn leads to issues when skbs are cloned for uses such as bridging or pktgen because each transmitting device will update the skb shared info structure resulting in some mappings being overwritten, and others being freed multiple times.
I am looking for input specifically on the tg3, be2net, and bnx2 driver patches as I am not very familiar with them and I am not certain if additional changes are required.
I have included the changes for the Intel wired Ethernet drivers as a reference.
---
Alexander Duyck (10):
skbuff: remove skb_dma_map/unmap
tg3: remove use of skb_dma_map/unmap
be2net: remove use of skb_dma_map/unmap
bnx2: remove skb_dma_map/unmap calls from driver
igbvf: remove skb_dma_map/unmap call from drivers
igb: remove use of skb_dma_map from driver
ixgbe: remove skb_dma_map/unmap calls from driver
ixgb: remove use of skb_dma_map from ixgb
e1000: remove use of skb_dma_map from e1000 driver
e1000e: remove use of skb_dma_map from e1000e driver
drivers/net/benet/be_main.c | 37 ++++++--- drivers/net/bnx2.c | 74 ++++++++++++++--- drivers/net/bnx2.h | 1 drivers/net/e1000/e1000.h | 1 drivers/net/e1000/e1000_main.c | 56 +++++++++---- drivers/net/e1000e/e1000.h | 9 +- drivers/net/e1000e/netdev.c | 59 +++++++++----- drivers/net/igb/igb.h | 5 + drivers/net/igb/igb_main.c | 69 ++++++++++++---- drivers/net/igbvf/igbvf.h | 1 drivers/net/igbvf/netdev.c | 65 ++++++++++++--- drivers/net/ixgb/ixgb.h | 1 drivers/net/ixgb/ixgb_main.c | 60 +++++++++----- drivers/net/ixgbe/ixgbe.h | 1 drivers/net/ixgbe/ixgbe_main.c | 63 +++++++++++---- drivers/net/tg3.c | 173 ++++++++++++++++++++++++++++++---------- drivers/net/tg3.h | 6 - include/linux/skbuff.h | 8 -- net/core/Makefile | 1 net/core/skb_dma_map.c | 65 --------------- 20 files changed, 508 insertions(+), 247 deletions(-) delete mode 100644 net/core/skb_dma_map.c
RFC PATCH 1/10 e1000e: remove use of skb_dma_map from e1000e driver
In testing we have found that skb_dma_map/unmap is incompatible with HW IOMMU due to the fact that multiple mappings will return different results. In order to correct this we need to remove skb_dma_map/unmap calls from the e1000e driver.
---
drivers/net/e1000e/e1000.h | 9 ++++--- drivers/net/e1000e/netdev.c | 59 ++++++++++++++++++++++++++++++------------- 2 files changed, 47 insertions(+), 21 deletions(-)
drivers/net/e1000e/e1000.h +6 -3
@@ -192,12 +192,15 @@ struct e1000_buffer {unsigned long time_stamp;u16 length;u16 next_to_watch; +u16 mapped_as_page; };/* Rx */ -/* arrays of page information for packet split */ -struct e1000_ps_page *ps_pages; +struct { +/* arrays of page information for packet split */ +struct e1000_ps_page *ps_pages; +struct page *page; + }; }; -struct page *page; };struct e1000_ring {
drivers/net/e1000e/netdev.c +41 -18
105 lines not on this page · raw message
RFC PATCH 2/10 e1000: remove use of skb_dma_map from e1000 driver
In reply to Alexander DuyckRemove the use of skb_dma_map from the e1000 driver in order to avoid issues when HW iommu are in use.
---
drivers/net/e1000/e1000.h | 1 + drivers/net/e1000/e1000_main.c | 56 +++++++++++++++++++++++++++++----------- 2 files changed, 41 insertions(+), 16 deletions(-)
drivers/net/e1000/e1000.h +1 -0
@@ -167,6 +167,7 @@ struct e1000_buffer {unsigned long time_stamp;u16 length;u16 next_to_watch; +u16 mapped_as_page; };struct e1000_tx_ring {
drivers/net/e1000/e1000_main.c +40 -16
99 lines not on this page · raw message
RFC PATCH 3/10 ixgb: remove use of skb_dma_map from ixgb
In reply to Alexander Duyckskb_dma_map is incompatible with HW iommu due to the fact that multiple mappings can result in different results each time. For this reason it is best to just remove use of these function calls.
---
drivers/net/ixgb/ixgb.h | 1 + drivers/net/ixgb/ixgb_main.c | 60 +++++++++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 19 deletions(-)
drivers/net/ixgb/ixgb.h +1 -0
@@ -117,6 +117,7 @@ struct ixgb_buffer {unsigned long time_stamp;u16 length;u16 next_to_watch; +u16 mapped_as_page; };struct ixgb_desc_ring {
drivers/net/ixgb/ixgb_main.c +41 -19
106 lines not on this page · raw message
RFC PATCH 4/10 ixgbe: remove skb_dma_map/unmap calls from driver
In reply to Alexander DuyckThis patch removes skb_dma_map/unmap calls from the ixgbe driver due to the fact that the calls don't work with HW IOMMU enabled systems. The problem is that multiple mappings will give different results when HW IOMMU is enabled and the skb_dma_map/unmap calls only have one location to store mappings.
---
drivers/net/ixgbe/ixgbe.h | 1 + drivers/net/ixgbe/ixgbe_main.c | 63 +++++++++++++++++++++++++++++++--------- 2 files changed, 50 insertions(+), 14 deletions(-)
drivers/net/ixgbe/ixgbe.h +1 -0
@@ -123,6 +123,7 @@ struct ixgbe_tx_buffer {unsigned long time_stamp;u16 length;u16 next_to_watch; +u16 mapped_as_page; };struct ixgbe_rx_buffer {
drivers/net/ixgbe/ixgbe_main.c +49 -14
109 lines not on this page · raw message
RFC PATCH 5/10 igb: remove use of skb_dma_map from driver
In reply to Alexander DuyckThis change removes skb_dma_map/unmap calls from the igb driver due to the fact that the call is incompatible with iommu enabled kernels. In order to prevent warnings about using the wrong unmap call I have added a mapped_as_page value to the buffer_info structure to track if the mapped region is a page or a buffer.
---
drivers/net/igb/igb.h | 5 ++- drivers/net/igb/igb_main.c | 69 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 56 insertions(+), 18 deletions(-)
drivers/net/igb/igb.h +3 -2
@@ -137,12 +137,13 @@ struct igb_buffer {unsigned long time_stamp;u16 length;u16 next_to_watch; +u16 mapped_as_page; };/* RX */ struct {struct page *page; -u64 page_dma; -unsigned int page_offset; +dma_addr_t page_dma; +u16 page_offset; }; }; };
drivers/net/igb/igb_main.c +53 -16
113 lines not on this page · raw message
RFC PATCH 6/10 igbvf: remove skb_dma_map/unmap call from drivers
In reply to Alexander DuyckThis patch removes the skb_dma_map/unmap calls from the igbvf driver due to the fact that it does not play well with HW IOMMU when combined with transmitting cloned skbs.
---
drivers/net/igbvf/igbvf.h | 1 + drivers/net/igbvf/netdev.c | 65 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 52 insertions(+), 14 deletions(-)
drivers/net/igbvf/igbvf.h +1 -0
@@ -117,6 +117,7 @@ struct igbvf_buffer {unsigned long time_stamp;u16 length;u16 next_to_watch; +u16 mapped_as_page; };/* Rx */ struct {
drivers/net/igbvf/netdev.c +51 -14
102 lines not on this page · raw message
RFC PATCH 7/10 bnx2: remove skb_dma_map/unmap calls from driver
In reply to Alexander DuyckDue to the fact that skb_dma_map/unmap do not work correctly when a HW IOMMU is enabled it has been recommended to go about removing the calls from the network device drivers.
---
drivers/net/bnx2.c | 74 +++++++++++++++++++++++++++++++++++++++++++--------- drivers/net/bnx2.h | 1 + 2 files changed, 62 insertions(+), 13 deletions(-)
drivers/net/bnx2.c +61 -13
@@ -2815,13 +2815,21 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) } } -skb_dma_unmap (&bp->pdev->dev, skb,DMA_TO_DEVICE ); +pci_unmap_single (bp->pdev,pci_unmap_addr (tx_buf, mapping), +skb_headlen (skb),PCI_DMA_TODEVICE ); tx_buf->skb =NULL ; last = tx_buf->nr_frags;for (i =0 ; i < last; i++) { sw_cons =NEXT_TX_BD (sw_cons); + +pci_unmap_page (bp->pdev, +pci_unmap_addr ( + &txr->tx_buf_ring[TX_RING_IDX (sw_cons)], + mapping), +skb_shinfo (skb)->frags[i].size, +PCI_DMA_TODEVICE ); } sw_cons =NEXT_TX_BD (sw_cons);
@@ -5295,18 +5303,30 @@ bnx2_free_tx_skbs(struct bnx2 *bp)for (j =0 ; j <TX_DESC_CNT ; ) {struct sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];struct sk_buff *skb = tx_buf->skb; +int k, last;if (skb ==NULL ) { j++;continue ; } -skb_dma_unmap (&bp->pdev->dev, skb,DMA_TO_DEVICE ); +pci_unmap_single (bp->pdev, +pci_unmap_addr (tx_buf, mapping), +skb_headlen (skb), +PCI_DMA_TODEVICE ); tx_buf->skb =NULL ; - j +=skb_shinfo (skb)->nr_frags +1 ; + last =skb_shinfo (skb)->nr_frags; +for (k =0 ; k < last; k++) { + tx_buf = &txr->tx_buf_ring[j + k +1 ]; +pci_unmap_page (bp->pdev, +pci_unmap_addr (tx_buf, mapping), +skb_shinfo (skb)->frags[j].size, +PCI_DMA_TODEVICE ); + }dev_kfree_skb (skb); + j += k +1 ; } } }
@@ -5684,11 +5704,12 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)for (i =14 ; i < pkt_size; i++) packet[i] = (unsigned char ) (i &0xff ); -if (skb_dma_map (&bp->pdev->dev, skb,DMA_TO_DEVICE )) { + map =pci_map_single (bp->pdev, skb->data, pkt_size, +PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (bp->pdev, map)) {dev_kfree_skb (skb);return -EIO ; } - map =skb_shinfo (skb)->dma_head;REG_WR (bp,BNX2_HC_COMMAND , bp->hc_cmd |BNX2_HC_COMMAND_COAL_NOW_WO_INT );
@@ -5723,7 +5744,7 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)udelay (5 ); -skb_dma_unmap (&bp->pdev->dev, skb,DMA_TO_DEVICE ); +pci_unmap_single (bp->pdev, map, pkt_size,PCI_DMA_TODEVICE );dev_kfree_skb (skb);if (bnx2_get_hw_tx_cons (tx_napi) != txr->tx_prod)
@@ -6302,7 +6323,6 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)struct bnx2_napi *bnapi;struct bnx2_tx_ring_info *txr;struct netdev_queue *txq; -struct skb_shared_info *sp;/* Determine which tx ring we will be placed on */ i =skb_get_queue_mapping (skb);
@@ -6367,16 +6387,15 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) }else mss =0 ; -if (skb_dma_map (&bp->pdev->dev, skb,DMA_TO_DEVICE )) { + mapping =pci_map_single (bp->pdev, skb->data, len,PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (bp->pdev, mapping)) {dev_kfree_skb (skb); -return NETDEV_TX_OK ; +return -EIO ; } - sp =skb_shinfo (skb); - mapping = sp->dma_head; - tx_buf = &txr->tx_buf_ring[ring_prod]; tx_buf->skb = skb; +pci_unmap_addr_set (tx_buf, mapping, mapping); txbd = &txr->tx_desc_ring[ring_prod];
@@ -6397,7 +6416,12 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) txbd = &txr->tx_desc_ring[ring_prod]; len = frag->size; - mapping = sp->dma_maps[i]; + mapping =pci_map_page (bp->pdev, frag->page, frag->page_offset, + len,PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (bp->pdev, mapping)) + goto dma_error; +pci_unmap_addr_set (&txr->tx_buf_ring[ring_prod], mapping, + mapping); txbd->tx_bd_haddr_hi = (u64 ) mapping >>32 ; txbd->tx_bd_haddr_lo = (u64 ) mapping &0xffffffff ;
@@ -6424,6 +6448,30 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) }return NETDEV_TX_OK ; +dma_error: +/* save value of frag that failed */ + last_frag = i; + +/* start back at beginning and unmap skb */ + prod = txr->tx_prod; + ring_prod =TX_RING_IDX (prod); + tx_buf = &txr->tx_buf_ring[ring_prod]; + tx_buf->skb =NULL ; +pci_unmap_single (bp->pdev,pci_unmap_addr (tx_buf, mapping), +skb_headlen (skb),PCI_DMA_TODEVICE ); + +/* unmap remaining mapped pages */ +for (i =0 ; i < last_frag; i++) { + prod =NEXT_TX_BD (prod); + ring_prod =TX_RING_IDX (prod); + tx_buf = &txr->tx_buf_ring[ring_prod]; +pci_unmap_page (bp->pdev,pci_unmap_addr (tx_buf, mapping), +skb_shinfo (skb)->frags[i].size, +PCI_DMA_TODEVICE ); + } + +dev_kfree_skb (skb); +return -EIO ; }/* Called with rtnl_lock */
drivers/net/bnx2.h +1 -0
@@ -6559,6 +6559,7 @@ struct sw_pg {struct sw_tx_bd {struct sk_buff *skb; +DECLARE_PCI_UNMAP_ADDR (mapping) unsigned short is_gso;unsigned short nr_frags; };
Re: [RFC PATCH 07/10] bnx2: remove skb_dma_map/unmap calls from driver
Quoted 6 lines · Alexander Duyck
Due to the fact that skb_dma_map/unmap do not work correctly when a HW IOMMU is enabled it has been recommended to go about removing the calls
from the network device drivers.Signed-off-by Alexander Duyck <[email protected]>
Thanks Alexander. Sorry for the late response, I just got back from vacation. It looks ok except in bnx2_free_tx_skbs():
Quoted 15 lines
drivers/net/bnx2.c +3
-1@@ -5295,18 +5303,30 @@ bnx2_free_tx_skbs(struct bnx2 *bp)for (j =0 ; j <TX_DESC_CNT ; ) {struct sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];struct sk_buff *skb = tx_buf->skb; +int k, last;if (skb ==NULL ) { j++;continue ; } -skb_dma_unmap (&bp->pdev->dev, skb, DMA_TO_DEVICE); + pci_unmap_single(bp->pdev, + pci_unmap_addr(tx_buf,
drivers/net/bnx2.c bnx2_free_tx_skbs(struct bnx2 *bp) · line 5324
Quoted 10 lines
drivers/net/bnx2.c +5
-1mapping), +skb_headlen (skb), + PCI_DMA_TODEVICE); tx_buf->skb =NULL ; - j +=skb_shinfo (skb)->nr_frags +1 ; + last =skb_shinfo (skb)->nr_frags; +for (k =0 ; k < last; k++) { + tx_buf = &txr->tx_buf_ring[j + k +1 ];
j + k + 1 can go beyond the ring when the ring wraps around. I'll send an updated patch tomorrow.
Quoted 10 lines
drivers/net/bnx2.c +6
-0+pci_unmap_page (bp->pdev, +pci_unmap_addr (tx_buf, mapping), +skb_shinfo (skb)->frags[j].size, +PCI_DMA_TODEVICE ); + }dev_kfree_skb (skb); + j += k +1 ; }}}
Re: [RFC PATCH 07/10] bnx2: remove skb_dma_map/unmap calls from driver
Quoted 1 line · Michael Chan
It looks ok except in
bnx2_free_tx_skbs()
Here's the slightly revised patch with some bug fixes. Thanks again to Alexander.
From: Alexander Duyck <[email protected]>
Due to the fact that skb_dma_map/unmap do not work correctly when a HW IOMMU is enabled it has been recommended to go about removing the calls from the network device drivers.
[ Fix bnx2_free_tx_skbs() ring indexing and use NETDEV_TX_OK return
code in bnx2_start_xmit() after cleaning up DMA mapping errors. -Mchan ]
--- drivers/net/bnx2.c | 72 +++++++++++++++++++++++++++++++++++++++++++-------- drivers/net/bnx2.h | 1 + 2 files changed, 61 insertions(+), 12 deletions(-)
drivers/net/bnx2.c +60 -12
@@ -2815,13 +2815,21 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) } } -skb_dma_unmap (&bp->pdev->dev, skb,DMA_TO_DEVICE ); +pci_unmap_single (bp->pdev,pci_unmap_addr (tx_buf, mapping), +skb_headlen (skb),PCI_DMA_TODEVICE ); tx_buf->skb =NULL ; last = tx_buf->nr_frags;for (i =0 ; i < last; i++) { sw_cons =NEXT_TX_BD (sw_cons); + +pci_unmap_page (bp->pdev, +pci_unmap_addr ( + &txr->tx_buf_ring[TX_RING_IDX (sw_cons)], + mapping), +skb_shinfo (skb)->frags[i].size, +PCI_DMA_TODEVICE ); } sw_cons =NEXT_TX_BD (sw_cons);
@@ -5295,17 +5303,29 @@ bnx2_free_tx_skbs(struct bnx2 *bp)for (j =0 ; j <TX_DESC_CNT ; ) {struct sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];struct sk_buff *skb = tx_buf->skb; +int k, last;if (skb ==NULL ) { j++;continue ; } -skb_dma_unmap (&bp->pdev->dev, skb,DMA_TO_DEVICE ); +pci_unmap_single (bp->pdev, +pci_unmap_addr (tx_buf, mapping), +skb_headlen (skb), +PCI_DMA_TODEVICE ); tx_buf->skb =NULL ; - j +=skb_shinfo (skb)->nr_frags +1 ; + last = tx_buf->nr_frags; + j++; +for (k =0 ; k < last; k++, j++) { + tx_buf = &txr->tx_buf_ring[TX_RING_IDX (j)]; +pci_unmap_page (bp->pdev, +pci_unmap_addr (tx_buf, mapping), +skb_shinfo (skb)->frags[k].size, +PCI_DMA_TODEVICE ); + }dev_kfree_skb (skb); } }
@@ -5684,11 +5704,12 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)for (i =14 ; i < pkt_size; i++) packet[i] = (unsigned char ) (i &0xff ); -if (skb_dma_map (&bp->pdev->dev, skb,DMA_TO_DEVICE )) { + map =pci_map_single (bp->pdev, skb->data, pkt_size, +PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (bp->pdev, map)) {dev_kfree_skb (skb);return -EIO ; } - map =skb_shinfo (skb)->dma_head;REG_WR (bp,BNX2_HC_COMMAND , bp->hc_cmd |BNX2_HC_COMMAND_COAL_NOW_WO_INT );
@@ -5723,7 +5744,7 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)udelay (5 ); -skb_dma_unmap (&bp->pdev->dev, skb,DMA_TO_DEVICE ); +pci_unmap_single (bp->pdev, map, pkt_size,PCI_DMA_TODEVICE );dev_kfree_skb (skb);if (bnx2_get_hw_tx_cons (tx_napi) != txr->tx_prod)
@@ -6302,7 +6323,6 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)struct bnx2_napi *bnapi;struct bnx2_tx_ring_info *txr;struct netdev_queue *txq; -struct skb_shared_info *sp;/* Determine which tx ring we will be placed on */ i =skb_get_queue_mapping (skb);
@@ -6367,16 +6387,15 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) }else mss =0 ; -if (skb_dma_map (&bp->pdev->dev, skb,DMA_TO_DEVICE )) { + mapping =pci_map_single (bp->pdev, skb->data, len,PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (bp->pdev, mapping)) {dev_kfree_skb (skb);return NETDEV_TX_OK ; } - sp =skb_shinfo (skb); - mapping = sp->dma_head; - tx_buf = &txr->tx_buf_ring[ring_prod]; tx_buf->skb = skb; +pci_unmap_addr_set (tx_buf, mapping, mapping); txbd = &txr->tx_desc_ring[ring_prod];
@@ -6397,7 +6416,12 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) txbd = &txr->tx_desc_ring[ring_prod]; len = frag->size; - mapping = sp->dma_maps[i]; + mapping =pci_map_page (bp->pdev, frag->page, frag->page_offset, + len,PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (bp->pdev, mapping)) + goto dma_error; +pci_unmap_addr_set (&txr->tx_buf_ring[ring_prod], mapping, + mapping); txbd->tx_bd_haddr_hi = (u64 ) mapping >>32 ; txbd->tx_bd_haddr_lo = (u64 ) mapping &0xffffffff ;
@@ -6424,6 +6448,30 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) }return NETDEV_TX_OK ; +dma_error: +/* save value of frag that failed */ + last_frag = i; + +/* start back at beginning and unmap skb */ + prod = txr->tx_prod; + ring_prod =TX_RING_IDX (prod); + tx_buf = &txr->tx_buf_ring[ring_prod]; + tx_buf->skb =NULL ; +pci_unmap_single (bp->pdev,pci_unmap_addr (tx_buf, mapping), +skb_headlen (skb),PCI_DMA_TODEVICE ); + +/* unmap remaining mapped pages */ +for (i =0 ; i < last_frag; i++) { + prod =NEXT_TX_BD (prod); + ring_prod =TX_RING_IDX (prod); + tx_buf = &txr->tx_buf_ring[ring_prod]; +pci_unmap_page (bp->pdev,pci_unmap_addr (tx_buf, mapping), +skb_shinfo (skb)->frags[i].size, +PCI_DMA_TODEVICE ); + } + +dev_kfree_skb (skb); +return NETDEV_TX_OK ; }/* Called with rtnl_lock */
drivers/net/bnx2.h +1 -0
@@ -6559,6 +6559,7 @@ struct sw_pg {struct sw_tx_bd {struct sk_buff *skb; +DECLARE_PCI_UNMAP_ADDR (mapping) unsigned short is_gso;unsigned short nr_frags; };
Signature · 1 line
1.6.4.GIT
RFC PATCH 8/10 be2net: remove use of skb_dma_map/unmap
In reply to Alexander DuyckDue to the fact that skb_dma_map/unmap do not work correctly when a HW IOMMU is enabled it has been recommended to go about removing the calls from the network device drivers.
---
drivers/net/benet/be_main.c | 37 ++++++++++++++++++++++++++----------- 1 files changed, 26 insertions(+), 11 deletions(-)
drivers/net/benet/be_main.c +26 -11
@@ -390,15 +390,11 @@ static int make_tx_wrbs(struct be_adapter *adapter,atomic_add (wrb_cnt, &txq->used);queue_head_inc (txq); -if (skb_dma_map (&pdev->dev, skb,DMA_TO_DEVICE )) { -dev_err (&pdev->dev,"TX DMA mapping failed\n" ); -return 0 ; - } -if (skb->len > skb->data_len) {int len = skb->len - skb->data_len; + busaddr =pci_map_single (pdev, skb->data, len, +PCI_DMA_TODEVICE ); wrb =queue_head_node (txq); - busaddr =skb_shinfo (skb)->dma_head;wrb_fill (wrb, busaddr, len);be_dws_cpu_to_le (wrb,sizeof (*wrb));queue_head_inc (txq);
@@ -408,8 +404,9 @@ static int make_tx_wrbs(struct be_adapter *adapter,for (i =0 ; i <skb_shinfo (skb)->nr_frags; i++) {struct skb_frag_struct *frag = &skb_shinfo (skb)->frags[i]; - - busaddr =skb_shinfo (skb)->dma_maps[i]; + busaddr =pci_map_page (pdev, frag->page, + frag->page_offset, + frag->size,PCI_DMA_TODEVICE ); wrb =queue_head_node (txq);wrb_fill (wrb, busaddr, frag->size);be_dws_cpu_to_le (wrb,sizeof (*wrb));
@@ -982,23 +979,41 @@ static struct be_eth_tx_compl *be_tx_compl_get(struct be_queue_info *tx_cq)static void be_tx_compl_process (struct be_adapter *adapter,u16 last_index) {struct be_queue_info *txq = &adapter->tx_obj.q; +struct be_eth_wrb *wrb;struct sk_buff **sent_skbs = adapter->tx_obj.sent_skb_list;struct sk_buff *sent_skb; +u64 busaddr;u16 cur_index, num_wrbs =0 ; cur_index = txq->tail; sent_skb = sent_skbs[cur_index];BUG_ON (!sent_skb); sent_skbs[cur_index] =NULL ; + wrb =queue_tail_node (txq); +be_dws_le_to_cpu (wrb,sizeof (*wrb)); + busaddr = ((u64 )wrb->frag_pa_hi <<32 ) | (u64 )wrb->frag_pa_lo; +if (busaddr !=0 ) { +pci_unmap_single (adapter->pdev, busaddr, + wrb->frag_len,PCI_DMA_TODEVICE ); + } + num_wrbs++; +queue_tail_inc (txq); -do { +while (cur_index != last_index) { cur_index = txq->tail; + wrb =queue_tail_node (txq); +be_dws_le_to_cpu (wrb,sizeof (*wrb)); + busaddr = ((u64 )wrb->frag_pa_hi <<32 ) | (u64 )wrb->frag_pa_lo; +if (busaddr !=0 ) { +pci_unmap_page (adapter->pdev, busaddr, + wrb->frag_len,PCI_DMA_TODEVICE ); + } num_wrbs++;queue_tail_inc (txq); - }while (cur_index != last_index); + }atomic_sub (num_wrbs, &txq->used); -skb_dma_unmap (&adapter->pdev->dev, sent_skb,DMA_TO_DEVICE ); +kfree_skb (sent_skb); }
Re: [RFC PATCH 08/10] be2net: remove use of skb_dma_map/unmap
Quoted 10 lines · Alexander Duyck
Due to the fact that skb_dma_map/unmap do not work correctly when a HW IOMMU is enabled it has been recommended to go about removing the calls from the network device drivers.
Signed-off-by Alexander Duyck <[email protected]>---
drivers/net/benet/be_main.c | 37 ++++++++++++++++++++++++++----------- 1 files changed, 26 insertions(+), 11 deletions(-)
Thanks for the changes. They are good to go.
RFC PATCH 9/10 tg3: remove use of skb_dma_map/unmap
In reply to Alexander DuyckDue to the fact that skb_dma_map/unmap do not work correctly when a HW IOMMU is enabled it has been recommended to go about removing the calls from the network device drivers.
---
drivers/net/tg3.c | 173 ++++++++++++++++++++++++++++++++++++++++------------- drivers/net/tg3.h | 6 -- 2 files changed, 132 insertions(+), 47 deletions(-)
drivers/net/tg3.c +131 -42
@@ -4357,7 +4357,7 @@ static void tg3_tx(struct tg3_napi *tnapi) txq =netdev_get_tx_queue (tp->dev, index);while (sw_idx != hw_idx) { -struct tx_ring_info *ri = &tnapi->tx_buffers[sw_idx]; +struct ring_info *ri = &tnapi->tx_buffers[sw_idx];struct sk_buff *skb = ri->skb;int i, tx_bug =0 ;
@@ -4366,7 +4366,10 @@ static void tg3_tx(struct tg3_napi *tnapi)return ; } -skb_dma_unmap (&tp->pdev->dev, skb,DMA_TO_DEVICE ); +pci_unmap_single (tp->pdev, +pci_unmap_addr (ri, mapping), +skb_headlen (skb), +PCI_DMA_TODEVICE ); ri->skb =NULL ;
@@ -4376,6 +4379,11 @@ static void tg3_tx(struct tg3_napi *tnapi) ri = &tnapi->tx_buffers[sw_idx];if (unlikely (ri->skb !=NULL || sw_idx == hw_idx)) tx_bug =1 ; + +pci_unmap_page (tp->pdev, +pci_unmap_addr (ri, mapping), +skb_shinfo (skb)->frags[i].size, +PCI_DMA_TODEVICE ); sw_idx =NEXT_TX (sw_idx); }
@@ -5334,17 +5342,21 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, }else {/* New SKB is guaranteed to be linear. */ entry = *start; - ret =skb_dma_map (&tp->pdev->dev, new_skb,DMA_TO_DEVICE ); - new_addr =skb_shinfo (new_skb)->dma_head; + new_addr =pci_map_single (tp->pdev, new_skb->data, new_skb->len, +PCI_DMA_TODEVICE ); +/* Make sure the mapping succeeded */ +if (pci_dma_mapping_error (tp->pdev, new_addr)) { + ret =-1 ; +dev_kfree_skb (new_skb); + new_skb =NULL ;/* Make sure new skb does not cross any 4G boundaries. * Drop the packet if it does. */ -if (ret || ((tp->tg3_flags3 &TG3_FLG3_4G_DMA_BNDRY_BUG ) && -tg3_4g_overflow_test (new_addr, new_skb->len))) { -if (!ret) -skb_dma_unmap (&tp->pdev->dev, new_skb, -DMA_TO_DEVICE ); + }else if ((tp->tg3_flags3 &TG3_FLG3_4G_DMA_BNDRY_BUG ) && +tg3_4g_overflow_test (new_addr, new_skb->len)) { +pci_unmap_single (tp->pdev, new_addr, new_skb->len, +PCI_DMA_TODEVICE ); ret =-1 ;dev_kfree_skb (new_skb); new_skb =NULL ;
@@ -5358,15 +5370,28 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,/* Now clean up the sw ring entries. */ i =0 ;while (entry != last_plus_one) { +int len; +if (i ==0 ) - tnapi->tx_buffers[entry].skb = new_skb; + len =skb_headlen (skb);else + len =skb_shinfo (skb)->frags[i-1 ].size; + +pci_unmap_single (tp->pdev, +pci_unmap_addr (&tnapi->tx_buffers[entry], + mapping), + len,PCI_DMA_TODEVICE ); +if (i ==0 ) { + tnapi->tx_buffers[entry].skb = new_skb; +pci_unmap_addr_set (&tnapi->tx_buffers[entry], mapping, + new_addr); + }else { tnapi->tx_buffers[entry].skb =NULL ; + } entry =NEXT_TX (entry); i++; } -skb_dma_unmap (&tp->pdev->dev, skb,DMA_TO_DEVICE );dev_kfree_skb (skb);return ret;
@@ -5403,10 +5428,11 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, {struct tg3 *tp =netdev_priv (dev);u32 len, entry, base_flags, mss; -struct skb_shared_info *sp;dma_addr_t mapping;struct tg3_napi *tnapi;struct netdev_queue *txq; +unsigned int i, last; + txq =netdev_get_tx_queue (dev,skb_get_queue_mapping (skb)); tnapi = &tp->napi[skb_get_queue_mapping (skb)];
@@ -5477,18 +5503,17 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, (vlan_tx_tag_get(skb) << 16));#endif -if (skb_dma_map (&tp->pdev->dev, skb,DMA_TO_DEVICE )) { + len =skb_headlen (skb); + +/* Queue skb data, a.k.a. the main skb fragment. */ + mapping =pci_map_single (tp->pdev, skb->data, len,PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (tp->pdev, mapping)) {dev_kfree_skb (skb); goto out_unlock; } - sp =skb_shinfo (skb); - - mapping = sp->dma_head; - tnapi->tx_buffers[entry].skb = skb; - - len =skb_headlen (skb); +pci_unmap_addr_set (&tnapi->tx_buffers[entry], mapping, mapping);if (GET_ASIC_REV (tp->pci_chip_rev_id) ==ASIC_REV_5717 && !mss && skb->len >ETH_DATA_LEN )
@@ -5501,15 +5526,21 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,/* Now loop through additional data fragments, and queue them. */ if (skb_shinfo (skb)->nr_frags >0 ) { -unsigned int i, last; - last =skb_shinfo (skb)->nr_frags -1 ;for (i =0 ; i <= last; i++) {skb_frag_t *frag = &skb_shinfo (skb)->frags[i]; len = frag->size; - mapping = sp->dma_maps[i]; + mapping =pci_map_page (tp->pdev, + frag->page, + frag->page_offset, + len,PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (tp->pdev, mapping)) + goto dma_error; + tnapi->tx_buffers[entry].skb =NULL ; +pci_unmap_addr_set (&tnapi->tx_buffers[entry], mapping, + mapping);tg3_set_txd (tnapi, entry, mapping, len, base_flags, (i == last) | (mss <<1 ));
@@ -5532,6 +5563,27 @@ out_unlock:mmiowb ();return NETDEV_TX_OK ; + +dma_error: + last = i; + entry = tnapi->tx_prod; + tnapi->tx_buffers[entry].skb =NULL ; +pci_unmap_single (tp->pdev, +pci_unmap_addr (&tnapi->tx_buffers[entry], mapping), +skb_headlen (skb), +PCI_DMA_TODEVICE ); +for (i =0 ; i <= last; i++) { +skb_frag_t *frag = &skb_shinfo (skb)->frags[i]; + entry =NEXT_TX (entry); + +pci_unmap_page (tp->pdev, +pci_unmap_addr (&tnapi->tx_buffers[entry], + mapping), + frag->size,PCI_DMA_TODEVICE ); + } + +dev_kfree_skb (skb); +return NETDEV_TX_OK ; } static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *,
@@ -5579,11 +5631,12 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb, {struct tg3 *tp =netdev_priv (dev);u32 len, entry, base_flags, mss; -struct skb_shared_info *sp;int would_hit_hwbug;dma_addr_t mapping;struct tg3_napi *tnapi;struct netdev_queue *txq; +unsigned int i, last; + txq =netdev_get_tx_queue (dev,skb_get_queue_mapping (skb)); tnapi = &tp->napi[skb_get_queue_mapping (skb)];
@@ -5678,21 +5731,19 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb, !mss && skb->len > ETH_DATA_LEN) base_flags |=TXD_FLAG_JMB_PKT ; -if (skb_dma_map (&tp->pdev->dev, skb,DMA_TO_DEVICE )) { + len =skb_headlen (skb); + + mapping =pci_map_single (tp->pdev, skb->data, len,PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (tp->pdev, mapping)) {dev_kfree_skb (skb); goto out_unlock; } - sp =skb_shinfo (skb); - - mapping = sp->dma_head; - tnapi->tx_buffers[entry].skb = skb; +pci_unmap_addr_set (&tnapi->tx_buffers[entry], mapping, mapping); would_hit_hwbug =0 ; - len =skb_headlen (skb); -if ((tp->tg3_flags3 &TG3_FLG3_SHORT_DMA_BUG ) && len <=8 ) would_hit_hwbug =1 ;
@@ -5714,16 +5765,21 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,/* Now loop through additional data fragments, and queue them. */ if (skb_shinfo (skb)->nr_frags >0 ) { -unsigned int i, last; - last =skb_shinfo (skb)->nr_frags -1 ;for (i =0 ; i <= last; i++) {skb_frag_t *frag = &skb_shinfo (skb)->frags[i]; len = frag->size; - mapping = sp->dma_maps[i]; + mapping =pci_map_page (tp->pdev, + frag->page, + frag->page_offset, + len,PCI_DMA_TODEVICE ); tnapi->tx_buffers[entry].skb =NULL ; +pci_unmap_addr_set (&tnapi->tx_buffers[entry], mapping, + mapping); +if (pci_dma_mapping_error (tp->pdev, mapping)) + goto dma_error;if ((tp->tg3_flags3 &TG3_FLG3_SHORT_DMA_BUG ) && len <=8 )
@@ -5779,6 +5835,27 @@ out_unlock:mmiowb ();return NETDEV_TX_OK ; + +dma_error: + last = i; + entry = tnapi->tx_prod; + tnapi->tx_buffers[entry].skb =NULL ; +pci_unmap_single (tp->pdev, +pci_unmap_addr (&tnapi->tx_buffers[entry], mapping), +skb_headlen (skb), +PCI_DMA_TODEVICE ); +for (i =0 ; i <= last; i++) { +skb_frag_t *frag = &skb_shinfo (skb)->frags[i]; + entry =NEXT_TX (entry); + +pci_unmap_page (tp->pdev, +pci_unmap_addr (&tnapi->tx_buffers[entry], + mapping), + frag->size,PCI_DMA_TODEVICE ); + } + +dev_kfree_skb (skb); +return NETDEV_TX_OK ; } static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp,
@@ -6046,8 +6123,9 @@ static void tg3_free_rings(struct tg3 *tp)continue ;for (i =0 ; i <TG3_TX_RING_SIZE ; ) { -struct tx_ring_info *txp; +struct ring_info *txp;struct sk_buff *skb; +unsigned int k; txp = &tnapi->tx_buffers[i]; skb = txp->skb;
@@ -6057,11 +6135,22 @@ static void tg3_free_rings(struct tg3 *tp)continue ; } -skb_dma_unmap (&tp->pdev->dev, skb,DMA_TO_DEVICE ); - +pci_unmap_single (tp->pdev, +pci_unmap_addr (txp, mapping), +skb_headlen (skb), +PCI_DMA_TODEVICE ); txp->skb =NULL ; - i +=skb_shinfo (skb)->nr_frags +1 ; + i++; + +for (k =0 ; k <skb_shinfo (skb)->nr_frags; k++) { + txp = &tnapi->tx_buffers[i & (TG3_TX_RING_SIZE -1 )]; +pci_unmap_page (tp->pdev, +pci_unmap_addr (txp, mapping), +skb_shinfo (skb)->frags[k].size, +PCI_DMA_TODEVICE ); + i++; + }dev_kfree_skb_any (skb); }
@@ -6231,7 +6320,7 @@ static int tg3_alloc_consistent(struct tg3 *tp)memset (tnapi->rx_rcb,0 ,TG3_RX_RCB_RING_BYTES (tp)); - tnapi->tx_buffers =kzalloc (sizeof (struct tx_ring_info ) * + tnapi->tx_buffers =kzalloc (sizeof (struct ring_info ) *TG3_TX_RING_SIZE ,GFP_KERNEL );if (!tnapi->tx_buffers) goto err_out;
@@ -10637,7 +10726,8 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)for (i =14 ; i < tx_len; i++) tx_data[i] = (u8) (i &0xff ); -if (skb_dma_map (&tp->pdev->dev, skb,DMA_TO_DEVICE )) { + map =pci_map_single (tp->pdev, skb->data, tx_len,PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (tp->pdev, map)) {dev_kfree_skb (skb);return -EIO ; }
@@ -10651,8 +10741,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode) num_pkts =0 ; -tg3_set_txd (tnapi, tnapi->tx_prod, -skb_shinfo (skb)->dma_head, tx_len,0 ,1 ); +tg3_set_txd (tnapi, tnapi->tx_prod, map, tx_len,0 ,1 ); tnapi->tx_prod++; num_pkts++;
@@ -10676,7 +10765,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)break ; } -skb_dma_unmap (&tp->pdev->dev, skb,DMA_TO_DEVICE ); +pci_unmap_single (tp->pdev, map, tx_len,PCI_DMA_TODEVICE );dev_kfree_skb (skb);if (tx_idx != tnapi->tx_prod)
drivers/net/tg3.h +1 -5
@@ -2441,10 +2441,6 @@ struct ring_info { DECLARE_PCI_UNMAP_ADDR(mapping) }; -struct tx_ring_info { -struct sk_buff *skb; -}; -struct tg3_config_info {u32 flags; };
@@ -2608,7 +2604,7 @@ struct tg3_napi {struct tg3_rx_buffer_desc *rx_rcb;struct tg3_tx_buffer_desc *tx_ring; -struct tx_ring_info *tx_buffers; +struct ring_info *tx_buffers;dma_addr_t status_mapping;dma_addr_t rx_rcb_mapping;
RFC PATCH 10/10 skbuff: remove skb_dma_map/unmap
In reply to Alexander DuyckThe two functions skb_dma_map/unmap are unsafe to use as they cause problems when packets are cloned and sent to multiple devices while a HW IOMMU is enabled. Due to this it is best to remove the code so it is not used by any other network driver maintainters.
---
include/linux/skbuff.h | 8 ------ net/core/Makefile | 1 - net/core/skb_dma_map.c | 65 ------------------------------------------------ 3 files changed, 0 insertions(+), 74 deletions(-) delete mode 100644 net/core/skb_dma_map.c
include/linux/skbuff.h +0 -8
@@ -416,14 +416,6 @@ struct sk_buff {#include <asm/system.h> -#ifdef CONFIG_HAS_DMA -#include <linux/dma-mapping.h> -extern int skb_dma_map (struct device *dev,struct sk_buff *skb, -enum dma_data_direction dir); -extern void skb_dma_unmap (struct device *dev,struct sk_buff *skb, -enum dma_data_direction dir); -#endif -static inline struct dst_entry *skb_dst (const struct sk_buff *skb) {return (struct dst_entry *)skb->_skb_dst;
net/core/Makefile +0 -1
@@ -6,7 +6,6 @@ obj-y := sock.o request_sock.o skbuff.o iovec.o datagram.o stream.o scm.o \ gen_stats.o gen_estimator.o net_namespace.o obj-$(CONFIG_SYSCTL) += sysctl_net_core.o -obj-$(CONFIG_HAS_DMA) += skb_dma_map.o obj-y += dev.o ethtool.o dev_mcast.o dst.o netevent.o \ neighbour.o rtnetlink.o utils.o link_watch.o filter.o
net/core/skb_dma_map.c deleted +0 -65
65 lines not on this page · raw message
Quoted 8 lines · Alexander Duyck
This patch series removes the
skb_dma_mapandskb_dma_unmapfunction calls. The reason for this change is because the use of skb_dma_map/unmap can lead to serious issues when HW IOMMU is enabled. This is because each mapping of the skb with a HW IOMMU enabled results in a new set of DMA mappings. This in turn leads to issues when skbs are cloned for uses such as bridging or pktgen because each transmitting device will update the skb shared info structure resulting in some mappings being overwritten, and others being freed multiple times.
If this is the case can the members related to the dma mapping stuff (skb_shinfo(skb)->dma_maps) be moved out of this shared info structure and we retain this "good" abstraction provided by this skb_dma_map/unmap api?
Quoted 8 lines
I am looking for input specifically on the tg3, be2net, and bnx2 driver patches as I am not very familiar with them and I am not certain if additional changes are required.
be2net: remove use of skb_dma_map/unmap
drivers/net/benet/be_main.c | 37 ++++++---
We have pulled the be2net specific patch for testing and review. We will send an update once done with it.
-Ajit
Quoted 10 lines · Ajit Khaparde
Quoted 8 lines · Alexander Duyck
This patch series removes the
skb_dma_mapandskb_dma_unmapfunction calls. The reason for this change is because the use of skb_dma_map/unmap can lead to serious issues when HW IOMMU is enabled. This is because each mapping of the skb with a HW IOMMU enabled results in a new set of DMA mappings. This in turn leads to issues when skbs are cloned for uses such as bridging or pktgen because each transmitting device will update the skb shared info structure resulting in some mappings being overwritten, and others being freed multiple times.
Quoted 3 lines
If this is the case can the members related to the dma mapping stuff (skb_shinfo(skb)->dma_maps) be moved out of this shared info structure and we retain this "good" abstraction provided by this skb_dma_map/unmap api?
I had submitted a patch on November 5th that tried to move the maps out of the shared info structure and into the sk_buff itself. That was rejected and it was suggested to go back to what was there before since not enough drivers were using the skb_dma_map/unmap calls to justify increasing the size of an sk_buff.
The biggest issue is that you end up needing to retain a copy of the DMA mapping output each time it is called and so the easiest place to retain the information is within the transmit buffer driver specific data structure.
Quoted 4 lines
Quoted 3 lines
I am looking for input specifically on the tg3, be2net, and bnx2 driver patches as I am not very familiar with them and I am not certain if additional changes are required.
Quoted 8 lines
Quoted 3 lines
be2net: remove use of skb_dma_map/unmap
drivers/net/benet/be_main.c | 37 ++++++---We have pulled the be2net specific patch for testing and review. We will send an update once done with it.
-Ajit
Thanks for taking a look at this.
Alex
David Miller
maintainerFrom: Alexander Duyck <[email protected]>
Date: Tue, 24 Nov 2009 17:20:12 -0800
Quoted 9 lines
This patch series removes the
skb_dma_mapandskb_dma_unmapfunction calls. The reason for this change is because the use of skb_dma_map/unmap can lead to serious issues when HW IOMMU is enabled. This is because each mapping of the skb with a HW IOMMU enabled results in a new set of DMA mappings. This in turn leads to issues when skbs are cloned for uses such as bridging or pktgen because each transmitting device will update the skb shared info structure resulting in some mappings being overwritten, and others being freed multiple times.
Quoted 6 lines
I am looking for input specifically on the tg3, be2net, and bnx2 driver patches as I am not very familiar with them and I am not certain if additional changes are required.
I have included the changes for the Intel wired Ethernet drivers as a reference.
These changes look good, but at least one of them does not apply to current net-2.6
Can you respin this against current sources?
Thanks a lot for doing this work Alexander.
Quoted 21 lines · David Miller
From: Alexander Duyck <[email protected]>
Date: Tue, 24 Nov 2009 17:20:12 -0800Quoted 11 lines
This patch series removes the
skb_dma_mapandskb_dma_unmapfunction calls. The reason for this change is because the use of skb_dma_map/unmap can lead to serious issues when HW IOMMU is enabled. This is because each mapping
of the skb with a HW IOMMU enabled results in a new set of DMA mappings.
This in turn leads to issues when skbs are cloned for uses such as bridging or pktgen because each transmitting device will update the skb shared info structure resulting in some mappings being overwritten, and others being freed multiple times.Quoted 6 lines
I am looking for input specifically on the tg3, be2net, and bnx2 driver patches as I am not very familiar with them and I am not certain if additional changes are required.
I have included the changes for the Intel wired Ethernet drivers as a reference.
Quoted 6 lines
These changes look good, but at least one of them does not apply to current net-2.6
Can you respin this against current sources?
Thanks a lot for doing this work Alexander.
Due to the fact that nobody else had reported the issue and it existed in previous kernel versions I figured it would be easier to just drop it into net-next-2.6.
If you want I can change the patches to net-2.6 though if that is what you would prefer.
Thanks,
Alex
David Miller
maintainerFrom: "Duyck, Alexander H" <[email protected]>
Date: Mon, 30 Nov 2009 17:03:25 -0800
Quoted 6 lines
Quoted 5 lines · David Miller
These changes look good, but at least one of them does not apply to current net-2.6
Can you respin this against current sources?
Quoted 8 lines
Quoted 1 line
Thanks a lot for doing this work Alexander.
Due to the fact that nobody else had reported the issue and it existed in previous kernel versions I figured it would be easier to just drop it into net-next-2.6.
If you want I can change the patches to net-2.6 though if that is what you would prefer.
Ok, net-next-2.6 is fine with me too.
Quoted 10 lines · David Miller
From: "Duyck, Alexander H" <[email protected]>
Date: Mon, 30 Nov 2009 17:03:25 -0800Quoted 7 lines
Quoted 6 lines · David Miller
These changes look good, but at least one of them does not apply to current net-2.6
Can you respin this against current sources?
Thanks a lot for doing this work Alexander.
Quoted 8 lines
Quoted 6 lines
Due to the fact that nobody else had reported the issue and it existed in previous kernel versions I figured it would be easier to just drop it into net-next-2.6.
If you want I can change the patches to net-2.6 though if that is what you would prefer.
Ok, net-next-2.6 is fine with me too.
I am not sure if I already mentioned these patches speedup TX completion path, since we avoid a cache line miss, if driver caches nr_frags/mapping in its tx descriptor (like bnx2)
(no need to access to skb_shinfo(skb)->dma_head & ->nr_frags)
(This is not an argument vs ns-next-2.6, or net-2.6, just a note to say that these patches are welcomed performance wise)