get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/129066/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 129066,
    "url": "http://patchwork.dpdk.org/api/patches/129066/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230628162927.92858-9-ajit.khaparde@broadcom.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230628162927.92858-9-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230628162927.92858-9-ajit.khaparde@broadcom.com",
    "date": "2023-06-28T16:29:24",
    "name": "[v4,08/11] net/bnxt: update PTP support on Thor",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f486fe4cda81234ba790d48d3520e4bbef2685d1",
    "submitter": {
        "id": 501,
        "url": "http://patchwork.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "http://patchwork.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230628162927.92858-9-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 28693,
            "url": "http://patchwork.dpdk.org/api/series/28693/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28693",
            "date": "2023-06-28T16:29:16",
            "name": "sync Truflow support with latest release",
            "version": 4,
            "mbox": "http://patchwork.dpdk.org/series/28693/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129066/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/129066/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 F2C7042D82;\n\tWed, 28 Jun 2023 18:32:31 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9608842D51;\n\tWed, 28 Jun 2023 18:31:28 +0200 (CEST)",
            "from mail-pl1-f177.google.com (mail-pl1-f177.google.com\n [209.85.214.177])\n by mails.dpdk.org (Postfix) with ESMTP id 0232A42D38\n for <dev@dpdk.org>; Wed, 28 Jun 2023 18:31:24 +0200 (CEST)",
            "by mail-pl1-f177.google.com with SMTP id\n d9443c01a7336-1b809354a15so677925ad.1\n for <dev@dpdk.org>; Wed, 28 Jun 2023 09:31:24 -0700 (PDT)",
            "from localhost.localdomain ([192.19.252.250])\n by smtp.gmail.com with ESMTPSA id\n h12-20020a170902f7cc00b001b8229942a0sm3092403plw.34.2023.06.28.09.31.20\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 28 Jun 2023 09:31:22 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=broadcom.com; s=google; t=1687969884; x=1690561884;\n h=mime-version:references:in-reply-to:message-id:date:subject:cc:to\n :from:from:to:cc:subject:date:message-id:reply-to;\n bh=zpk6PbxTnKoCwKCfRg2ndUmWiu2heZ8AURUD1Fkcnw0=;\n b=W9g0ER0rhb/u35To3kATNzKKDu62q8TG16LM4frAyQ7ZX2eib7JvTXYKx70emEMNW5\n FW1zAzLt8n1zd6WNFOERT1lbFN6An1h3Bgowq53S5VsB61val1HKE8p0VpT9M4c1seMl\n yUz12RhYmOihhGdyo2tGCXiapiI/hATsVsDek=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1687969884; x=1690561884;\n h=mime-version:references:in-reply-to:message-id:date:subject:cc:to\n :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=zpk6PbxTnKoCwKCfRg2ndUmWiu2heZ8AURUD1Fkcnw0=;\n b=E9FoB5wkbaXvkgxJeMlhXInZ1tUFCgVzu0LDb0AmvJqWZyDuHgaiFF1ri8Tp+M/r2P\n OA5+1zvU3c4nIpALeXJeYNJ/aybn2saoYngRpaHF7ODUuxnUDES1Cg/Ap519PZImjGnG\n b2zPQK8MmuDJmUKjjhTehGgIBOczeciomGoXJVHHrmPHfeyY7W6YRKqhC98Id1hzG73c\n 9a8+ZzYtdG1py8cxy9wktydCXusQnVDgf6/IBgbP7nuIJ1uKmBTexk7N4KIQ4noyO2qe\n 1ZVzKsc6AOr6J58F9Q/AZKdX+zfNuQL40Z/t29nq2CrgZu8JlEaVoaKkb0sdBoNmPjvl\n vlLA==",
        "X-Gm-Message-State": "AC+VfDwaJ0CMTLm44ujp8bJ+H6ITcatgmxUAX6eZFPihN0rrgEhTfkY7\n MULCebJNMIdH3DzCc+YCuu6Q4PjLXf1QpaeX01CUDkkJwQQXxz2jqlOaDVTnN2eOO+Yb/kLWPeV\n Pt1SLq6rIvmSXguqs1ABBImTvl3P1OHK/BIKyYqQTiBznXNQteh17qw95i+KkfMlcO/1JEHA=",
        "X-Google-Smtp-Source": "\n ACHHUZ4NYOCXP/xTKr+Sv2zS0CUOg46D0DTyDedVMGpxq373Oz6rJfY3k1+hmGqsZk+d7iuh7pXSfA==",
        "X-Received": "by 2002:a17:903:503:b0:1b7:f543:cea2 with SMTP id\n jn3-20020a170903050300b001b7f543cea2mr8226685plb.1.1687969883637;\n Wed, 28 Jun 2023 09:31:23 -0700 (PDT)",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com, thomas@monjalon.net,\n Somnath Kotur <somnath.kotur@broadcom.com>,\n Randy Schacher <stuart.schacher@broadcom.com>,\n Kalesh AP <kalesh-anakkur.purayil@broadcom.com>",
        "Subject": "[PATCH v4 08/11] net/bnxt: update PTP support on Thor",
        "Date": "Wed, 28 Jun 2023 09:29:24 -0700",
        "Message-Id": "<20230628162927.92858-9-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.39.2 (Apple Git-143)",
        "In-Reply-To": "<20230628162927.92858-1-ajit.khaparde@broadcom.com>",
        "References": "<1826961.atdPhlSkOF@thomas>\n <20230628162927.92858-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Type": "multipart/signed; protocol=\"application/pkcs7-signature\";\n micalg=sha-256; boundary=\"00000000000056cc9f05ff331dfc\"",
        "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>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "From: Somnath Kotur <somnath.kotur@broadcom.com>\n\nadd locking and time stamp checks to ptp feature\n\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\nSigned-off-by: Randy Schacher <stuart.schacher@broadcom.com>\nReviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt.h        |  5 ++++\n drivers/net/bnxt/bnxt_ethdev.c | 11 +++++++++\n drivers/net/bnxt/bnxt_hwrm.c   | 11 ++++++++-\n drivers/net/bnxt/bnxt_ring.c   |  3 +++\n drivers/net/bnxt/bnxt_rxr.c    |  8 ++++--\n drivers/net/bnxt/bnxt_txq.c    |  1 +\n drivers/net/bnxt/bnxt_txr.c    | 45 +++++++++++++++++++++++++++++++---\n drivers/net/bnxt/bnxt_txr.h    |  1 +\n 8 files changed, 79 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h\nindex 7d508c7c23..dadd0bd95a 100644\n--- a/drivers/net/bnxt/bnxt.h\n+++ b/drivers/net/bnxt/bnxt.h\n@@ -349,6 +349,7 @@ struct bnxt_ptp_cfg {\n \t\t\t\t\t BNXT_PTP_MSG_PDELAY_RESP)\n \tuint8_t\t\t\ttx_tstamp_en:1;\n \tint\t\t\trx_filter;\n+\tuint8_t\t\t\tfilter_all;\n \n #define BNXT_PTP_RX_TS_L\t0\n #define BNXT_PTP_RX_TS_H\t1\n@@ -372,6 +373,8 @@ struct bnxt_ptp_cfg {\n \t/* On P5, the Rx timestamp is present in the Rx completion record */\n \tuint64_t\t\t\trx_timestamp;\n \tuint64_t\t\t\tcurrent_time;\n+\tuint64_t\t\t\told_time;\n+\trte_spinlock_t\t\t\tptp_lock;\n };\n \n struct bnxt_coal {\n@@ -722,6 +725,7 @@ struct bnxt {\n #define BNXT_FW_CAP_LINK_ADMIN\t\tBIT(7)\n #define BNXT_FW_CAP_TRUFLOW_EN\t\tBIT(8)\n #define BNXT_FW_CAP_VLAN_TX_INSERT\tBIT(9)\n+#define BNXT_FW_CAP_RX_ALL_PKT_TS\tBIT(10)\n #define BNXT_TRUFLOW_EN(bp)\t((bp)->fw_cap & BNXT_FW_CAP_TRUFLOW_EN &&\\\n \t\t\t\t (bp)->app_id != 0xFF)\n \n@@ -849,6 +853,7 @@ struct bnxt {\n \tstruct bnxt_led_info\t*leds;\n \tuint8_t\t\t\tieee_1588;\n \tstruct bnxt_ptp_cfg     *ptp_cfg;\n+\tuint8_t\t\t\tptp_all_rx_tstamp;\n \tuint16_t\t\tvf_resv_strategy;\n \tstruct bnxt_ctx_mem_info        *ctx;\n \ndiff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c\nindex 7bceb0524a..ea817e1fdd 100644\n--- a/drivers/net/bnxt/bnxt_ethdev.c\n+++ b/drivers/net/bnxt/bnxt_ethdev.c\n@@ -1441,8 +1441,11 @@ static void bnxt_ptp_get_current_time(void *arg)\n \tif (!ptp)\n \t\treturn;\n \n+\trte_spinlock_lock(&ptp->ptp_lock);\n+\tptp->old_time = ptp->current_time;\n \tbnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_CURRENT_TIME,\n \t\t\t\t&ptp->current_time);\n+\trte_spinlock_unlock(&ptp->ptp_lock);\n \trc = rte_eal_alarm_set(US_PER_S, bnxt_ptp_get_current_time, (void *)bp);\n \tif (rc != 0) {\n \t\tPMD_DRV_LOG(ERR, \"Failed to re-schedule PTP alarm\\n\");\n@@ -1458,8 +1461,11 @@ static int bnxt_schedule_ptp_alarm(struct bnxt *bp)\n \tif (bp->flags2 & BNXT_FLAGS2_PTP_ALARM_SCHEDULED)\n \t\treturn 0;\n \n+\trte_spinlock_lock(&ptp->ptp_lock);\n \tbnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_CURRENT_TIME,\n \t\t\t\t&ptp->current_time);\n+\tptp->old_time = ptp->current_time;\n+\trte_spinlock_unlock(&ptp->ptp_lock);\n \n \n \trc = rte_eal_alarm_set(US_PER_S, bnxt_ptp_get_current_time, (void *)bp);\n@@ -3611,12 +3617,15 @@ bnxt_timesync_enable(struct rte_eth_dev *dev)\n \n \tptp->rx_filter = 1;\n \tptp->tx_tstamp_en = 1;\n+\tptp->filter_all = 1;\n \tptp->rxctl = BNXT_PTP_MSG_EVENTS;\n \n \trc = bnxt_hwrm_ptp_cfg(bp);\n \tif (rc)\n \t\treturn rc;\n \n+\trte_spinlock_init(&ptp->ptp_lock);\n+\tbp->ptp_all_rx_tstamp = 1;\n \tmemset(&ptp->tc, 0, sizeof(struct rte_timecounter));\n \tmemset(&ptp->rx_tstamp_tc, 0, sizeof(struct rte_timecounter));\n \tmemset(&ptp->tx_tstamp_tc, 0, sizeof(struct rte_timecounter));\n@@ -3653,9 +3662,11 @@ bnxt_timesync_disable(struct rte_eth_dev *dev)\n \tptp->rx_filter = 0;\n \tptp->tx_tstamp_en = 0;\n \tptp->rxctl = 0;\n+\tptp->filter_all = 0;\n \n \tbnxt_hwrm_ptp_cfg(bp);\n \n+\tbp->ptp_all_rx_tstamp = 0;\n \tif (!BNXT_CHIP_P5(bp))\n \t\tbnxt_unmap_ptp_regs(bp);\n \telse\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex 77588bdf49..82679d1b32 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -669,6 +669,11 @@ int bnxt_hwrm_ptp_cfg(struct bnxt *bp)\n \t\tflags |=\n \t\t\tHWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE;\n \n+\tif (ptp->filter_all)\n+\t\tflags |=  HWRM_PORT_MAC_CFG_INPUT_FLAGS_ALL_RX_TS_CAPTURE_ENABLE;\n+\telse if (bp->fw_cap & BNXT_FW_CAP_RX_ALL_PKT_TS)\n+\t\tflags |= HWRM_PORT_MAC_CFG_INPUT_FLAGS_ALL_RX_TS_CAPTURE_DISABLE;\n+\n \treq.flags = rte_cpu_to_le_32(flags);\n \treq.enables = rte_cpu_to_le_32\n \t\t(HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE);\n@@ -810,7 +815,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)\n \tstruct hwrm_func_qcaps_input req = {.req_type = 0 };\n \tstruct hwrm_func_qcaps_output *resp = bp->hwrm_cmd_resp_addr;\n \tuint16_t new_max_vfs;\n-\tuint32_t flags;\n+\tuint32_t flags, flags_ext2;\n \n \tHWRM_PREP(&req, HWRM_FUNC_QCAPS, BNXT_USE_CHIMP_MB);\n \n@@ -898,6 +903,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)\n \t\tPMD_DRV_LOG(DEBUG, \"Tunnel parsing capability is disabled, flags : %#x\\n\",\n \t\t\t    bp->tunnel_disable_flag);\n \n+\tflags_ext2 = rte_le_to_cpu_32(resp->flags_ext2);\n+\tif (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED)\n+\t\tbp->fw_cap |= BNXT_FW_CAP_RX_ALL_PKT_TS;\n+\n unlock:\n \tHWRM_UNLOCK();\n \ndiff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c\nindex 686c3af4da..34b2510d54 100644\n--- a/drivers/net/bnxt/bnxt_ring.c\n+++ b/drivers/net/bnxt/bnxt_ring.c\n@@ -227,6 +227,9 @@ int bnxt_alloc_rings(struct bnxt *bp, unsigned int socket_id, uint16_t qidx,\n \t\ttx_ring->bd_dma = mz_phys_addr + tx_ring_start;\n \t\ttx_ring_info->tx_desc_mapping = tx_ring->bd_dma;\n \t\ttx_ring->mem_zone = (const void *)mz;\n+\t\ttx_ring_info->nr_bds = rte_zmalloc(\"bnxt_nr_bds\",\n+\t\t\t\t\t\t   sizeof(unsigned short) *\n+\t\t\t\t\t\t   tx_ring->ring_size, 0);\n \n \t\tif (!tx_ring->bd)\n \t\t\treturn -ENOMEM;\ndiff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c\nindex 1ab0ef2f5d..0cabfb583c 100644\n--- a/drivers/net/bnxt/bnxt_rxr.c\n+++ b/drivers/net/bnxt/bnxt_rxr.c\n@@ -697,7 +697,7 @@ bnxt_get_rx_ts_p5(struct bnxt *bp, uint32_t rx_ts_cmpl)\n \tif (!BNXT_CHIP_P5(bp) || !ptp)\n \t\treturn;\n \n-\t/* On Thor, Rx timestamps are provided directly in the\n+\t/* On P5, Rx timestamps are provided directly in the\n \t * Rx completion records to the driver. Only 32 bits of\n \t * the timestamp is present in the completion. Driver needs\n \t * to read the current 48 bit free running timer using the\n@@ -705,6 +705,9 @@ bnxt_get_rx_ts_p5(struct bnxt *bp, uint32_t rx_ts_cmpl)\n \t * from the HWRM response with the lower 32 bits in the\n \t * Rx completion to produce the 48 bit timestamp for the Rx packet\n \t */\n+\trte_spinlock_lock(&ptp->ptp_lock);\n+\tlast_hwrm_time = ptp->old_time;\n+\trte_spinlock_unlock(&ptp->ptp_lock);\n \tpkt_time = (last_hwrm_time & BNXT_PTP_CURRENT_TIME_MASK) | rx_ts_cmpl;\n \tif (rx_ts_cmpl < (uint32_t)last_hwrm_time) {\n \t\t/* timer has rolled over */\n@@ -922,7 +925,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,\n \n \tif (unlikely((rte_le_to_cpu_16(rxcmp->flags_type) &\n \t\t      RX_PKT_CMPL_FLAGS_MASK) ==\n-\t\t      RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP))\n+\t\t      RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP) ||\n+\t\t      bp->ptp_all_rx_tstamp)\n \t\tbnxt_get_rx_ts_p5(rxq->bp, rxcmp1->reorder);\n \n \tif (cmp_type == CMPL_BASE_TYPE_RX_L2_V2) {\ndiff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c\nindex d1d1fe8f1f..4df4604975 100644\n--- a/drivers/net/bnxt/bnxt_txq.c\n+++ b/drivers/net/bnxt/bnxt_txq.c\n@@ -96,6 +96,7 @@ void bnxt_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)\n \t\tif (txq->tx_ring) {\n \t\t\tbnxt_free_ring(txq->tx_ring->tx_ring_struct);\n \t\t\trte_free(txq->tx_ring->tx_ring_struct);\n+\t\t\trte_free(txq->tx_ring->nr_bds);\n \t\t\trte_free(txq->tx_ring);\n \t\t}\n \ndiff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c\nindex 10b716a00b..6a11f5c8dc 100644\n--- a/drivers/net/bnxt/bnxt_txr.c\n+++ b/drivers/net/bnxt/bnxt_txr.c\n@@ -143,6 +143,41 @@ bnxt_zero_data_len_tso_segsz(struct rte_mbuf *tx_pkt, uint8_t data_len_chk)\n \treturn false;\n }\n \n+static bool\n+bnxt_check_pkt_needs_ts(struct rte_mbuf *m)\n+{\n+\tconst struct rte_ether_hdr *eth_hdr;\n+\tstruct rte_ether_hdr _eth_hdr;\n+\tuint16_t eth_type, proto;\n+\tuint32_t off = 0;\n+\n+\teth_hdr = rte_pktmbuf_read(m, off, sizeof(_eth_hdr), &_eth_hdr);\n+\teth_type = rte_be_to_cpu_16(eth_hdr->ether_type);\n+\toff += sizeof(*eth_hdr);\n+\t/* Check for single tagged and double tagged VLANs */\n+\tif (eth_type == RTE_ETHER_TYPE_VLAN) {\n+\t\tconst struct rte_vlan_hdr *vh;\n+\t\tstruct rte_vlan_hdr vh_copy;\n+\n+\t\tvh = rte_pktmbuf_read(m, off, sizeof(*vh), &vh_copy);\n+\t\tif (unlikely(vh == NULL))\n+\t\t\treturn false;\n+\t\toff += sizeof(*vh);\n+\t\tproto = rte_be_to_cpu_16(vh->eth_proto);\n+\t\tif (proto == RTE_ETHER_TYPE_VLAN) {\n+\t\t\tconst struct rte_vlan_hdr *vh;\n+\t\t\tstruct rte_vlan_hdr vh_copy;\n+\n+\t\t\tvh = rte_pktmbuf_read(m, off, sizeof(*vh), &vh_copy);\n+\t\t\tif (unlikely(vh == NULL))\n+\t\t\t\treturn false;\n+\t\t\toff += sizeof(*vh);\n+\t\t\tproto = rte_be_to_cpu_16(vh->eth_proto);\n+\t\t}\n+\t}\n+\treturn false;\n+}\n+\n static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,\n \t\t\t\tstruct bnxt_tx_queue *txq,\n \t\t\t\tuint16_t *coal_pkts,\n@@ -157,6 +192,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,\n \tbool long_bd = false;\n \tunsigned short nr_bds;\n \tuint16_t prod;\n+\tbool pkt_needs_ts = 0;\n \tstruct rte_mbuf *m_seg;\n \tstruct rte_mbuf **tx_buf;\n \tstatic const uint32_t lhint_arr[4] = {\n@@ -202,9 +238,13 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,\n \tif (unlikely(bnxt_zero_data_len_tso_segsz(tx_pkt, 1)))\n \t\treturn -EIO;\n \n+\tif (unlikely(txq->bp->ptp_cfg != NULL && txq->bp->ptp_all_rx_tstamp == 1))\n+\t\tpkt_needs_ts = bnxt_check_pkt_needs_ts(tx_pkt);\n+\n \tprod = RING_IDX(ring, txr->tx_raw_prod);\n \ttx_buf = &txr->tx_buf_ring[prod];\n \t*tx_buf = tx_pkt;\n+\ttxr->nr_bds[prod] = nr_bds;\n \n \ttxbd = &txr->tx_desc_ring[prod];\n \ttxbd->opaque = *coal_pkts;\n@@ -341,7 +381,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,\n \t\t\t/* IP CSO */\n \t\t\ttxbd1->lflags |= TX_BD_LONG_LFLAGS_T_IP_CHKSUM;\n \t\t} else if ((tx_pkt->ol_flags & RTE_MBUF_F_TX_IEEE1588_TMST) ==\n-\t\t\t   RTE_MBUF_F_TX_IEEE1588_TMST) {\n+\t\t\t   RTE_MBUF_F_TX_IEEE1588_TMST || pkt_needs_ts) {\n \t\t\t/* PTP */\n \t\t\ttxbd1->lflags |= TX_BD_LONG_LFLAGS_STAMP;\n \t\t}\n@@ -427,8 +467,7 @@ static void bnxt_tx_cmp(struct bnxt_tx_queue *txq, int nr_pkts)\n \t\tunsigned short nr_bds;\n \n \t\ttx_buf = &txr->tx_buf_ring[RING_IDX(ring, raw_cons)];\n-\t\tnr_bds = (*tx_buf)->nb_segs +\n-\t\t\t bnxt_xmit_need_long_bd(*tx_buf, txq);\n+\t\tnr_bds = txr->nr_bds[RING_IDX(ring, raw_cons)];\n \t\tfor (j = 0; j < nr_bds; j++) {\n \t\t\tmbuf = *tx_buf;\n \t\t\t*tx_buf = NULL;\ndiff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h\nindex b9b8a9b1a2..8e391ee58a 100644\n--- a/drivers/net/bnxt/bnxt_txr.h\n+++ b/drivers/net/bnxt/bnxt_txr.h\n@@ -24,6 +24,7 @@ struct bnxt_tx_ring_info {\n \n \trte_iova_t\t\ttx_desc_mapping;\n \n+\tunsigned short          *nr_bds;\n \tstruct bnxt_ring\t*tx_ring_struct;\n };\n \n",
    "prefixes": [
        "v4",
        "08/11"
    ]
}