Don't update Rx descriptor status in two different functions.
Suggested by: pdeuskar Reviewed by: pdeuskar
This commit is contained in:
parent
3401780fa0
commit
0c3e46f4eb
@ -2865,8 +2865,6 @@ em_get_buf(struct adapter *adapter, int i)
|
|||||||
rx_buffer->m_head = m;
|
rx_buffer->m_head = m;
|
||||||
|
|
||||||
adapter->rx_desc_base[i].buffer_addr = htole64(segs[0].ds_addr);
|
adapter->rx_desc_base[i].buffer_addr = htole64(segs[0].ds_addr);
|
||||||
/* Zero out the receive descriptors status. */
|
|
||||||
adapter->rx_desc_base[i].status = 0;
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -3123,6 +3121,7 @@ em_rxeof(struct adapter *adapter, int count)
|
|||||||
|
|
||||||
/* Pointer to the receive descriptor being examined. */
|
/* Pointer to the receive descriptor being examined. */
|
||||||
struct em_rx_desc *current_desc;
|
struct em_rx_desc *current_desc;
|
||||||
|
uint8_t status;
|
||||||
|
|
||||||
ifp = adapter->ifp;
|
ifp = adapter->ifp;
|
||||||
i = adapter->next_rx_desc_to_check;
|
i = adapter->next_rx_desc_to_check;
|
||||||
@ -3149,7 +3148,8 @@ em_rxeof(struct adapter *adapter, int count)
|
|||||||
accept_frame = 1;
|
accept_frame = 1;
|
||||||
prev_len_adj = 0;
|
prev_len_adj = 0;
|
||||||
desc_len = le16toh(current_desc->length);
|
desc_len = le16toh(current_desc->length);
|
||||||
if (current_desc->status & E1000_RXD_STAT_EOP) {
|
status = current_desc->status;
|
||||||
|
if (status & E1000_RXD_STAT_EOP) {
|
||||||
count--;
|
count--;
|
||||||
eop = 1;
|
eop = 1;
|
||||||
if (desc_len < ETHER_CRC_LEN) {
|
if (desc_len < ETHER_CRC_LEN) {
|
||||||
@ -3170,9 +3170,8 @@ em_rxeof(struct adapter *adapter, int count)
|
|||||||
pkt_len += adapter->fmp->m_pkthdr.len;
|
pkt_len += adapter->fmp->m_pkthdr.len;
|
||||||
|
|
||||||
last_byte = *(mtod(mp, caddr_t) + desc_len - 1);
|
last_byte = *(mtod(mp, caddr_t) + desc_len - 1);
|
||||||
if (TBI_ACCEPT(&adapter->hw, current_desc->status,
|
if (TBI_ACCEPT(&adapter->hw, status,
|
||||||
current_desc->errors,
|
current_desc->errors, pkt_len, last_byte)) {
|
||||||
pkt_len, last_byte)) {
|
|
||||||
em_tbi_adjust_stats(&adapter->hw,
|
em_tbi_adjust_stats(&adapter->hw,
|
||||||
&adapter->stats, pkt_len,
|
&adapter->stats, pkt_len,
|
||||||
adapter->hw.mac_addr);
|
adapter->hw.mac_addr);
|
||||||
@ -3224,7 +3223,7 @@ em_rxeof(struct adapter *adapter, int count)
|
|||||||
em_fixup_rx(adapter) != 0)
|
em_fixup_rx(adapter) != 0)
|
||||||
goto skip;
|
goto skip;
|
||||||
#endif
|
#endif
|
||||||
if (current_desc->status & E1000_RXD_STAT_VP)
|
if (status & E1000_RXD_STAT_VP)
|
||||||
VLAN_INPUT_TAG(ifp, adapter->fmp,
|
VLAN_INPUT_TAG(ifp, adapter->fmp,
|
||||||
(le16toh(current_desc->special) &
|
(le16toh(current_desc->special) &
|
||||||
E1000_RXD_SPC_VLAN_MASK));
|
E1000_RXD_SPC_VLAN_MASK));
|
||||||
@ -3250,11 +3249,11 @@ em_rxeof(struct adapter *adapter, int count)
|
|||||||
adapter->fmp = NULL;
|
adapter->fmp = NULL;
|
||||||
adapter->lmp = NULL;
|
adapter->lmp = NULL;
|
||||||
}
|
}
|
||||||
/* Zero out the receive descriptors status. */
|
|
||||||
adapter->rx_desc_base[i].status = 0;
|
|
||||||
m = NULL;
|
m = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Zero out the receive descriptors status. */
|
||||||
|
current_desc->status = 0;
|
||||||
bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map,
|
bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map,
|
||||||
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
|
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user