Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194780
b: refs/heads/master
c: 4e4a4f1
h: refs/heads/master
v: v3
  • Loading branch information
David Daney authored and David S. Miller committed May 6, 2010
1 parent 79fe5a4 commit 56f473c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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: b635e06993076c3c8f8cc766b183be7da3baafdb
refs/heads/master: 4e4a4f1478fdb303c9d99c69cfb4e973526f0c99
16 changes: 11 additions & 5 deletions trunk/drivers/net/octeon/octeon_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ static int octeon_mgmt_xmit(struct sk_buff *skb, struct net_device *netdev)
int port = p->port;
union mgmt_port_ring_entry re;
unsigned long flags;
int rv = NETDEV_TX_BUSY;

re.d64 = 0;
re.s.len = skb->len;
Expand All @@ -964,15 +965,18 @@ static int octeon_mgmt_xmit(struct sk_buff *skb, struct net_device *netdev)

spin_lock_irqsave(&p->tx_list.lock, flags);

if (unlikely(p->tx_current_fill >= ring_max_fill(OCTEON_MGMT_TX_RING_SIZE) - 1)) {
spin_unlock_irqrestore(&p->tx_list.lock, flags);
netif_stop_queue(netdev);
spin_lock_irqsave(&p->tx_list.lock, flags);
}

if (unlikely(p->tx_current_fill >=
ring_max_fill(OCTEON_MGMT_TX_RING_SIZE))) {
spin_unlock_irqrestore(&p->tx_list.lock, flags);

dma_unmap_single(p->dev, re.s.addr, re.s.len,
DMA_TO_DEVICE);

netif_stop_queue(netdev);
return NETDEV_TX_BUSY;
goto out;
}

__skb_queue_tail(&p->tx_list, skb);
Expand All @@ -995,8 +999,10 @@ static int octeon_mgmt_xmit(struct sk_buff *skb, struct net_device *netdev)
cvmx_write_csr(CVMX_MIXX_ORING2(port), 1);

netdev->trans_start = jiffies;
rv = NETDEV_TX_OK;
out:
octeon_mgmt_update_tx_stats(netdev);
return NETDEV_TX_OK;
return rv;
}

#ifdef CONFIG_NET_POLL_CONTROLLER
Expand Down

0 comments on commit 56f473c

Please sign in to comment.