Skip to content

Commit

Permalink
4416 Silence igb(7D) debug messages by default
Browse files Browse the repository at this point in the history
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
  • Loading branch information
Yuri Pankov authored and richlowe committed May 29, 2016
1 parent 3ba9442 commit fa4e188
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 234 deletions.
11 changes: 4 additions & 7 deletions usr/src/uts/common/io/igb/e1000_osdep.h
Expand Up @@ -58,20 +58,17 @@ extern "C" {
#define msec_delay(x) drv_usecwait(x * 1000)
#define msec_delay_irq msec_delay

#ifdef IGB_DEBUG
#define DEBUGOUT(S) IGB_DEBUGLOG_0(NULL, S)
#define DEBUGOUT1(S, A) IGB_DEBUGLOG_1(NULL, S, A)
#define DEBUGOUT2(S, A, B) IGB_DEBUGLOG_2(NULL, S, A, B)
#define DEBUGOUT3(S, A, B, C) IGB_DEBUGLOG_3(NULL, S, A, B, C)

#ifdef IGB_DEBUG
#define DEBUGFUNC(F) IGB_DEBUGFUNC(F)
#else
#define DEBUGOUT(S)
#define DEBUGOUT1(S, A)
#define DEBUGOUT2(S, A, B)
#define DEBUGOUT3(S, A, B, C)
#define DEBUGFUNC(F)
#endif

#define DEBUGFUNC(f)

#define OS_DEP(hw) ((struct igb_osdep *)((hw)->back))

#define false B_FALSE
Expand Down
41 changes: 22 additions & 19 deletions usr/src/uts/common/io/igb/igb_buf.c
Expand Up @@ -231,7 +231,7 @@ igb_alloc_tbd_ring(igb_tx_ring_t *tx_ring)
&tx_ring->tbd_area.dma_handle);

if (ret != DDI_SUCCESS) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not allocate tbd dma handle: %x", ret);
tx_ring->tbd_area.dma_handle = NULL;

Expand All @@ -249,7 +249,7 @@ igb_alloc_tbd_ring(igb_tx_ring_t *tx_ring)
&len, &tx_ring->tbd_area.acc_handle);

if (ret != DDI_SUCCESS) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not allocate tbd dma memory: %x", ret);
tx_ring->tbd_area.acc_handle = NULL;
tx_ring->tbd_area.address = NULL;
Expand All @@ -276,7 +276,7 @@ igb_alloc_tbd_ring(igb_tx_ring_t *tx_ring)
DDI_DMA_DONTWAIT, NULL, &cookie, &cookie_num);

if (ret != DDI_DMA_MAPPED) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not bind tbd dma resource: %x", ret);
tx_ring->tbd_area.dma_address = NULL;
if (tx_ring->tbd_area.acc_handle != NULL) {
Expand Down Expand Up @@ -339,7 +339,8 @@ igb_alloc_rx_ring_data(igb_rx_ring_t *rx_ring)
rx_data = kmem_zalloc(sizeof (igb_rx_data_t), KM_NOSLEEP);

if (rx_data == NULL) {
igb_error(igb, "Allocate software receive rings failed");
igb_log(igb, IGB_LOG_ERROR,
"Allocate software receive rings failed");
return (IGB_FAILURE);
}

Expand All @@ -361,7 +362,7 @@ igb_alloc_rx_ring_data(igb_rx_ring_t *rx_ring)
rx_data->ring_size, KM_NOSLEEP);

if (rx_data->work_list == NULL) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not allocate memory for rx work list");
goto alloc_rx_data_failure;
}
Expand All @@ -373,7 +374,7 @@ igb_alloc_rx_ring_data(igb_rx_ring_t *rx_ring)
rx_data->free_list_size, KM_NOSLEEP);

if (rx_data->free_list == NULL) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Cound not allocate memory for rx free list");
goto alloc_rx_data_failure;
}
Expand All @@ -388,7 +389,7 @@ igb_alloc_rx_ring_data(igb_rx_ring_t *rx_ring)
KM_NOSLEEP);

if (rx_data->rcb_area == NULL) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Cound not allocate memory for rx control blocks");
goto alloc_rx_data_failure;
}
Expand Down Expand Up @@ -460,7 +461,7 @@ igb_alloc_rbd_ring(igb_rx_data_t *rx_data)
&rx_data->rbd_area.dma_handle);

