svn commit: r343771 - stable/11/sys/dev/netmap

Vincenzo Maffione vmaffione at FreeBSD.org
Tue Feb 5 10:33:24 UTC 2019


Author: vmaffione
Date: Tue Feb  5 10:33:22 2019
New Revision: 343771
URL: https://svnweb.freebsd.org/changeset/base/343771

Log:
  netmap: small cleanup on em, lem, igb, ixgbe
  
  Replace D, ND and RD macros with the corresponding nm_pr* ones.

Modified:
  stable/11/sys/dev/netmap/if_em_netmap.h
  stable/11/sys/dev/netmap/if_igb_netmap.h
  stable/11/sys/dev/netmap/if_lem_netmap.h
  stable/11/sys/dev/netmap/ixgbe_netmap.h

Modified: stable/11/sys/dev/netmap/if_em_netmap.h
==============================================================================
--- stable/11/sys/dev/netmap/if_em_netmap.h	Tue Feb  5 10:29:31 2019	(r343770)
+++ stable/11/sys/dev/netmap/if_em_netmap.h	Tue Feb  5 10:33:22 2019	(r343771)
@@ -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) {

Modified: stable/11/sys/dev/netmap/if_igb_netmap.h
==============================================================================
--- stable/11/sys/dev/netmap/if_igb_netmap.h	Tue Feb  5 10:29:31 2019	(r343770)
+++ stable/11/sys/dev/netmap/if_igb_netmap.h	Tue Feb  5 10:33:22 2019	(r343771)
@@ -172,8 +172,8 @@ igb_netmap_txsync(struct netmap_kring *kring, int flag
 	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;

Modified: stable/11/sys/dev/netmap/if_lem_netmap.h
==============================================================================
--- stable/11/sys/dev/netmap/if_lem_netmap.h	Tue Feb  5 10:29:31 2019	(r343770)
+++ stable/11/sys/dev/netmap/if_lem_netmap.h	Tue Feb  5 10:33:22 2019	(r343771)
@@ -172,8 +172,8 @@ lem_netmap_txsync(struct netmap_kring *kring, int flag
 		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;
@@ -226,7 +226,7 @@ lem_netmap_rxsync(struct netmap_kring *kring, int flag
 				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;
@@ -238,7 +238,7 @@ lem_netmap_rxsync(struct netmap_kring *kring, int flag
 			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),

Modified: stable/11/sys/dev/netmap/ixgbe_netmap.h
==============================================================================
--- stable/11/sys/dev/netmap/ixgbe_netmap.h	Tue Feb  5 10:29:31 2019	(r343770)
+++ stable/11/sys/dev/netmap/ixgbe_netmap.h	Tue Feb  5 10:33:22 2019	(r343771)
@@ -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;
@@ -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);
@@ -326,8 +326,8 @@ ixgbe_netmap_txsync(struct netmap_kring *kring, int fl
 		 */
 		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) {


More information about the svn-src-all mailing list