Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/116117/?format=api
http://patches.dpdk.org/api/patches/116117/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1662674385-30823-1-git-send-email-longli@linuxonhyperv.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1662674385-30823-1-git-send-email-longli@linuxonhyperv.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1662674385-30823-1-git-send-email-longli@linuxonhyperv.com", "date": "2022-09-08T21:59:45", "name": "[v8,15/18] net/mana: add function to send packets", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "2866215766632b51852b5c9d80af8588f4e7e1cb", "submitter": { "id": 1784, "url": "http://patches.dpdk.org/api/people/1784/?format=api", "name": "Long Li", "email": "longli@linuxonhyperv.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1662674385-30823-1-git-send-email-longli@linuxonhyperv.com/mbox/", "series": [ { "id": 24612, "url": "http://patches.dpdk.org/api/series/24612/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24612", "date": "2022-09-08T21:54:40", "name": "Introduce Microsoft Azure Network Adatper (MANA) PMD", "version": 8, "mbox": "http://patches.dpdk.org/series/24612/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/116117/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/116117/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 212ECA0548;\n\tThu, 8 Sep 2022 23:59:49 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0DD5442826;\n\tThu, 8 Sep 2022 23:59:49 +0200 (CEST)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 7562342826\n for <dev@dpdk.org>; Thu, 8 Sep 2022 23:59:47 +0200 (CEST)", "by linux.microsoft.com (Postfix, from userid 1004)\n id D2175204A59D; Thu, 8 Sep 2022 14:59:46 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com D2175204A59D", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com;\n s=default; t=1662674386;\n bh=hSnoub8LTNdI88UChCPEo9jTsUFKWUwnxLJJ/Fr1IKE=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From;\n b=b6rn0ena0+Jx/3ln57ZeDZtDBdGbkV+KSNSfdzw2OoRtQywMsWcak6SCY49iaMj0N\n YPKil2Iyp4yKZqF/Ctodu2KY0su73mNoCyKyxq/CFLy8Fc+h+c0u7ukD037RftKKDD\n gNZF1rtqWLNluPFffFH6vljFQkzCuCzA/ANFcoLc=", "From": "longli@linuxonhyperv.com", "To": "Ferruh Yigit <ferruh.yigit@xilinx.com>", "Cc": "dev@dpdk.org, Ajay Sharma <sharmaajay@microsoft.com>,\n Stephen Hemminger <sthemmin@microsoft.com>, Long Li <longli@microsoft.com>", "Subject": "[Patch v8 15/18] net/mana: add function to send packets", "Date": "Thu, 8 Sep 2022 14:59:45 -0700", "Message-Id": "<1662674385-30823-1-git-send-email-longli@linuxonhyperv.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1662169260-4953-16-git-send-email-longli@linuxonhyperv.com>", "References": "<1662169260-4953-16-git-send-email-longli@linuxonhyperv.com>", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Reply-To": "longli@microsoft.com", "Errors-To": "dev-bounces@dpdk.org" }, "content": "From: Long Li <longli@microsoft.com>\n\nWith all the TX queues created, MANA can send packets over those queues.\n\nSigned-off-by: Long Li <longli@microsoft.com>\n---\nChange log:\nv2: rename all camel cases.\nv7: return the correct number of packets sent\nv8:\nfix coding style to function definitions.\nchange enum names to use capital letters.\n\n doc/guides/nics/features/mana.ini | 1 +\n drivers/net/mana/mana.c | 1 +\n drivers/net/mana/mana.h | 65 ++++++++\n drivers/net/mana/mp.c | 1 +\n drivers/net/mana/tx.c | 248 ++++++++++++++++++++++++++++++\n 5 files changed, 316 insertions(+)", "diff": "diff --git a/doc/guides/nics/features/mana.ini b/doc/guides/nics/features/mana.ini\nindex fdbf22d335..7922816d66 100644\n--- a/doc/guides/nics/features/mana.ini\n+++ b/doc/guides/nics/features/mana.ini\n@@ -4,6 +4,7 @@\n ; Refer to default.ini for the full list of available PMD features.\n ;\n [Features]\n+Free Tx mbuf on demand = Y\n Link status = P\n Linux = Y\n L3 checksum offload = Y\ndiff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c\nindex 7ed6063cc3..92692037b1 100644\n--- a/drivers/net/mana/mana.c\n+++ b/drivers/net/mana/mana.c\n@@ -990,6 +990,7 @@ mana_pci_probe_mac(struct rte_pci_device *pci_dev,\n \t\t\t\t/* fd is no not used after mapping doorbell */\n \t\t\t\tclose(fd);\n \n+\t\t\t\teth_dev->tx_pkt_burst = mana_tx_burst;\n \t\t\t\teth_dev->rx_pkt_burst = mana_rx_burst;\n \n \t\t\t\trte_spinlock_lock(&mana_shared_data->lock);\ndiff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h\nindex c2ffa14009..83e3be0d6d 100644\n--- a/drivers/net/mana/mana.h\n+++ b/drivers/net/mana/mana.h\n@@ -61,6 +61,47 @@ struct mana_shared_data {\n \n #define NOT_USING_CLIENT_DATA_UNIT 0\n \n+enum tx_packet_format_v2 {\n+\tSHORT_PACKET_FORMAT = 0,\n+\tLONG_PACKET_FORMAT = 1\n+};\n+\n+struct transmit_short_oob_v2 {\n+\tenum tx_packet_format_v2 packet_format : 2;\n+\tuint32_t tx_is_outer_ipv4 : 1;\n+\tuint32_t tx_is_outer_ipv6 : 1;\n+\tuint32_t tx_compute_IP_header_checksum : 1;\n+\tuint32_t tx_compute_TCP_checksum : 1;\n+\tuint32_t tx_compute_UDP_checksum : 1;\n+\tuint32_t suppress_tx_CQE_generation : 1;\n+\tuint32_t VCQ_number : 24;\n+\tuint32_t tx_transport_header_offset : 10;\n+\tuint32_t VSQ_frame_num : 14;\n+\tuint32_t short_vport_offset : 8;\n+};\n+\n+struct transmit_long_oob_v2 {\n+\tuint32_t tx_is_encapsulated_packet : 1;\n+\tuint32_t tx_inner_is_ipv6 : 1;\n+\tuint32_t tx_inner_TCP_options_present : 1;\n+\tuint32_t inject_vlan_prior_tag : 1;\n+\tuint32_t reserved1 : 12;\n+\tuint32_t priority_code_point : 3;\n+\tuint32_t drop_eligible_indicator : 1;\n+\tuint32_t vlan_identifier : 12;\n+\tuint32_t tx_inner_frame_offset : 10;\n+\tuint32_t tx_inner_IP_header_relative_offset : 6;\n+\tuint32_t long_vport_offset : 12;\n+\tuint32_t reserved3 : 4;\n+\tuint32_t reserved4 : 32;\n+\tuint32_t reserved5 : 32;\n+};\n+\n+struct transmit_oob_v2 {\n+\tstruct transmit_short_oob_v2 short_oob;\n+\tstruct transmit_long_oob_v2 long_oob;\n+};\n+\n enum gdma_queue_types {\n \tGDMA_QUEUE_TYPE_INVALID = 0,\n \tGDMA_QUEUE_SEND,\n@@ -182,6 +223,17 @@ enum mana_cqe_type {\n \tCQE_RX_COALESCED_4 = 2,\n \tCQE_RX_OBJECT_FENCE = 3,\n \tCQE_RX_TRUNCATED = 4,\n+\n+\tCQE_TX_OKAY = 32,\n+\tCQE_TX_SA_DROP = 33,\n+\tCQE_TX_MTU_DROP = 34,\n+\tCQE_TX_INVALID_OOB = 35,\n+\tCQE_TX_INVALID_ETH_TYPE = 36,\n+\tCQE_TX_HDR_PROCESSING_ERROR = 37,\n+\tCQE_TX_VF_DISABLED = 38,\n+\tCQE_TX_VPORT_IDX_OUT_OF_RANGE = 39,\n+\tCQE_TX_VPORT_DISABLED = 40,\n+\tCQE_TX_VLAN_TAGGING_VIOLATION = 41,\n };\n \n struct mana_cqe_header {\n@@ -190,6 +242,17 @@ struct mana_cqe_header {\n \tuint32_t vendor_err : 24;\n }; /* HW DATA */\n \n+struct mana_tx_comp_oob {\n+\tstruct mana_cqe_header cqe_hdr;\n+\n+\tuint32_t tx_data_offset;\n+\n+\tuint32_t tx_sgl_offset : 5;\n+\tuint32_t tx_wqe_offset : 27;\n+\n+\tuint32_t reserved[12];\n+}; /* HW DATA */\n+\n /* NDIS HASH Types */\n #define BIT(nr)\t\t(1 << (nr))\n #define NDIS_HASH_IPV4 BIT(0)\n@@ -406,6 +469,8 @@ uint8_t *gdma_get_wqe_pointer(struct mana_gdma_queue *queue);\n \n uint16_t mana_rx_burst(void *dpdk_rxq, struct rte_mbuf **rx_pkts,\n \t\t uint16_t pkts_n);\n+uint16_t mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts,\n+\t\t uint16_t pkts_n);\n \n uint16_t mana_rx_burst_removed(void *dpdk_rxq, struct rte_mbuf **pkts,\n \t\t\t uint16_t pkts_n);\ndiff --git a/drivers/net/mana/mp.c b/drivers/net/mana/mp.c\nindex feda30623a..92432c431d 100644\n--- a/drivers/net/mana/mp.c\n+++ b/drivers/net/mana/mp.c\n@@ -141,6 +141,7 @@ mana_mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)\n \tcase MANA_MP_REQ_START_RXTX:\n \t\tDRV_LOG(INFO, \"Port %u starting datapath\", dev->data->port_id);\n \n+\t\tdev->tx_pkt_burst = mana_tx_burst;\n \t\tdev->rx_pkt_burst = mana_rx_burst;\n \n \t\trte_mb();\ndiff --git a/drivers/net/mana/tx.c b/drivers/net/mana/tx.c\nindex e4ff0fbf56..0884681c30 100644\n--- a/drivers/net/mana/tx.c\n+++ b/drivers/net/mana/tx.c\n@@ -164,3 +164,251 @@ get_vsq_frame_num(uint32_t vsq)\n \tv.gdma_txq_id = vsq;\n \treturn v.vsq_frame;\n }\n+\n+uint16_t\n+mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n+{\n+\tstruct mana_txq *txq = dpdk_txq;\n+\tstruct mana_priv *priv = txq->priv;\n+\tstruct gdma_comp comp;\n+\tint ret;\n+\tvoid *db_page;\n+\tuint16_t pkt_sent = 0;\n+\n+\t/* Process send completions from GDMA */\n+\twhile (gdma_poll_completion_queue(&txq->gdma_cq, &comp) == 1) {\n+\t\tstruct mana_txq_desc *desc =\n+\t\t\t&txq->desc_ring[txq->desc_ring_tail];\n+\t\tstruct mana_tx_comp_oob *oob =\n+\t\t\t(struct mana_tx_comp_oob *)&comp.completion_data[0];\n+\n+\t\tif (oob->cqe_hdr.cqe_type != CQE_TX_OKAY) {\n+\t\t\tDRV_LOG(ERR,\n+\t\t\t\t\"mana_tx_comp_oob cqe_type %u vendor_err %u\",\n+\t\t\t\toob->cqe_hdr.cqe_type, oob->cqe_hdr.vendor_err);\n+\t\t\ttxq->stats.errors++;\n+\t\t} else {\n+\t\t\tDRV_LOG(DEBUG, \"mana_tx_comp_oob CQE_TX_OKAY\");\n+\t\t\ttxq->stats.packets++;\n+\t\t}\n+\n+\t\tif (!desc->pkt) {\n+\t\t\tDRV_LOG(ERR, \"mana_txq_desc has a NULL pkt\");\n+\t\t} else {\n+\t\t\ttxq->stats.bytes += desc->pkt->data_len;\n+\t\t\trte_pktmbuf_free(desc->pkt);\n+\t\t}\n+\n+\t\tdesc->pkt = NULL;\n+\t\ttxq->desc_ring_tail = (txq->desc_ring_tail + 1) % txq->num_desc;\n+\t\ttxq->gdma_sq.tail += desc->wqe_size_in_bu;\n+\t}\n+\n+\t/* Post send requests to GDMA */\n+\tfor (uint16_t pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) {\n+\t\tstruct rte_mbuf *m_pkt = tx_pkts[pkt_idx];\n+\t\tstruct rte_mbuf *m_seg = m_pkt;\n+\t\tstruct transmit_oob_v2 tx_oob = {0};\n+\t\tstruct one_sgl sgl = {0};\n+\t\tuint16_t seg_idx;\n+\n+\t\t/* Drop the packet if it exceeds max segments */\n+\t\tif (m_pkt->nb_segs > priv->max_send_sge) {\n+\t\t\tDRV_LOG(ERR, \"send packet segments %d exceeding max\",\n+\t\t\t\tm_pkt->nb_segs);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\t/* Fill in the oob */\n+\t\ttx_oob.short_oob.packet_format = SHORT_PACKET_FORMAT;\n+\t\ttx_oob.short_oob.tx_is_outer_ipv4 =\n+\t\t\tm_pkt->ol_flags & RTE_MBUF_F_TX_IPV4 ? 1 : 0;\n+\t\ttx_oob.short_oob.tx_is_outer_ipv6 =\n+\t\t\tm_pkt->ol_flags & RTE_MBUF_F_TX_IPV6 ? 1 : 0;\n+\n+\t\ttx_oob.short_oob.tx_compute_IP_header_checksum =\n+\t\t\tm_pkt->ol_flags & RTE_MBUF_F_TX_IP_CKSUM ? 1 : 0;\n+\n+\t\tif ((m_pkt->ol_flags & RTE_MBUF_F_TX_L4_MASK) ==\n+\t\t\t\tRTE_MBUF_F_TX_TCP_CKSUM) {\n+\t\t\tstruct rte_tcp_hdr *tcp_hdr;\n+\n+\t\t\t/* HW needs partial TCP checksum */\n+\n+\t\t\ttcp_hdr = rte_pktmbuf_mtod_offset(m_pkt,\n+\t\t\t\t\t struct rte_tcp_hdr *,\n+\t\t\t\t\t m_pkt->l2_len + m_pkt->l3_len);\n+\n+\t\t\tif (m_pkt->ol_flags & RTE_MBUF_F_TX_IPV4) {\n+\t\t\t\tstruct rte_ipv4_hdr *ip_hdr;\n+\n+\t\t\t\tip_hdr = rte_pktmbuf_mtod_offset(m_pkt,\n+\t\t\t\t\t\tstruct rte_ipv4_hdr *,\n+\t\t\t\t\t\tm_pkt->l2_len);\n+\t\t\t\ttcp_hdr->cksum = rte_ipv4_phdr_cksum(ip_hdr,\n+\t\t\t\t\t\t\tm_pkt->ol_flags);\n+\n+\t\t\t} else if (m_pkt->ol_flags & RTE_MBUF_F_TX_IPV6) {\n+\t\t\t\tstruct rte_ipv6_hdr *ip_hdr;\n+\n+\t\t\t\tip_hdr = rte_pktmbuf_mtod_offset(m_pkt,\n+\t\t\t\t\t\tstruct rte_ipv6_hdr *,\n+\t\t\t\t\t\tm_pkt->l2_len);\n+\t\t\t\ttcp_hdr->cksum = rte_ipv6_phdr_cksum(ip_hdr,\n+\t\t\t\t\t\t\tm_pkt->ol_flags);\n+\t\t\t} else {\n+\t\t\t\tDRV_LOG(ERR, \"Invalid input for TCP CKSUM\");\n+\t\t\t}\n+\n+\t\t\ttx_oob.short_oob.tx_compute_TCP_checksum = 1;\n+\t\t\ttx_oob.short_oob.tx_transport_header_offset =\n+\t\t\t\tm_pkt->l2_len + m_pkt->l3_len;\n+\t\t}\n+\n+\t\tif ((m_pkt->ol_flags & RTE_MBUF_F_TX_L4_MASK) ==\n+\t\t\t\tRTE_MBUF_F_TX_UDP_CKSUM) {\n+\t\t\tstruct rte_udp_hdr *udp_hdr;\n+\n+\t\t\t/* HW needs partial UDP checksum */\n+\t\t\tudp_hdr = rte_pktmbuf_mtod_offset(m_pkt,\n+\t\t\t\t\tstruct rte_udp_hdr *,\n+\t\t\t\t\tm_pkt->l2_len + m_pkt->l3_len);\n+\n+\t\t\tif (m_pkt->ol_flags & RTE_MBUF_F_TX_IPV4) {\n+\t\t\t\tstruct rte_ipv4_hdr *ip_hdr;\n+\n+\t\t\t\tip_hdr = rte_pktmbuf_mtod_offset(m_pkt,\n+\t\t\t\t\t\tstruct rte_ipv4_hdr *,\n+\t\t\t\t\t\tm_pkt->l2_len);\n+\n+\t\t\t\tudp_hdr->dgram_cksum =\n+\t\t\t\t\trte_ipv4_phdr_cksum(ip_hdr,\n+\t\t\t\t\t\t\t m_pkt->ol_flags);\n+\n+\t\t\t} else if (m_pkt->ol_flags & RTE_MBUF_F_TX_IPV6) {\n+\t\t\t\tstruct rte_ipv6_hdr *ip_hdr;\n+\n+\t\t\t\tip_hdr = rte_pktmbuf_mtod_offset(m_pkt,\n+\t\t\t\t\t\tstruct rte_ipv6_hdr *,\n+\t\t\t\t\t\tm_pkt->l2_len);\n+\n+\t\t\t\tudp_hdr->dgram_cksum =\n+\t\t\t\t\trte_ipv6_phdr_cksum(ip_hdr,\n+\t\t\t\t\t\t\t m_pkt->ol_flags);\n+\n+\t\t\t} else {\n+\t\t\t\tDRV_LOG(ERR, \"Invalid input for UDP CKSUM\");\n+\t\t\t}\n+\n+\t\t\ttx_oob.short_oob.tx_compute_UDP_checksum = 1;\n+\t\t}\n+\n+\t\ttx_oob.short_oob.suppress_tx_CQE_generation = 0;\n+\t\ttx_oob.short_oob.VCQ_number = txq->gdma_cq.id;\n+\n+\t\ttx_oob.short_oob.VSQ_frame_num =\n+\t\t\tget_vsq_frame_num(txq->gdma_sq.id);\n+\t\ttx_oob.short_oob.short_vport_offset = txq->tx_vp_offset;\n+\n+\t\tDRV_LOG(DEBUG, \"tx_oob packet_format %u ipv4 %u ipv6 %u\",\n+\t\t\ttx_oob.short_oob.packet_format,\n+\t\t\ttx_oob.short_oob.tx_is_outer_ipv4,\n+\t\t\ttx_oob.short_oob.tx_is_outer_ipv6);\n+\n+\t\tDRV_LOG(DEBUG, \"tx_oob checksum ip %u tcp %u udp %u offset %u\",\n+\t\t\ttx_oob.short_oob.tx_compute_IP_header_checksum,\n+\t\t\ttx_oob.short_oob.tx_compute_TCP_checksum,\n+\t\t\ttx_oob.short_oob.tx_compute_UDP_checksum,\n+\t\t\ttx_oob.short_oob.tx_transport_header_offset);\n+\n+\t\tDRV_LOG(DEBUG, \"pkt[%d]: buf_addr 0x%p, nb_segs %d, pkt_len %d\",\n+\t\t\tpkt_idx, m_pkt->buf_addr, m_pkt->nb_segs,\n+\t\t\tm_pkt->pkt_len);\n+\n+\t\t/* Create SGL for packet data buffers */\n+\t\tfor (seg_idx = 0; seg_idx < m_pkt->nb_segs; seg_idx++) {\n+\t\t\tstruct mana_mr_cache *mr =\n+\t\t\t\tmana_find_pmd_mr(&txq->mr_btree, priv, m_seg);\n+\n+\t\t\tif (!mr) {\n+\t\t\t\tDRV_LOG(ERR, \"failed to get MR, pkt_idx %u\",\n+\t\t\t\t\tpkt_idx);\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\tsgl.gdma_sgl[seg_idx].address =\n+\t\t\t\trte_cpu_to_le_64(rte_pktmbuf_mtod(m_seg,\n+\t\t\t\t\t\t\t\t uint64_t));\n+\t\t\tsgl.gdma_sgl[seg_idx].size = m_seg->data_len;\n+\t\t\tsgl.gdma_sgl[seg_idx].memory_key = mr->lkey;\n+\n+\t\t\tDRV_LOG(DEBUG,\n+\t\t\t\t\"seg idx %u addr 0x%\" PRIx64 \" size %x key %x\",\n+\t\t\t\tseg_idx, sgl.gdma_sgl[seg_idx].address,\n+\t\t\t\tsgl.gdma_sgl[seg_idx].size,\n+\t\t\t\tsgl.gdma_sgl[seg_idx].memory_key);\n+\n+\t\t\tm_seg = m_seg->next;\n+\t\t}\n+\n+\t\t/* Skip this packet if we can't populate all segments */\n+\t\tif (seg_idx != m_pkt->nb_segs)\n+\t\t\tcontinue;\n+\n+\t\tstruct gdma_work_request work_req = {0};\n+\t\tstruct gdma_posted_wqe_info wqe_info = {0};\n+\n+\t\twork_req.gdma_header.struct_size = sizeof(work_req);\n+\t\twqe_info.gdma_header.struct_size = sizeof(wqe_info);\n+\n+\t\twork_req.sgl = sgl.gdma_sgl;\n+\t\twork_req.num_sgl_elements = m_pkt->nb_segs;\n+\t\twork_req.inline_oob_size_in_bytes =\n+\t\t\tsizeof(struct transmit_short_oob_v2);\n+\t\twork_req.inline_oob_data = &tx_oob;\n+\t\twork_req.flags = 0;\n+\t\twork_req.client_data_unit = NOT_USING_CLIENT_DATA_UNIT;\n+\n+\t\tret = gdma_post_work_request(&txq->gdma_sq, &work_req,\n+\t\t\t\t\t &wqe_info);\n+\t\tif (!ret) {\n+\t\t\tstruct mana_txq_desc *desc =\n+\t\t\t\t&txq->desc_ring[txq->desc_ring_head];\n+\n+\t\t\t/* Update queue for tracking pending requests */\n+\t\t\tdesc->pkt = m_pkt;\n+\t\t\tdesc->wqe_size_in_bu = wqe_info.wqe_size_in_bu;\n+\t\t\ttxq->desc_ring_head =\n+\t\t\t\t(txq->desc_ring_head + 1) % txq->num_desc;\n+\n+\t\t\tpkt_sent++;\n+\n+\t\t\tDRV_LOG(DEBUG, \"nb_pkts %u pkt[%d] sent\",\n+\t\t\t\tnb_pkts, pkt_idx);\n+\t\t} else {\n+\t\t\tDRV_LOG(INFO, \"pkt[%d] failed to post send ret %d\",\n+\t\t\t\tpkt_idx, ret);\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\t/* Ring hardware door bell */\n+\tdb_page = priv->db_page;\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n+\t\tstruct rte_eth_dev *dev =\n+\t\t\t&rte_eth_devices[priv->dev_data->port_id];\n+\t\tstruct mana_process_priv *process_priv = dev->process_private;\n+\n+\t\tdb_page = process_priv->db_page;\n+\t}\n+\n+\tif (pkt_sent)\n+\t\tret = mana_ring_doorbell(db_page, GDMA_QUEUE_SEND,\n+\t\t\t\t\t txq->gdma_sq.id,\n+\t\t\t\t\t txq->gdma_sq.head *\n+\t\t\t\t\t\tGDMA_WQE_ALIGNMENT_UNIT_SIZE);\n+\tif (ret)\n+\t\tDRV_LOG(ERR, \"mana_ring_doorbell failed ret %d\", ret);\n+\n+\treturn pkt_sent;\n+}\n", "prefixes": [ "v8", "15/18" ] }{ "id": 116117, "url": "