Skip to content

Commit 6202806

Browse files
hkallweitdavem330
authored andcommitted
r8169: drop member opts1_mask from struct rtl8169_private
We can get rid of member opts1_mask and in addition save a few cpu cycles in the hot path of rtl_rx(). Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ebcd5da commit 6202806

File tree

1 file changed

+8
-10
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+8
-10
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,6 @@ struct rtl8169_private {
836836
struct rtl8169_counters *counters;
837837
struct rtl8169_tc_offsets tc_offset;
838838
u32 saved_wolopts;
839-
u32 opts1_mask;
840839

841840
struct rtl_fw {
842841
const struct firmware *fw;
@@ -7347,7 +7346,7 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
73477346
struct RxDesc *desc = tp->RxDescArray + entry;
73487347
u32 status;
73497348

7350-
status = le32_to_cpu(desc->opts1) & tp->opts1_mask;
7349+
status = le32_to_cpu(desc->opts1);
73517350
if (status & DescOwn)
73527351
break;
73537352

@@ -7365,14 +7364,16 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
73657364
dev->stats.rx_length_errors++;
73667365
if (status & RxCRC)
73677366
dev->stats.rx_crc_errors++;
7368-
if (status & RxFOVF) {
7367+
/* RxFOVF is a reserved bit on later chip versions */
7368+
if (tp->mac_version == RTL_GIGA_MAC_VER_01 &&
7369+
status & RxFOVF) {
73697370
rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
73707371
dev->stats.rx_fifo_errors++;
7371-
}
7372-
if ((status & (RxRUNT | RxCRC)) &&
7373-
!(status & (RxRWT | RxFOVF)) &&
7374-
(dev->features & NETIF_F_RXALL))
7372+
} else if (status & (RxRUNT | RxCRC) &&
7373+
!(status & RxRWT) &&
7374+
dev->features & NETIF_F_RXALL) {
73757375
goto process_pkt;
7376+
}
73767377
} else {
73777378
struct sk_buff *skb;
73787379
dma_addr_t addr;
@@ -8327,9 +8328,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
83278328
tp->event_slow = cfg->event_slow;
83288329
tp->coalesce_info = cfg->coalesce_info;
83298330

8330-
tp->opts1_mask = (tp->mac_version != RTL_GIGA_MAC_VER_01) ?
8331-
~(RxBOVF | RxFOVF) : ~0;
8332-
83338331
timer_setup(&tp->timer, rtl8169_phy_timer, 0);
83348332

83358333
tp->rtl_fw = RTL_FIRMWARE_UNKNOWN;

0 commit comments

Comments
 (0)