Skip to content

Commit

Permalink
netmap: small cleanup on em, lem, igb, ixgbe
Browse files Browse the repository at this point in the history
Replace D, ND and RD macros with the corresponding nm_pr* ones.
  • Loading branch information
vmaffione authored and vmaffione committed Feb 5, 2019
1 parent f4f3042 commit 5cfedb9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions sys/dev/netmap/if_em_netmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ em_netmap_txsync(struct netmap_kring *kring, int flags)
if (flags & NAF_FORCE_RECLAIM || nm_kr_txempty(kring)) {
/* record completed transmissions using TDH */
nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(kring->ring_id));
if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */
D("TDH wrap %d", nic_i);
if (unlikely(nic_i >= kring->nkr_num_slots)) {
nm_prerr("TDH wrap at idx %d", nic_i);
nic_i -= kring->nkr_num_slots;
}
if (nic_i != txr->next_to_clean) {
Expand Down
4 changes: 2 additions & 2 deletions sys/dev/netmap/if_igb_netmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ igb_netmap_txsync(struct netmap_kring *kring, int flags)
if (flags & NAF_FORCE_RECLAIM || nm_kr_txempty(kring)) {
/* record completed transmissions using TDH */
nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(kring->ring_id));
if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */
D("TDH wrap %d", nic_i);
if (unlikely(nic_i >= kring->nkr_num_slots)) {
nm_prerr("TDH wrap at idx %d", nic_i);
nic_i -= kring->nkr_num_slots;
}
txr->next_to_clean = nic_i;
Expand Down
8 changes: 4 additions & 4 deletions sys/dev/netmap/if_lem_netmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ lem_netmap_txsync(struct netmap_kring *kring, int flags)
kring->last_reclaim = ticks;
/* record completed transmissions using TDH */
nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(0));
if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */
D("TDH wrap %d", nic_i);
if (unlikely(nic_i >= kring->nkr_num_slots)) {
nm_prerr("TDH wrap at idx %d", nic_i);
nic_i -= kring->nkr_num_slots;
}
adapter->next_tx_to_clean = nic_i;
Expand Down Expand Up @@ -226,7 +226,7 @@ lem_netmap_rxsync(struct netmap_kring *kring, int flags)
break;
len = le16toh(curr->length) - 4; // CRC
if (len < 0) {
RD(5, "bogus pkt (%d) size %d nic idx %d", n, len, nic_i);
nm_prlim(2, "bogus pkt (%d) size %d nic idx %d", n, len, nic_i);
len = 0;
}
ring->slot[nm_i].len = len;
Expand All @@ -238,7 +238,7 @@ lem_netmap_rxsync(struct netmap_kring *kring, int flags)
nic_i = nm_next(nic_i, lim);
}
if (n) { /* update the state variables */
ND("%d new packets at nic %d nm %d tail %d",
nm_prdis("%d new packets at nic %d nm %d tail %d",
n,
adapter->next_rx_desc_to_check,
netmap_idx_n2k(kring, adapter->next_rx_desc_to_check),
Expand Down
8 changes: 4 additions & 4 deletions sys/dev/netmap/ixgbe_netmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ set_crcstrip(struct ixgbe_hw *hw, int onoff)
hl = IXGBE_READ_REG(hw, IXGBE_HLREG0);
rxc = IXGBE_READ_REG(hw, IXGBE_RDRXCTL);
if (netmap_verbose)
D("%s read HLREG 0x%x rxc 0x%x",
nm_prinf("%s read HLREG 0x%x rxc 0x%x",
onoff ? "enter" : "exit", hl, rxc);
/* hw requirements ... */
rxc &= ~IXGBE_RDRXCTL_RSCFRSTSIZE;
Expand All @@ -103,7 +103,7 @@ set_crcstrip(struct ixgbe_hw *hw, int onoff)
rxc |= IXGBE_RDRXCTL_CRCSTRIP;
}
if (netmap_verbose)
D("%s write HLREG 0x%x rxc 0x%x",
nm_prinf("%s write HLREG 0x%x rxc 0x%x",
onoff ? "enter" : "exit", hl, rxc);
IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hl);
IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rxc);
Expand Down Expand Up @@ -326,8 +326,8 @@ ixgbe_netmap_txsync(struct netmap_kring *kring, int flags)
*/
nic_i = IXGBE_READ_REG(&adapter->hw, IXGBE_IS_VF(adapter) ?
IXGBE_VFTDH(kring->ring_id) : IXGBE_TDH(kring->ring_id));
if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */
D("TDH wrap %d", nic_i);
if (unlikely(nic_i >= kring->nkr_num_slots)) {
nm_prerr("TDH wrap at idx %d", nic_i);
nic_i -= kring->nkr_num_slots;
}
if (nic_i != txr->next_to_clean) {
Expand Down

0 comments on commit 5cfedb9

Please sign in to comment.