Skip to content

Commit 62ca1ba

Browse files
françois romieudavem330
authored andcommitted
via-rhine: kiss rx_head_desc goodbye.
The driver no longer produces holes in its receive ring so rx_head_desc only duplicates cur_rx. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8709bb2 commit 62ca1ba

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

drivers/net/ethernet/via/via-rhine.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ struct rhine_private {
472472

473473
/* Frequently used values: keep some adjacent for cache effect. */
474474
u32 quirks;
475-
struct rx_desc *rx_head_desc;
476475
unsigned int cur_rx;
477476
unsigned int cur_tx, dirty_tx;
478477
unsigned int rx_buf_sz; /* Based on MTU+slack. */
@@ -1244,7 +1243,6 @@ static void rhine_reset_rbufs(struct rhine_private *rp)
12441243
int i;
12451244

12461245
rp->cur_rx = 0;
1247-
rp->rx_head_desc = rp->rx_ring;
12481246

12491247
for (i = 0; i < RX_RING_SIZE; i++)
12501248
rp->rx_ring[i].rx_status = cpu_to_le32(DescOwn);
@@ -2000,15 +1998,15 @@ static int rhine_rx(struct net_device *dev, int limit)
20001998
{
20011999
struct rhine_private *rp = netdev_priv(dev);
20022000
struct device *hwdev = dev->dev.parent;
2003-
int count;
20042001
int entry = rp->cur_rx % RX_RING_SIZE;
2002+
int count;
20052003

20062004
netif_dbg(rp, rx_status, dev, "%s(), entry %d status %08x\n", __func__,
2007-
entry, le32_to_cpu(rp->rx_head_desc->rx_status));
2005+
entry, le32_to_cpu(rp->rx_ring[entry].rx_status));
20082006

20092007
/* If EOP is set on the next entry, it's a new packet. Send it up. */
20102008
for (count = 0; count < limit; ++count) {
2011-
struct rx_desc *desc = rp->rx_head_desc;
2009+
struct rx_desc *desc = rp->rx_ring + entry;
20122010
u32 desc_status = le32_to_cpu(desc->rx_status);
20132011
u32 desc_length = le32_to_cpu(desc->desc_length);
20142012
int data_size = desc_status >> 16;
@@ -2026,10 +2024,6 @@ static int rhine_rx(struct net_device *dev, int limit)
20262024
"entry %#x length %d status %08x!\n",
20272025
entry, data_size,
20282026
desc_status);
2029-
netdev_warn(dev,
2030-
"Oversized Ethernet frame %p vs %p\n",
2031-
rp->rx_head_desc,
2032-
&rp->rx_ring[entry]);
20332027
dev->stats.rx_length_errors++;
20342028
} else if (desc_status & RxErr) {
20352029
/* There was a error. */
@@ -2110,7 +2104,6 @@ static int rhine_rx(struct net_device *dev, int limit)
21102104
give_descriptor_to_nic:
21112105
desc->rx_status = cpu_to_le32(DescOwn);
21122106
entry = (++rp->cur_rx) % RX_RING_SIZE;
2113-
rp->rx_head_desc = &rp->rx_ring[entry];
21142107
}
21152108

21162109
return count;

0 commit comments

Comments
 (0)