From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 0EE383576 for ; Tue, 2 Apr 2019 11:28:59 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id B9151100080; Tue, 2 Apr 2019 09:28:57 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 2 Apr 2019 02:28:55 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 2 Apr 2019 02:28:54 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x329SrTY028256; Tue, 2 Apr 2019 10:28:53 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id AE015161610; Tue, 2 Apr 2019 10:28:53 +0100 (BST) From: Andrew Rybchenko To: CC: Igor Romanov Date: Tue, 2 Apr 2019 10:28:35 +0100 Message-ID: <1554197324-32391-4-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1554197324-32391-1-git-send-email-arybchenko@solarflare.com> References: <1554197324-32391-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24526.005 X-TM-AS-Result: No-11.767800-4.000000-10 X-TMASE-MatchedRID: Av/pE9tNfKH6GJFh4XuzNSD7sj+hACo7gsuHb8lxzt4s/uUAk6xP7Czy bVqWyY2NV+ZTRdcl1sI5lZtQHwAjAABppRnCr9QqTVa+L3Zgqc46QNs2WCY79XnlZuxPfR1QJ7o vlkPXpS1Go/FWqxCmgVHo+oPX+wPGYOQAOJ+OS22imtMQe97AANTNlMj1yiV5QQ1XgvCe7sEoLw N13C5buuLzNWBegCW2wgn7iDBesS0gBwKKRHe+r/ns4Elr0Tkn1BSvVPeGzW99Iu+7Q6x1jCvgS hoZHdLMtZz3gO3LWCI= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.767800-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24526.005 X-MDID: 1554197338-HgxpbW-aVlAb Subject: [dpdk-dev] [PATCH 03/12] net/sfc: make TSO descriptor numbers EF10-specific X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2019 09:28:59 -0000 From: Igor Romanov Numbers of extra descriptors required for TSO are EF10-specific in fact. Highlight it in define names. Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc_ef10_tx.c | 12 ++++++------ drivers/net/sfc/sfc_tso.c | 2 +- drivers/net/sfc/sfc_tso.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c index 97b1b6252..999dabd12 100644 --- a/drivers/net/sfc/sfc_ef10_tx.c +++ b/drivers/net/sfc/sfc_ef10_tx.c @@ -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]); diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c index a28af0e78..1ce787f3c 100644 --- a/drivers/net/sfc/sfc_tso.c +++ b/drivers/net/sfc/sfc_tso.c @@ -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. diff --git a/drivers/net/sfc/sfc_tso.h b/drivers/net/sfc/sfc_tso.h index f89aef07c..cd151782f 100644 --- a/drivers/net/sfc/sfc_tso.h +++ b/drivers/net/sfc/sfc_tso.h @@ -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); -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EF976A0679 for ; Tue, 2 Apr 2019 11:29:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B14304C95; Tue, 2 Apr 2019 11:29:07 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 0EE383576 for ; Tue, 2 Apr 2019 11:28:59 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id B9151100080; Tue, 2 Apr 2019 09:28:57 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 2 Apr 2019 02:28:55 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 2 Apr 2019 02:28:54 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x329SrTY028256; Tue, 2 Apr 2019 10:28:53 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id AE015161610; Tue, 2 Apr 2019 10:28:53 +0100 (BST) From: Andrew Rybchenko To: CC: Igor Romanov Date: Tue, 2 Apr 2019 10:28:35 +0100 Message-ID: <1554197324-32391-4-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1554197324-32391-1-git-send-email-arybchenko@solarflare.com> References: <1554197324-32391-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24526.005 X-TM-AS-Result: No-11.767800-4.000000-10 X-TMASE-MatchedRID: Av/pE9tNfKH6GJFh4XuzNSD7sj+hACo7gsuHb8lxzt4s/uUAk6xP7Czy bVqWyY2NV+ZTRdcl1sI5lZtQHwAjAABppRnCr9QqTVa+L3Zgqc46QNs2WCY79XnlZuxPfR1QJ7o vlkPXpS1Go/FWqxCmgVHo+oPX+wPGYOQAOJ+OS22imtMQe97AANTNlMj1yiV5QQ1XgvCe7sEoLw N13C5buuLzNWBegCW2wgn7iDBesS0gBwKKRHe+r/ns4Elr0Tkn1BSvVPeGzW99Iu+7Q6x1jCvgS hoZHdLMtZz3gO3LWCI= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.767800-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24526.005 X-MDID: 1554197338-HgxpbW-aVlAb Subject: [dpdk-dev] [PATCH 03/12] net/sfc: make TSO descriptor numbers EF10-specific X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190402092835.X0lJHXAyKPR1cm6iiWxPYMzpp_O6mYTS24vskmK5GWc@z> From: Igor Romanov Numbers of extra descriptors required for TSO are EF10-specific in fact. Highlight it in define names. Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc_ef10_tx.c | 12 ++++++------ drivers/net/sfc/sfc_tso.c | 2 +- drivers/net/sfc/sfc_tso.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c index 97b1b6252..999dabd12 100644 --- a/drivers/net/sfc/sfc_ef10_tx.c +++ b/drivers/net/sfc/sfc_ef10_tx.c @@ -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]); diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c index a28af0e78..1ce787f3c 100644 --- a/drivers/net/sfc/sfc_tso.c +++ b/drivers/net/sfc/sfc_tso.c @@ -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. diff --git a/drivers/net/sfc/sfc_tso.h b/drivers/net/sfc/sfc_tso.h index f89aef07c..cd151782f 100644 --- a/drivers/net/sfc/sfc_tso.h +++ b/drivers/net/sfc/sfc_tso.h @@ -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); -- 2.17.1