Skip to content

Commit

Permalink
r8169: drop member opts1_mask from struct rtl8169_private
Browse files Browse the repository at this point in the history
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 <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
hkallweit authored and davem330 committed Apr 19, 2018
1 parent ebcd5da commit 6202806
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,6 @@ struct rtl8169_private {
struct rtl8169_counters *counters;
struct rtl8169_tc_offsets tc_offset;
u32 saved_wolopts;
u32 opts1_mask;

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

status = le32_to_cpu(desc->opts1) & tp->opts1_mask;
status = le32_to_cpu(desc->opts1);
if (status & DescOwn)
break;

Expand All @@ -7365,14 +7364,16 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
dev->stats.rx_length_errors++;
if (status & RxCRC)
dev->stats.rx_crc_errors++;
if (status & RxFOVF) {
/* RxFOVF is a reserved bit on later chip versions */
if (tp->mac_version == RTL_GIGA_MAC_VER_01 &&
status & RxFOVF) {
rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
dev->stats.rx_fifo_errors++;
}
if ((status & (RxRUNT | RxCRC)) &&
!(status & (RxRWT | RxFOVF)) &&
(dev->features & NETIF_F_RXALL))
} else if (status & (RxRUNT | RxCRC) &&
!(status & RxRWT) &&
dev->features & NETIF_F_RXALL) {
goto process_pkt;
}
} else {
struct sk_buff *skb;
dma_addr_t addr;
Expand Down Expand Up @@ -8327,9 +8328,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
tp->event_slow = cfg->event_slow;
tp->coalesce_info = cfg->coalesce_info;

tp->opts1_mask = (tp->mac_version != RTL_GIGA_MAC_VER_01) ?
~(RxBOVF | RxFOVF) : ~0;

timer_setup(&tp->timer, rtl8169_phy_timer, 0);

tp->rtl_fw = RTL_FIRMWARE_UNKNOWN;
Expand Down

0 comments on commit 6202806

Please sign in to comment.