From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0080.outbound.protection.outlook.com [104.47.38.80]) by dpdk.org (Postfix) with ESMTP id 1861A5689 for ; Sun, 28 May 2017 10:38:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=THysuIQeKJd+2rGUBmPsv7GmpQ/nxg7Z4xWdvYTntvE=; b=FOfy17LKgtRsi8tVTOYvQrKglcBZ6Pp4MK5OAS7Mhkk5ID6Jb4B/wfBd4PCJyNRrK/up/UgjxhonkJi2HsVlPa7mS13HjRWNhakESONpZj5NucKQ7PBvHxzJ0t22WfSYhqRgkTomvutDw8DSGEJYsOy2XrtXBFaqYnaaQbwJMRU= Received: from MWHPR07CA0012.namprd07.prod.outlook.com (2603:10b6:300:dc::22) by DM2PR07MB429.namprd07.prod.outlook.com (2a01:111:e400:243a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Sun, 28 May 2017 08:38:56 +0000 Received: from BN1BFFO11FD001.protection.gbl (2a01:111:f400:7c10::1:121) by MWHPR07CA0012.outlook.office365.com (2603:10b6:300:dc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Sun, 28 May 2017 08:38:56 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1BFFO11FD001.mail.protection.outlook.com (10.58.144.64) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1075.5 via Frontend Transport; Sun, 28 May 2017 08:38:55 +0000 Received: from avsmtprelay01.qlc.com (10.1.112.194) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Sun, 28 May 2017 01:38:49 -0700 Received: from avluser05.qlc.com (avluser05.qlc.com [10.1.113.115]) by avsmtprelay01.qlc.com (Postfix) with ESMTP id 81C7A8BF762DC; Sun, 28 May 2017 01:38:49 -0700 (PDT) Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id v4S8cn4m000518; Sun, 28 May 2017 01:38:49 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@cavium.com using -f From: Rasesh Mody To: CC: Harish Patil , Date: Sun, 28 May 2017 01:37:32 -0700 Message-ID: <1495960654-352-6-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1495960654-352-1-git-send-email-rasesh.mody@cavium.com> References: <1495960654-352-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39410400002)(39850400002)(39400400002)(39450400003)(39840400002)(2980300002)(428002)(189002)(199003)(9170700003)(4720700003)(2906002)(86362001)(36756003)(42186005)(189998001)(5660300001)(54906002)(105586002)(81166006)(8676002)(8936002)(305945005)(356003)(72206003)(47776003)(6666003)(2950100002)(6916009)(87636003)(106466001)(2351001)(5003940100001)(478600001)(50226002)(76176999)(101416001)(50986999)(33646002)(110136004)(38730400002)(48376002)(4326008)(107886003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR07MB429; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD001; 1:jiLxpMA0XL7urW0h9pe2+Hs4a4M40Lc28FWfvlbPSUSlAqSCrfo50sinIr+0M2lKWJvyqCV4jmyFV+qdAvhrOXBWTsR/aYZnctywJNe0UzZfmbnO2HDxORLPaOLcoEUspF63wGh8yzHzbEY31C8Pt9McRtOMzuYqOO1rXdCRknzAiJKmgS/P/gg5WedG4iQt73UozBBAYlHVUzNFuxvlPShwtggEBnffdJjq+ECoOfN7voxzX9coGhVkJWriEzK8qXHlZVA4gigKL7QxSjetVrKKTDxNhdb2/F14bHtfVNBRBFDqIPEv6RtEk+wW0Dg+18sYpe1WPiaLHlCThR9lRw1Z+ChpI9FpxH91qaNmT+EiPojfXotlJyoWgysMdeBrRd5eWa/bkJ3LuH/29lCneeOBOuMGvxEmHVZW4nS5yOzeI8SmERPmAt/5Z/jeHVs0yo4BWN069h6FYX7nUNc6Hg== X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR07MB429: X-MS-Office365-Filtering-Correlation-Id: 626529fa-532b-4c89-25d0-08d4a5a4fa50 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:DM2PR07MB429; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB429; 3:Z9zZcw+bpfQ5xlJL8ZOR0HoKB/8cnSVqUP/A7ZnZGCVOR/SnboU2GbDRcMjMSahFTYCuRIOTYzhDCC1hOhorHMBjx3XSsCmO6JWkwYiIY0ZgslZmlRD73C8J67CsQNJxxYbd71C4ykDnFlwblNLdripU5ub0EbBB+b/4bFkd163UQ516TxTgmBeXBVLGnTWggEObtW4Uq3lhCBSviJtkXtF4b1qga1ltoYORJ191huZ0FzIbDs4qhLPbZO9RwIm3UWoS+LKovc0ztemQHYTlSghW3CeQ2uyjBMWTsUPDYtHkpoWJ/xozt61AOvwpdsA886FGB3d6PZD0SJ+DGMTQ2W4kKX3OwLS/0DKK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O7aw3+L92RYBM48D85pIuw4F67hTyTUVgyfKhV8hrmGgY3l/DUB4htnQRaxDB61cjZV4OS2ctlje4pWx7De93btcsQTpuEM95qq6e1Zv0wFaLMJrFQ0jJ4moDvq2WzARrHuok5ysxK1LQb2LMbUX50ULHMebF46ZjObeE7OfJCPpDdDTUp64nWc9DrKPWR2O9yXAvjqOuZ4l7+3AB1S93D2YmGpmbBVb59tQ4yRbmAznFF64eyVs2QFggUiq43glebnrVsRAmy+9UCxGptKJiMBNmaLuxKrPu5oeqKHlgEVct8i1+33ZFvpCJmczybeyOGaGuejJMtBpQL6esdkKF/nk82WSRJ9owES6XQlR/pey+QKq46eGoRSpvYYirBVKSTA13OFgN+4RLgfJu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700073)(100105000095)(100000701073)(100105300095)(100000702073)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(10201501046)(3002001)(100000703073)(100105400095)(93006095)(93001095)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123564025)(6072148)(100000704073)(100105200095)(100000705073)(100105500095); SRVR:DM2PR07MB429; BCL:0; PCL:0; RULEID:(100000800073)(100110000095)(100000801073)(100110300095)(100000802073)(100110100095)(100000803073)(100110400095)(100000804073)(100110200095)(100000805073)(100110500095); SRVR:DM2PR07MB429; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR07MB429; 4:nx4emVTD9QHwHLujA+Cv7VFdYimdabav5vNwaju0+he?= =?us-ascii?Q?ugrY1vMrjLmK8xfXCdEelvD2KWt6R5S2v7EcWLXFHT7PlXQQRs5BXkjjYcKi?= =?us-ascii?Q?JB5TwqWO4wgiu2rYX2dxN87lRlzPi8+Qc2ZKivG6Q9+r36jGAGfjquhJNm18?= =?us-ascii?Q?6AGdLjgB8FHc4v8Q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V3Vx1OH5x7Jo/WdkF9hw92uRfGbUqNAlmlKm8IrgSh1Z6g+RHn8QmRYzu6plT8fcW6MWTHKoyf6odxXvs+2+GYpG/YI2NZ0TrVTme0wT9DA64oMXkcg== X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB429; 5:6l2Gz/8HkzzYQUx8DGtfUuwHQ/zhyQK1vGEeISaapanHfNlHseOEOKzAqNXdVUjo3Hevqr4E7Dl0AoUltqO6SBvfWHq9ENub60Uksizpw/jy9cebOqae9yBxRMom0bq7slyglRGPdIr61OxzeZV4cox1c9EQvG8Z6mgPCOJiFuOHlBzdcEmsPoS3rf7KL99dR5zxByPm+Yfb8gej0kHxcV6amUP9kllPRcUnWFXjaK57eTNcS+da1Tvy1AnDra/SFsQloS4By6acIHwcLLrxfazfJW2FKS2OcQ52yRHlB1R1b/cO7UsIqaX+2dEl12I0AzGCxDGvcfmg5pnWC2+LZKqA7/gYd+sBJ332wcmRiO9b9CepxMinOWMqp2ZlwVD03O1fbZzhenldb5MrrdS/aqudsh34lSfIng/1d8qn7ync7nQOuOr175XbV3DtNj7KtKOXq2DP8LijpH08BpCUJHDrEAnC3YlJUOotqBHp6sD+tZqhGSp9Ul3YnArIfXud; 24:LdJOck+QVMtGCrbIyl7dkzE6HfORzB2S9IobgBaxLEgCrKOC/zYSaYYNBvnmLQFBq9OJ/L1IbKz4UuDTdd/Hx13fnCuErIl4mA3IeQwB4ww= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB429; 7:BJmIY6cb/Ll8UAlYjzM0iCwzqFlTQJgtmPLs3DVAFlBsS3oDEc6t7YQPYZUvjeVm7EdQxEXpeZBMmgheWCv929UbXL5XEled/TOh2rf2OxAnoioypgK+JDWvMw88+19dqJWDHQ9qiQGSf1gfC+a13/J0A/Si2UxEnyUDzG+2KG/AAtRZ8VvW2XapszQQzYLWWaWtezYSzB0wxpaYYVRL+sG3YRPkl8gMdtfP/PlTZcCL7Y74PZoOKpjtLjrvBg8F9eYlR0TJPCgYp2G18l8kSpPgB/5pKOQkiL4tw+okA4MvAuEor1KnoyL7ovB+At6kYg4vN6tQvf9vB7eqFkgRzQ== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2017 08:38:55.5582 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR07MB429 Subject: [dpdk-dev] [PATCH 5/7] net/qede: refactor Tx routine 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: Sun, 28 May 2017 08:38:59 -0000 From: Harish Patil Refactor TX routine such that TX BD updates can all be grouped together. Based on the TX offloads requested the TX bitfields are calculated in a temporary variable and TX BDs are updated at the end. This will minimize the if checks also. This change is done to easily accommodate newer TX offload operations in the future. Signed-off-by: Harish Patil --- drivers/net/qede/qede_rxtx.c | 210 ++++++++++++++++++++++-------------------- 1 file changed, 108 insertions(+), 102 deletions(-) diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index 82aa607..1633b91 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -1512,12 +1512,23 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) uint8_t nbds; bool ipv6_ext_flg; bool lso_flg; - bool tunn_flg; + __rte_unused bool tunn_flg; struct eth_tx_1st_bd *bd1; struct eth_tx_2nd_bd *bd2; struct eth_tx_3rd_bd *bd3; uint64_t tx_ol_flags; uint16_t hdr_size; + /* BD1 */ + uint16_t bd1_bf; + uint8_t bd1_bd_flags_bf; + uint16_t vlan; + /* BD2 */ + uint16_t bd2_bf1; + uint16_t bd2_bf2; + /* BD3 */ + uint16_t mss; + uint16_t bd3_bf; + if (unlikely(txq->nb_tx_avail < txq->tx_free_thresh)) { PMD_TX_LOG(DEBUG, txq, "send=%u avail=%u free_thresh=%u", @@ -1533,10 +1544,17 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) tunn_flg = false; lso_flg = false; nbds = 0; + vlan = 0; bd1 = NULL; bd2 = NULL; bd3 = NULL; hdr_size = 0; + bd1_bf = 0; + bd1_bd_flags_bf = 0; + bd2_bf1 = 0; + bd2_bf2 = 0; + mss = 0; + bd3_bf = 0; mbuf = *tx_pkts++; assert(mbuf); @@ -1546,149 +1564,137 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) break; tx_ol_flags = mbuf->ol_flags; + bd1_bd_flags_bf |= 1 << ETH_TX_1ST_BD_FLAGS_START_BD_SHIFT; #define RTE_ETH_IS_IPV6_HDR_EXT(ptype) ((ptype) & RTE_PTYPE_L3_IPV6_EXT) - if (RTE_ETH_IS_IPV6_HDR_EXT(mbuf->packet_type)) + if (RTE_ETH_IS_IPV6_HDR_EXT(mbuf->packet_type)) { ipv6_ext_flg = true; - - if (RTE_ETH_IS_TUNNEL_PKT(mbuf->packet_type)) - tunn_flg = true; - - if (tx_ol_flags & PKT_TX_TCP_SEG) - lso_flg = true; - - if (lso_flg) { - if (unlikely(txq->nb_tx_avail < - ETH_TX_MIN_BDS_PER_LSO_PKT)) - break; - } else { - if (unlikely(txq->nb_tx_avail < - ETH_TX_MIN_BDS_PER_NON_LSO_PKT)) - break; - } - - if (tunn_flg && ipv6_ext_flg) { - if (unlikely(txq->nb_tx_avail < - ETH_TX_MIN_BDS_PER_TUNN_IPV6_WITH_EXT_PKT)) - break; - } - if (ipv6_ext_flg) { if (unlikely(txq->nb_tx_avail < ETH_TX_MIN_BDS_PER_IPV6_WITH_EXT_PKT)) break; } - /* Fill the entry in the SW ring and the BDs in the FW ring */ - idx = TX_PROD(txq); - txq->sw_tx_ring[idx].mbuf = mbuf; - - /* BD1 */ - bd1 = (struct eth_tx_1st_bd *)ecore_chain_produce(&txq->tx_pbl); - memset(bd1, 0, sizeof(struct eth_tx_1st_bd)); - nbds++; - - bd1->data.bd_flags.bitfields |= - 1 << ETH_TX_1ST_BD_FLAGS_START_BD_SHIFT; - /* FW 8.10.x specific change */ - if (!lso_flg) { - bd1->data.bitfields |= - (mbuf->pkt_len & ETH_TX_DATA_1ST_BD_PKT_LEN_MASK) - << ETH_TX_DATA_1ST_BD_PKT_LEN_SHIFT; - /* Map MBUF linear data for DMA and set in the BD1 */ - QEDE_BD_SET_ADDR_LEN(bd1, rte_mbuf_data_dma_addr(mbuf), - mbuf->data_len); - } else { - /* For LSO, packet header and payload must reside on - * buffers pointed by different BDs. Using BD1 for HDR - * and BD2 onwards for data. - */ - hdr_size = mbuf->l2_len + mbuf->l3_len + mbuf->l4_len; - QEDE_BD_SET_ADDR_LEN(bd1, rte_mbuf_data_dma_addr(mbuf), - hdr_size); - } - - if (tunn_flg) { + if (RTE_ETH_IS_TUNNEL_PKT(mbuf->packet_type)) { + if (ipv6_ext_flg) { + if (unlikely(txq->nb_tx_avail < + ETH_TX_MIN_BDS_PER_TUNN_IPV6_WITH_EXT_PKT)) + break; + } + tunn_flg = true; /* First indicate its a tunnel pkt */ - bd1->data.bitfields |= - ETH_TX_DATA_1ST_BD_TUNN_FLAG_MASK << - ETH_TX_DATA_1ST_BD_TUNN_FLAG_SHIFT; - + bd1_bf |= ETH_TX_DATA_1ST_BD_TUNN_FLAG_MASK << + ETH_TX_DATA_1ST_BD_TUNN_FLAG_SHIFT; /* Legacy FW had flipped behavior in regard to this bit * i.e. it needed to set to prevent FW from touching * encapsulated packets when it didn't need to. */ - if (unlikely(txq->is_legacy)) - bd1->data.bitfields ^= - 1 << ETH_TX_DATA_1ST_BD_TUNN_FLAG_SHIFT; - + if (unlikely(txq->is_legacy)) { + bd1_bf ^= 1 << + ETH_TX_DATA_1ST_BD_TUNN_FLAG_SHIFT; + } /* Outer IP checksum offload */ if (tx_ol_flags & PKT_TX_OUTER_IP_CKSUM) { - bd1->data.bd_flags.bitfields |= + bd1_bd_flags_bf |= ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_MASK << ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_SHIFT; } - /* Outer UDP checksum offload */ - bd1->data.bd_flags.bitfields |= + bd1_bd_flags_bf |= ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_MASK << ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_SHIFT; } + if (tx_ol_flags & PKT_TX_TCP_SEG) { + lso_flg = true; + if (unlikely(txq->nb_tx_avail < + ETH_TX_MIN_BDS_PER_LSO_PKT)) + break; + /* For LSO, packet header and payload must reside on + * buffers pointed by different BDs. Using BD1 for HDR + * and BD2 onwards for data. + */ + hdr_size = mbuf->l2_len + mbuf->l3_len + mbuf->l4_len; + bd1_bd_flags_bf |= 1 << ETH_TX_1ST_BD_FLAGS_LSO_SHIFT; + bd1_bd_flags_bf |= + 1 << ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT; + /* PKT_TX_TCP_SEG implies PKT_TX_TCP_CKSUM */ + bd1_bd_flags_bf |= + 1 << ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT; + mss = rte_cpu_to_le_16(mbuf->tso_segsz); + /* Using one header BD */ + bd3_bf |= rte_cpu_to_le_16(1 << + ETH_TX_DATA_3RD_BD_HDR_NBD_SHIFT); + } else { + if (unlikely(txq->nb_tx_avail < + ETH_TX_MIN_BDS_PER_NON_LSO_PKT)) + break; + bd1_bf |= + (mbuf->pkt_len & ETH_TX_DATA_1ST_BD_PKT_LEN_MASK) + << ETH_TX_DATA_1ST_BD_PKT_LEN_SHIFT; + } + /* Descriptor based VLAN insertion */ if (tx_ol_flags & (PKT_TX_VLAN_PKT | PKT_TX_QINQ_PKT)) { - bd1->data.vlan = rte_cpu_to_le_16(mbuf->vlan_tci); - bd1->data.bd_flags.bitfields |= + vlan = rte_cpu_to_le_16(mbuf->vlan_tci); + bd1_bd_flags_bf |= 1 << ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_SHIFT; } - if (lso_flg) - bd1->data.bd_flags.bitfields |= - 1 << ETH_TX_1ST_BD_FLAGS_LSO_SHIFT; - /* Offload the IP checksum in the hardware */ - if ((lso_flg) || (tx_ol_flags & PKT_TX_IP_CKSUM)) - bd1->data.bd_flags.bitfields |= - 1 << ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT; + if (tx_ol_flags & PKT_TX_IP_CKSUM) + bd1_bd_flags_bf |= + 1 << ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT; /* L4 checksum offload (tcp or udp) */ - if ((lso_flg) || (tx_ol_flags & (PKT_TX_TCP_CKSUM | - PKT_TX_UDP_CKSUM))) - /* PKT_TX_TCP_SEG implies PKT_TX_TCP_CKSUM */ - bd1->data.bd_flags.bitfields |= - 1 << ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT; + if (tx_ol_flags & (PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM)) + bd1_bd_flags_bf |= + 1 << ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT; + + if (ipv6_ext_flg) { + /* TBD: check pseudo csum iff tx_prepare not called? */ + bd2_bf1 |= ETH_L4_PSEUDO_CSUM_ZERO_LENGTH << + ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_SHIFT; + } + + /* Fill the entry in the SW ring and the BDs in the FW ring */ + idx = TX_PROD(txq); + txq->sw_tx_ring[idx].mbuf = mbuf; + + /* BD1 */ + bd1 = (struct eth_tx_1st_bd *)ecore_chain_produce(&txq->tx_pbl); + memset(bd1, 0, sizeof(struct eth_tx_1st_bd)); + nbds++; + + /* Map MBUF linear data for DMA and set in the BD1 */ + QEDE_BD_SET_ADDR_LEN(bd1, rte_mbuf_data_dma_addr(mbuf), + mbuf->data_len); + bd1->data.bitfields = bd1_bf; + bd1->data.bd_flags.bitfields = bd1_bd_flags_bf; + bd1->data.vlan = vlan; - /* BD2 */ if (lso_flg || ipv6_ext_flg) { bd2 = (struct eth_tx_2nd_bd *)ecore_chain_produce (&txq->tx_pbl); memset(bd2, 0, sizeof(struct eth_tx_2nd_bd)); nbds++; - QEDE_BD_SET_ADDR_LEN(bd2, - (hdr_size + - rte_mbuf_data_dma_addr(mbuf)), - mbuf->data_len - hdr_size); - /* TBD: check pseudo csum iff tx_prepare not called? */ - if (ipv6_ext_flg) { - bd2->data.bitfields1 |= - ETH_L4_PSEUDO_CSUM_ZERO_LENGTH << - ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_SHIFT; - } - } - /* BD3 */ - if (lso_flg || ipv6_ext_flg) { + /* BD1 */ + QEDE_BD_SET_ADDR_LEN(bd1, rte_mbuf_data_dma_addr(mbuf), + hdr_size); + /* BD2 */ + QEDE_BD_SET_ADDR_LEN(bd2, (hdr_size + + rte_mbuf_data_dma_addr(mbuf)), + mbuf->data_len - hdr_size); + bd2->data.bitfields1 = bd2_bf1; + bd2->data.bitfields2 = bd2_bf2; + + /* BD3 */ bd3 = (struct eth_tx_3rd_bd *)ecore_chain_produce (&txq->tx_pbl); memset(bd3, 0, sizeof(struct eth_tx_3rd_bd)); nbds++; - if (lso_flg) { - bd3->data.lso_mss = - rte_cpu_to_le_16(mbuf->tso_segsz); - /* Using one header BD */ - bd3->data.bitfields |= - rte_cpu_to_le_16(1 << - ETH_TX_DATA_3RD_BD_HDR_NBD_SHIFT); - } + bd3->data.bitfields = bd3_bf; + bd3->data.lso_mss = mss; } /* Handle fragmented MBUF */ -- 1.7.10.3