aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMarcin Wojtas <mw@FreeBSD.org>2018-05-10 09:37:54 +0000
committerMarcin Wojtas <mw@FreeBSD.org>2018-05-10 09:37:54 +0000
commit2339f28c6e791527deed6cd2a860fb5987637237 (patch)
tree72973df44de1fec725e9afa3d4324112e526e4dd /sys/dev
parent43fd679efbdbf300dee851fb77eb4240ce51e014 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ena/ena.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c
index 174549120d929..53d81d1004985 100644
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -2742,7 +2742,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf)
uint16_t req_id;
uint16_t push_len;
uint16_t ena_qid;
- uint32_t len, nsegs, header_len;
+ uint32_t nsegs, header_len;
int i, rc;
int nb_hw_desc;
@@ -2766,12 +2766,18 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf)
tx_info->num_of_bufs = 0;
ena_buf = tx_info->bufs;
- len = (*mbuf)->m_len;
ena_trace(ENA_DBG | ENA_TXPTH, "Tx: %d bytes", (*mbuf)->m_pkthdr.len);
push_len = 0;
- header_len = min_t(uint32_t, len, tx_ring->tx_max_header_size);
+ /*
+ * header_len is just a hint for the device. Because FreeBSD is not
+ * giving us information about packet header length and it is not
+ * guaranteed that all packet headers will be in the 1st mbuf, setting
+ * header_len to 0 is making the device ignore this value and resolve
+ * header on it's own.
+ */
+ header_len = 0;
push_hdr = NULL;
rc = bus_dmamap_load_mbuf_sg(adapter->tx_buf_tag, tx_info->map,