Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184263
b: refs/heads/master
c: 3025a44
h: refs/heads/master
i:
  184261: 48a129a
  184259: cb1bf61
  184255: 7c44901
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Feb 17, 2010
1 parent 8eff80f commit 4b087fb
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 82 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: b94f2d775a71ed09dc8ca2bf24c611bdce9e82e7
refs/heads/master: 3025a446b6d0255ae4399ca5f9b259bd1b51539e
5 changes: 2 additions & 3 deletions trunk/drivers/net/igb/igb.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ static inline int igb_desc_unused(struct igb_ring *ring)
}

/* board specific private data structure */

struct igb_adapter {
struct timer_list watchdog_timer;
struct timer_list phy_info_timer;
Expand All @@ -266,12 +265,12 @@ struct igb_adapter {
unsigned long led_status;

/* TX */
struct igb_ring *tx_ring; /* One per active queue */
struct igb_ring *tx_ring[16];
unsigned long tx_queue_len;
u32 tx_timeout_count;

/* RX */
struct igb_ring *rx_ring; /* One per active queue */
struct igb_ring *rx_ring[16];
int num_tx_queues;
int num_rx_queues;

Expand Down
46 changes: 24 additions & 22 deletions trunk/drivers/net/igb/igb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static int igb_set_pauseparam(struct net_device *netdev,
static u32 igb_get_rx_csum(struct net_device *netdev)
{
struct igb_adapter *adapter = netdev_priv(netdev);
return !!(adapter->rx_ring[0].flags & IGB_RING_FLAG_RX_CSUM);
return !!(adapter->rx_ring[0]->flags & IGB_RING_FLAG_RX_CSUM);
}

static int igb_set_rx_csum(struct net_device *netdev, u32 data)
Expand All @@ -324,9 +324,9 @@ static int igb_set_rx_csum(struct net_device *netdev, u32 data)

for (i = 0; i < adapter->num_rx_queues; i++) {
if (data)
adapter->rx_ring[i].flags |= IGB_RING_FLAG_RX_CSUM;
adapter->rx_ring[i]->flags |= IGB_RING_FLAG_RX_CSUM;
else
adapter->rx_ring[i].flags &= ~IGB_RING_FLAG_RX_CSUM;
adapter->rx_ring[i]->flags &= ~IGB_RING_FLAG_RX_CSUM;
}

return 0;
Expand Down Expand Up @@ -789,9 +789,9 @@ static int igb_set_ringparam(struct net_device *netdev,

if (!netif_running(adapter->netdev)) {
for (i = 0; i < adapter->num_tx_queues; i++)
adapter->tx_ring[i].count = new_tx_count;
adapter->tx_ring[i]->count = new_tx_count;
for (i = 0; i < adapter->num_rx_queues; i++)
adapter->rx_ring[i].count = new_rx_count;
adapter->rx_ring[i]->count = new_rx_count;
adapter->tx_ring_count = new_tx_count;
adapter->rx_ring_count = new_rx_count;
goto clear_reset;
Expand All @@ -815,10 +815,10 @@ static int igb_set_ringparam(struct net_device *netdev,
* to the tx and rx ring structs.
*/
if (new_tx_count != adapter->tx_ring_count) {
memcpy(temp_ring, adapter->tx_ring,
adapter->num_tx_queues * sizeof(struct igb_ring));

for (i = 0; i < adapter->num_tx_queues; i++) {
memcpy(&temp_ring[i], adapter->tx_ring[i],
sizeof(struct igb_ring));

temp_ring[i].count = new_tx_count;
err = igb_setup_tx_resources(&temp_ring[i]);
if (err) {
Expand All @@ -830,20 +830,21 @@ static int igb_set_ringparam(struct net_device *netdev,
}
}

for (i = 0; i < adapter->num_tx_queues; i++)
igb_free_tx_resources(&adapter->tx_ring[i]);
for (i = 0; i < adapter->num_tx_queues; i++) {
igb_free_tx_resources(adapter->tx_ring[i]);

memcpy(adapter->tx_ring, temp_ring,
adapter->num_tx_queues * sizeof(struct igb_ring));
memcpy(adapter->tx_ring[i], &temp_ring[i],
sizeof(struct igb_ring));
}

adapter->tx_ring_count = new_tx_count;
}

if (new_rx_count != adapter->rx_ring->count) {
memcpy(temp_ring, adapter->rx_ring,
adapter->num_rx_queues * sizeof(struct igb_ring));

if (new_rx_count != adapter->rx_ring_count) {
for (i = 0; i < adapter->num_rx_queues; i++) {
memcpy(&temp_ring[i], adapter->rx_ring[i],
sizeof(struct igb_ring));

temp_ring[i].count = new_rx_count;
err = igb_setup_rx_resources(&temp_ring[i]);
if (err) {
Expand All @@ -856,11 +857,12 @@ static int igb_set_ringparam(struct net_device *netdev,

}

for (i = 0; i < adapter->num_rx_queues; i++)
igb_free_rx_resources(&adapter->rx_ring[i]);
for (i = 0; i < adapter->num_rx_queues; i++) {
igb_free_rx_resources(adapter->rx_ring[i]);

memcpy(adapter->rx_ring, temp_ring,
adapter->num_rx_queues * sizeof(struct igb_ring));
memcpy(adapter->rx_ring[i], &temp_ring[i],
sizeof(struct igb_ring));
}

adapter->rx_ring_count = new_rx_count;
}
Expand Down Expand Up @@ -2036,12 +2038,12 @@ static void igb_get_ethtool_stats(struct net_device *netdev,
sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
}
for (j = 0; j < adapter->num_tx_queues; j++) {
queue_stat = (u64 *)&adapter->tx_ring[j].tx_stats;
queue_stat = (u64 *)&adapter->tx_ring[j]->tx_stats;
for (k = 0; k < IGB_TX_QUEUE_STATS_LEN; k++, i++)
data[i] = queue_stat[k];
}
for (j = 0; j < adapter->num_rx_queues; j++) {
queue_stat = (u64 *)&adapter->rx_ring[j].rx_stats;
queue_stat = (u64 *)&adapter->rx_ring[j]->rx_stats;
for (k = 0; k < IGB_RX_QUEUE_STATS_LEN; k++, i++)
data[i] = queue_stat[k];
}
Expand Down
Loading

0 comments on commit 4b087fb

Please sign in to comment.