Switch em(4) to the extended RX descriptor format. This matches the

e1000/e1000e split in linux.

MFC after:	2 weeks
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D3447
This commit is contained in:
sbruno 2016-01-07 16:20:55 +00:00
parent fbca74bfe1
commit 7d0f7e9a46

View File

@ -3733,29 +3733,38 @@ em_transmit_checksum_setup(struct tx_ring *txr, struct mbuf *mp, int ip_off,
offload |= CSUM_TCP; offload |= CSUM_TCP;
tucss = hdr_len; tucss = hdr_len;
tucso = hdr_len + offsetof(struct tcphdr, th_sum); tucso = hdr_len + offsetof(struct tcphdr, th_sum);
/* /*
* Setting up new checksum offload context for every frames * The 82574L can only remember the *last* context used
* takes a lot of processing time for hardware. This also * regardless of queue that it was use for. We cannot reuse
* reduces performance a lot for small sized frames so avoid * contexts on this hardware platform and must generate a new
* it if driver can use previously configured checksum * context every time. 82574L hardware spec, section 7.2.6,
* offload context. * second note.
*/ */
if (txr->last_hw_offload == offload) { if (adapter->num_queues < 2) {
if (offload & CSUM_IP) { /*
if (txr->last_hw_ipcss == ipcss && * Setting up new checksum offload context for every
txr->last_hw_ipcso == ipcso && * frames takes a lot of processing time for hardware.
txr->last_hw_tucss == tucss && * This also reduces performance a lot for small sized
txr->last_hw_tucso == tucso) * frames so avoid it if driver can use previously
return; * configured checksum offload context.
} else { */
if (txr->last_hw_tucss == tucss && if (txr->last_hw_offload == offload) {
txr->last_hw_tucso == tucso) if (offload & CSUM_IP) {
return; if (txr->last_hw_ipcss == ipcss &&
} txr->last_hw_ipcso == ipcso &&
} txr->last_hw_tucss == tucss &&
txr->last_hw_offload = offload; txr->last_hw_tucso == tucso)
txr->last_hw_tucss = tucss; return;
txr->last_hw_tucso = tucso; } else {
if (txr->last_hw_tucss == tucss &&
txr->last_hw_tucso == tucso)
return;
}
}
txr->last_hw_offload = offload;
txr->last_hw_tucss = tucss;
txr->last_hw_tucso = tucso;
}
/* /*
* Start offset for payload checksum calculation. * Start offset for payload checksum calculation.
* End offset for payload checksum calculation. * End offset for payload checksum calculation.
@ -3771,29 +3780,38 @@ em_transmit_checksum_setup(struct tx_ring *txr, struct mbuf *mp, int ip_off,
*txd_upper |= E1000_TXD_POPTS_TXSM << 8; *txd_upper |= E1000_TXD_POPTS_TXSM << 8;
tucss = hdr_len; tucss = hdr_len;
tucso = hdr_len + offsetof(struct udphdr, uh_sum); tucso = hdr_len + offsetof(struct udphdr, uh_sum);
/* /*
* Setting up new checksum offload context for every frames * The 82574L can only remember the *last* context used
* takes a lot of processing time for hardware. This also * regardless of queue that it was use for. We cannot reuse
* reduces performance a lot for small sized frames so avoid * contexts on this hardware platform and must generate a new
* it if driver can use previously configured checksum * context every time. 82574L hardware spec, section 7.2.6,
* offload context. * second note.
*/ */
if (txr->last_hw_offload == offload) { if (adapter->num_queues < 2) {
if (offload & CSUM_IP) { /*
if (txr->last_hw_ipcss == ipcss && * Setting up new checksum offload context for every
txr->last_hw_ipcso == ipcso && * frames takes a lot of processing time for hardware.
txr->last_hw_tucss == tucss && * This also reduces performance a lot for small sized
txr->last_hw_tucso == tucso) * frames so avoid it if driver can use previously
return; * configured checksum offload context.
} else { */
if (txr->last_hw_tucss == tucss && if (txr->last_hw_offload == offload) {
txr->last_hw_tucso == tucso) if (offload & CSUM_IP) {
return; if (txr->last_hw_ipcss == ipcss &&
txr->last_hw_ipcso == ipcso &&
txr->last_hw_tucss == tucss &&
txr->last_hw_tucso == tucso)
return;
} else {
if (txr->last_hw_tucss == tucss &&
txr->last_hw_tucso == tucso)
return;
}
} }
} txr->last_hw_offload = offload;
txr->last_hw_offload = offload; txr->last_hw_tucss = tucss;
txr->last_hw_tucss = tucss; txr->last_hw_tucso = tucso;
txr->last_hw_tucso = tucso; }
/* /*
* Start offset for header checksum calculation. * Start offset for header checksum calculation.
* End offset for header checksum calculation. * End offset for header checksum calculation.