if (ret != DDI_SUCCESS) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not allocate rbd dma handle: %x", ret);
rx_data->rbd_area.dma_handle = NULL;
return (IGB_FAILURE);
Expand All @@ -477,7 +478,7 @@ igb_alloc_rbd_ring(igb_rx_data_t *rx_data)
&len, &rx_data->rbd_area.acc_handle);

if (ret != DDI_SUCCESS) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not allocate rbd dma memory: %x", ret);
rx_data->rbd_area.acc_handle = NULL;
rx_data->rbd_area.address = NULL;
Expand All @@ -503,7 +504,7 @@ igb_alloc_rbd_ring(igb_rx_data_t *rx_data)
DDI_DMA_DONTWAIT, NULL, &cookie, &cookie_num);

if (ret != DDI_DMA_MAPPED) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not bind rbd dma resource: %x", ret);
rx_data->rbd_area.dma_address = NULL;
if (rx_data->rbd_area.acc_handle != NULL) {
Expand Down Expand Up @@ -573,7 +574,7 @@ igb_alloc_dma_buffer(igb_t *igb,

if (ret != DDI_SUCCESS) {
buf->dma_handle = NULL;
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not allocate dma buffer handle: %x", ret);
return (IGB_FAILURE);
}
Expand All @@ -590,7 +591,7 @@ igb_alloc_dma_buffer(igb_t *igb,
ddi_dma_free_handle(&buf->dma_handle);
buf->dma_handle = NULL;
}
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not allocate dma buffer memory: %x", ret);
return (IGB_FAILURE);
}
Expand All @@ -611,7 +612,7 @@ igb_alloc_dma_buffer(igb_t *igb,
ddi_dma_free_handle(&buf->dma_handle);
buf->dma_handle = NULL;
}
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not bind dma buffer handle: %x", ret);
return (IGB_FAILURE);
}
Expand Down Expand Up @@ -674,7 +675,7 @@ igb_alloc_tcb_lists(igb_tx_ring_t *tx_ring)
tx_ring->ring_size, KM_NOSLEEP);

if (tx_ring->work_list == NULL) {
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Cound not allocate memory for tx work list");
return (IGB_FAILURE);
}
Expand All @@ -690,7 +691,7 @@ igb_alloc_tcb_lists(igb_tx_ring_t *tx_ring)
sizeof (tx_control_block_t *) * tx_ring->ring_size);
tx_ring->work_list = NULL;

igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Cound not allocate memory for tx free list");
return (IGB_FAILURE);
}
Expand All @@ -711,7 +712,7 @@ igb_alloc_tcb_lists(igb_tx_ring_t *tx_ring)
sizeof (tx_control_block_t *) * tx_ring->free_list_size);
tx_ring->free_list = NULL;

igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Cound not allocate memory for tx control blocks");
return (IGB_FAILURE);
}
Expand All @@ -736,7 +737,7 @@ igb_alloc_tcb_lists(igb_tx_ring_t *tx_ring)
&tcb->tx_dma_handle);
if (ret != DDI_SUCCESS) {
tcb->tx_dma_handle = NULL;
igb_error(igb,
igb_log(igb, IGB_LOG_ERROR,
"Could not allocate tx dma handle: %x", ret);
goto alloc_tcb_lists_fail;
}
Expand All @@ -754,7 +755,8 @@ igb_alloc_tcb_lists(igb_tx_ring_t *tx_ring)
ASSERT(tcb->tx_dma_handle != NULL);
ddi_dma_free_handle(&tcb->tx_dma_handle);
tcb->tx_dma_handle = NULL;
igb_error(igb, "Allocate tx dma buffer failed");
igb_log(igb, IGB_LOG_ERROR,
"Allocate tx dma buffer failed");
goto alloc_tcb_lists_fail;
}
tcb->last_index = MAX_TX_RING_SIZE;
Expand Down Expand Up @@ -856,7 +858,8 @@ igb_alloc_rcb_lists(igb_rx_data_t *rx_data)
rx_buf, igb->rx_buf_size);

if (ret != IGB_SUCCESS) {
igb_error(igb, "Allocate rx dma buffer failed");
igb_log(igb, IGB_LOG_ERROR,
"Allocate rx dma buffer failed");
goto alloc_rcb_lists_fail;
}

Expand Down

0 comments on commit fa4e188

Please sign in to comment.