net/sfc: make TSO descriptor numbers EF10-specific

Numbers of extra descriptors required for TSO are EF10-specific
in fact. Highlight it in define names.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
This commit is contained in:
Igor Romanov 2019-04-02 10:28:35 +01:00 committed by Ferruh Yigit
parent 3985802ecf
commit 11c3712fc9
3 changed files with 9 additions and 9 deletions

View File

@ -351,8 +351,8 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
* several descriptors.
*/
needed_desc = m_seg->nb_segs +
(unsigned int)SFC_TSO_OPT_DESCS_NUM +
(unsigned int)SFC_TSO_HDR_DESCS_NUM;
(unsigned int)SFC_EF10_TSO_OPT_DESCS_NUM +
(unsigned int)SFC_EF10_TSO_HDR_DESCS_NUM;
if (needed_desc > *dma_desc_space &&
!sfc_ef10_try_reap(txq, pkt_start, needed_desc,
@ -369,8 +369,8 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
* descriptors, header descriptor and at least 1
* segment descriptor.
*/
if (*dma_desc_space < SFC_TSO_OPT_DESCS_NUM +
SFC_TSO_HDR_DESCS_NUM + 1)
if (*dma_desc_space < SFC_EF10_TSO_OPT_DESCS_NUM +
SFC_EF10_TSO_HDR_DESCS_NUM + 1)
return EMSGSIZE;
}
@ -386,7 +386,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
* Associate header mbuf with header descriptor
* which is located after TSO descriptors.
*/
txq->sw_ring[(pkt_start + SFC_TSO_OPT_DESCS_NUM) &
txq->sw_ring[(pkt_start + SFC_EF10_TSO_OPT_DESCS_NUM) &
txq->ptr_mask].mbuf = m_seg;
m_seg = m_seg->next;
in_off = 0;
@ -455,7 +455,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
sfc_ef10_tx_qdesc_tso2_create(txq, *added, packet_id, 0, sent_seq,
first_m_seg->tso_segsz);
(*added) += SFC_TSO_OPT_DESCS_NUM;
(*added) += SFC_EF10_TSO_OPT_DESCS_NUM;
sfc_ef10_tx_qdesc_dma_create(hdr_iova, header_len, false,
&txq->txq_hw_ring[(*added) & txq->ptr_mask]);

View File

@ -105,7 +105,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
size_t header_len = m->l2_len + m->l3_len + m->l4_len;
const efx_nic_cfg_t *encp = efx_nic_cfg_get(txq->evq->sa->nic);
idx += SFC_TSO_OPT_DESCS_NUM;
idx += SFC_EF10_TSO_OPT_DESCS_NUM;
/*
* The TCP header must start at most 208 bytes into the frame.

View File

@ -18,13 +18,13 @@ extern "C" {
#define SFC_TSOH_STD_LEN 256
/** The number of TSO option descriptors that precede the packet descriptors */
#define SFC_TSO_OPT_DESCS_NUM 2
#define SFC_EF10_TSO_OPT_DESCS_NUM 2
/**
* The number of DMA descriptors for TSO header that may or may not precede the
* packet's payload descriptors
*/
#define SFC_TSO_HDR_DESCS_NUM 1
#define SFC_EF10_TSO_HDR_DESCS_NUM 1
unsigned int sfc_tso_prepare_header(uint8_t *tsoh, size_t header_len,
struct rte_mbuf **in_seg, size_t *in_off);