Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214305
b: refs/heads/master
c: c08cc3c
h: refs/heads/master
i:
  214303: 77b472a
v: v3
  • Loading branch information
Santiago Leon authored and David S. Miller committed Sep 7, 2010
1 parent 8e7e78b commit 4c3f4a9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e8cb7eb473ac47703282db6f90b4926f31cdf376
refs/heads/master: c08cc3ccebd46dce44d13a8ce81d249e687eeb8a
28 changes: 20 additions & 8 deletions trunk/drivers/net/ibmveth.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ MODULE_DESCRIPTION("IBM i/pSeries Virtual Ethernet Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(ibmveth_driver_version);

static unsigned int tx_copybreak __read_mostly = 128;
module_param(tx_copybreak, uint, 0644);
MODULE_PARM_DESC(tx_copybreak,
"Maximum size of packet that is copied to a new buffer on transmit");

struct ibmveth_stat {
char name[ETH_GSTRING_LEN];
int offset;
Expand Down Expand Up @@ -931,17 +936,24 @@ static netdev_tx_t ibmveth_start_xmit(struct sk_buff *skb,
buf[1] = 0;
}

data_dma_addr = dma_map_single(&adapter->vdev->dev, skb->data,
skb->len, DMA_TO_DEVICE);
if (dma_mapping_error(&adapter->vdev->dev, data_dma_addr)) {
if (!firmware_has_feature(FW_FEATURE_CMO))
ibmveth_error_printk("tx: unable to map xmit buffer\n");
if (skb->len < tx_copybreak) {
used_bounce = 1;
} else {
data_dma_addr = dma_map_single(&adapter->vdev->dev, skb->data,
skb->len, DMA_TO_DEVICE);
if (dma_mapping_error(&adapter->vdev->dev, data_dma_addr)) {
if (!firmware_has_feature(FW_FEATURE_CMO))
ibmveth_error_printk("tx: unable to map "
"xmit buffer\n");
tx_map_failed++;
used_bounce = 1;
}
}

if (used_bounce) {
skb_copy_from_linear_data(skb, adapter->bounce_buffer,
skb->len);
desc.fields.address = adapter->bounce_buffer_dma;
tx_map_failed++;
used_bounce = 1;
wmb();
} else
desc.fields.address = data_dma_addr;

Expand Down

0 comments on commit 4c3f4a9

Please sign in to comment.