Commit

Igor Kozhukhov(dilos) committed c831fe0

ixgbe tests for #8570

  • Participants
  • Parent commits 9f07930
  • Branches ixgbe

Comments (0)

Files changed (2)

File usr/src/uts/common/io/ixgbe/ixgbe_main.c Modified

View file
  • Ignore whitespace
  • Hide word diff
 {
 	mblk_t *mp;
 
+	if (rx_ring == NULL) {
+		cmn_err(CE_WARN, "%s:rx_ring = NULL!\n", __func__);
+		return;
+	}
+
 	mutex_enter(&rx_ring->rx_lock);
 
 	mp = ixgbe_ring_rx(rx_ring, IXGBE_POLL_NULL);

File usr/src/uts/common/io/ixgbe/ixgbe_rx.c Modified

View file
  • Ignore whitespace
  • Hide word diff
 		return (NULL);
 
 	rx_data = rx_ring->rx_data;
+	if (rx_data == NULL) {
+		cmn_err(CE_WARN, "%s:rx_data = NULL!\n", __func__);
+		return (NULL);
+	}
 	lro_eop = B_FALSE;
 	mblk_head = NULL;
 	mblk_tail = &mblk_head;
 	/*
 	 * Sync the receive descriptors before accepting the packets
 	 */
+	if (&rx_data->rbd_area == NULL) {
+		cmn_err(CE_WARN, "%s:&rx_data->rbd_area = NULL!\n", __func__);
+		return (NULL);
+	}
 	DMA_SYNC(&rx_data->rbd_area, DDI_DMA_SYNC_FORKERNEL);
 
 	if (ixgbe_check_dma_handle(rx_data->rbd_area.dma_handle) != DDI_FM_OK) {
 		 * Reset rx descriptor read bits
 		 */
 		current_rcb = rx_data->work_list[rx_next];
-		if (ixgbe->lro_enable) {
-			if (!current_rcb->lro_pkt) {
+
+		if (current_rcb != NULL) {
+			if (ixgbe->lro_enable) {
+				if (!current_rcb->lro_pkt) {
+					current_rbd->read.pkt_addr =
+					    current_rcb->rx_buf.dma_address;
+					current_rbd->read.hdr_addr = 0;
+				}
+			} else {
 				current_rbd->read.pkt_addr =
 				    current_rcb->rx_buf.dma_address;
 				current_rbd->read.hdr_addr = 0;
 			}
 		} else {
-			current_rbd->read.pkt_addr =
-			    current_rcb->rx_buf.dma_address;
-			current_rbd->read.hdr_addr = 0;
+			cmn_err(CE_WARN, "%s:current_rcb = NULL!\n", __func__);
 		}
 
 		rx_next = NEXT_INDEX(rx_next, 1, rx_data->ring_size);