Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/52079/?format=api
http://patches.dpdk.org/api/patches/52079/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1554197324-32391-5-git-send-email-arybchenko@solarflare.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": "<1554197324-32391-5-git-send-email-arybchenko@solarflare.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1554197324-32391-5-git-send-email-arybchenko@solarflare.com", "date": "2019-04-02T09:28:36", "name": "[04/12] net/sfc: support Tx preparation in EFX datapath", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "5648645ccbdabca894276ae39c2941900b5a3d49", "submitter": { "id": 607, "url": "http://patches.dpdk.org/api/people/607/?format=api", "name": "Andrew Rybchenko", "email": "arybchenko@solarflare.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/1554197324-32391-5-git-send-email-arybchenko@solarflare.com/mbox/", "series": [ { "id": 4050, "url": "http://patches.dpdk.org/api/series/4050/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4050", "date": "2019-04-02T09:28:33", "name": "net/sfc: add Tx prepare and encapsulated TSO", "version": 1, "mbox": "http://patches.dpdk.org/series/4050/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/52079/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/52079/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 11DDA5323;\n\tTue, 2 Apr 2019 11:29:11 +0200 (CEST)", "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n\t[148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 668923798\n\tfor <dev@dpdk.org>; Tue, 2 Apr 2019 11:28:59 +0200 (CEST)", "from webmail.solarflare.com (webmail.solarflare.com\n\t[12.187.104.26])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with\n\tESMTPS id 0BC8C10007E; Tue, 2 Apr 2019 09:28:58 +0000 (UTC)", "from ocex03.SolarFlarecom.com (10.20.40.36) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id 15.0.1395.4; Tue, 2 Apr 2019 02:28:55 -0700", "from opal.uk.solarflarecom.com (10.17.10.1) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id\n\t15.0.1395.4 via Frontend Transport; Tue, 2 Apr 2019 02:28:54 -0700", "from ukv-loginhost.uk.solarflarecom.com\n\t(ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n\tby opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tx329Srwm028260; Tue, 2 Apr 2019 10:28:53 +0100", "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\tB9701161612; Tue, 2 Apr 2019 10:28:53 +0100 (BST)" ], "X-Virus-Scanned": "Proofpoint Essentials engine", "From": "Andrew Rybchenko <arybchenko@solarflare.com>", "To": "<dev@dpdk.org>", "CC": "Igor Romanov <igor.romanov@oktetlabs.ru>", "Date": "Tue, 2 Apr 2019 10:28:36 +0100", "Message-ID": "<1554197324-32391-5-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-7.185700-4.000000-10", "X-TMASE-MatchedRID": "GGTeld1kIWgyRohotsnq5+G5dRZCgxC3Thn37FFP5A0lC3U/r0iv83B4\n\t4IkzjfYyj6kCfX0Edc7/Pn5pXbkQo3tcjyQQG4KiFyqkfsPWu1BKgIbix5+XxKbuBeSz8VQ6v7Q\n\tYgpRtFn6njTWnjQxrsYbV78WQIIG+aPW3y1xO3y/1RUeLAvHT8rVNU7DO2GYBx3iBZykOdRxjqy\n\tr7FE9KQPZat09EUv0I9jjbGUN5dRQgiUNITFoQ77RtO1RC1Ep0f6/Md8Lb2l8rYyNNmvu5tbdaM\n\thWaXsFHgsUtzIjIFbkvhdlQKzaVq8RyU2VJ3/XInu1HSadECDWd2Wz0X3OaLZsoi2XrUn/Jn6Kd\n\tMrRsL14qtq5d3cxkNRME7z1CCNiPIPgm+PzyadqNNaJRrmVa6sv709mLaq8JMJcU28/wAj3AvpL\n\tE+mvX8g==", "X-TM-AS-User-Approved-Sender": "No", "X-TM-AS-User-Blocked-Sender": "No", "X-TMASE-Result": "10--7.185700-4.000000", "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24526.005", "X-MDID": "1554197338-tmGKrtFpoG5S", "Subject": "[dpdk-dev] [PATCH 04/12] net/sfc: support Tx preparation in EFX\n\tdatapath", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Igor Romanov <igor.romanov@oktetlabs.ru>\n\nImplement generic checks in Tx prepare function and update Tx burst\nfunction accordingly.\n\nSigned-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n doc/guides/rel_notes/release_19_05.rst | 1 +\n drivers/net/sfc/sfc_dp_tx.h | 24 ++++++++++++++++++++++++\n drivers/net/sfc/sfc_ethdev.c | 4 ++++\n drivers/net/sfc/sfc_tso.c | 13 +++++++------\n drivers/net/sfc/sfc_tx.c | 20 ++++++++++++++++++++\n 5 files changed, 56 insertions(+), 6 deletions(-)", "diff": "diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst\nindex bdad1ddbe..173c852c8 100644\n--- a/doc/guides/rel_notes/release_19_05.rst\n+++ b/doc/guides/rel_notes/release_19_05.rst\n@@ -73,6 +73,7 @@ New Features\n * Added support for RSS RETA and hash configuration get API in a secondary\n process.\n * Added support for Rx packet types list in a secondary process.\n+ * Added Tx prepare to do Tx offloads checks.\n \n * **Updated Mellanox drivers.**\n \ndiff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h\nindex 9cb2198e2..885094b67 100644\n--- a/drivers/net/sfc/sfc_dp_tx.h\n+++ b/drivers/net/sfc/sfc_dp_tx.h\n@@ -13,6 +13,7 @@\n #include <rte_ethdev_driver.h>\n \n #include \"sfc_dp.h\"\n+#include \"sfc_debug.h\"\n \n #ifdef __cplusplus\n extern \"C\" {\n@@ -170,6 +171,7 @@ struct sfc_dp_tx {\n \tsfc_dp_tx_qtx_ev_t\t\t*qtx_ev;\n \tsfc_dp_tx_qreap_t\t\t*qreap;\n \tsfc_dp_tx_qdesc_status_t\t*qdesc_status;\n+\teth_tx_prep_t\t\t\tpkt_prepare;\n \teth_tx_burst_t\t\t\tpkt_burst;\n };\n \n@@ -192,6 +194,28 @@ sfc_dp_find_tx_by_caps(struct sfc_dp_list *head, unsigned int avail_caps)\n /** Get Tx datapath ops by the datapath TxQ handle */\n const struct sfc_dp_tx *sfc_dp_tx_by_dp_txq(const struct sfc_dp_txq *dp_txq);\n \n+static inline int\n+sfc_dp_tx_prepare_pkt(struct rte_mbuf *m)\n+{\n+#ifdef RTE_LIBRTE_SFC_EFX_DEBUG\n+\tint ret;\n+\n+\tret = rte_validate_tx_offload(m);\n+\tif (ret != 0) {\n+\t\t/*\n+\t\t * Negative error code is returned by rte_validate_tx_offload(),\n+\t\t * but positive are used inside net/sfc PMD.\n+\t\t */\n+\t\tSFC_ASSERT(ret < 0);\n+\t\treturn -ret;\n+\t}\n+#else\n+\tRTE_SET_USED(m);\n+#endif\n+\n+\treturn 0;\n+}\n+\n extern struct sfc_dp_tx sfc_efx_tx;\n extern struct sfc_dp_tx sfc_ef10_tx;\n extern struct sfc_dp_tx sfc_ef10_simple_tx;\ndiff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c\nindex 2675d4a8c..6c33601e7 100644\n--- a/drivers/net/sfc/sfc_ethdev.c\n+++ b/drivers/net/sfc/sfc_ethdev.c\n@@ -1854,6 +1854,7 @@ sfc_eth_dev_set_ops(struct rte_eth_dev *dev)\n \tsa->priv.dp_tx = dp_tx;\n \n \tdev->rx_pkt_burst = dp_rx->pkt_burst;\n+\tdev->tx_pkt_prepare = dp_tx->pkt_prepare;\n \tdev->tx_pkt_burst = dp_tx->pkt_burst;\n \n \tdev->dev_ops = &sfc_eth_dev_ops;\n@@ -1881,6 +1882,7 @@ sfc_eth_dev_clear_ops(struct rte_eth_dev *dev)\n \tstruct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);\n \n \tdev->dev_ops = NULL;\n+\tdev->tx_pkt_prepare = NULL;\n \tdev->rx_pkt_burst = NULL;\n \tdev->tx_pkt_burst = NULL;\n \n@@ -1961,6 +1963,7 @@ sfc_eth_dev_secondary_init(struct rte_eth_dev *dev, uint32_t logtype_main)\n \n \tdev->process_private = sap;\n \tdev->rx_pkt_burst = dp_rx->pkt_burst;\n+\tdev->tx_pkt_prepare = dp_tx->pkt_prepare;\n \tdev->tx_pkt_burst = dp_tx->pkt_burst;\n \tdev->dev_ops = &sfc_eth_dev_secondary_ops;\n \n@@ -1982,6 +1985,7 @@ sfc_eth_dev_secondary_clear_ops(struct rte_eth_dev *dev)\n \tfree(dev->process_private);\n \tdev->process_private = NULL;\n \tdev->dev_ops = NULL;\n+\tdev->tx_pkt_prepare = NULL;\n \tdev->tx_pkt_burst = NULL;\n \tdev->rx_pkt_burst = NULL;\n }\ndiff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c\nindex 1ce787f3c..2c03c0837 100644\n--- a/drivers/net/sfc/sfc_tso.c\n+++ b/drivers/net/sfc/sfc_tso.c\n@@ -97,7 +97,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,\n \tuint8_t *tsoh;\n \tconst struct tcp_hdr *th;\n \tefsys_dma_addr_t header_paddr;\n-\tuint16_t packet_id;\n+\tuint16_t packet_id = 0;\n \tuint32_t sent_seq;\n \tstruct rte_mbuf *m = *in_seg;\n \tsize_t nh_off = m->l2_len; /* IP header offset */\n@@ -147,17 +147,18 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,\n \t\ttsoh = rte_pktmbuf_mtod(m, uint8_t *);\n \t}\n \n-\t/* Handle IP header */\n+\t/*\n+\t * Handle IP header. Tx prepare has debug-only checks that offload flags\n+\t * are correctly filled in in TSO mbuf. Use zero IPID if there is no\n+\t * IPv4 flag. If the packet is still IPv4, HW will simply start from\n+\t * zero IPID.\n+\t */\n \tif (m->ol_flags & PKT_TX_IPV4) {\n \t\tconst struct ipv4_hdr *iphe4;\n \n \t\tiphe4 = (const struct ipv4_hdr *)(tsoh + nh_off);\n \t\trte_memcpy(&packet_id, &iphe4->packet_id, sizeof(uint16_t));\n \t\tpacket_id = rte_be_to_cpu_16(packet_id);\n-\t} else if (m->ol_flags & PKT_TX_IPV6) {\n-\t\tpacket_id = 0;\n-\t} else {\n-\t\treturn EINVAL;\n \t}\n \n \t/* Handle TCP header */\ndiff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c\nindex 4b1f94ce8..16fd220bf 100644\n--- a/drivers/net/sfc/sfc_tx.c\n+++ b/drivers/net/sfc/sfc_tx.c\n@@ -697,6 +697,25 @@ sfc_efx_tx_maybe_insert_tag(struct sfc_efx_txq *txq, struct rte_mbuf *m,\n \treturn 1;\n }\n \n+static uint16_t\n+sfc_efx_prepare_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n+\t\t uint16_t nb_pkts)\n+{\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < nb_pkts; i++) {\n+\t\tint ret;\n+\n+\t\tret = sfc_dp_tx_prepare_pkt(tx_pkts[i]);\n+\t\tif (unlikely(ret != 0)) {\n+\t\t\trte_errno = ret;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn i;\n+}\n+\n static uint16_t\n sfc_efx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n {\n@@ -1122,5 +1141,6 @@ struct sfc_dp_tx sfc_efx_tx = {\n \t.qstop\t\t\t= sfc_efx_tx_qstop,\n \t.qreap\t\t\t= sfc_efx_tx_qreap,\n \t.qdesc_status\t\t= sfc_efx_tx_qdesc_status,\n+\t.pkt_prepare\t\t= sfc_efx_prepare_pkts,\n \t.pkt_burst\t\t= sfc_efx_xmit_pkts,\n };\n", "prefixes": [ "04/12" ] }{ "id": 52079, "url": "