Show a patch.

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

{
    "id": 74724,
    "url": "https://patches.dpdk.org/api/patches/74724/",
    "web_url": "https://patches.dpdk.org/patch/74724/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200724053235.71069-15-ajit.khaparde@broadcom.com>",
    "date": "2020-07-24T05:32:27",
    "name": "[v3,14/22] net/bnxt: fix port default rule create and destroy",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f2aaf929732f069131024a2b2007215d607afeb6",
    "submitter": {
        "id": 501,
        "url": "https://patches.dpdk.org/api/people/501/",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "https://patches.dpdk.org/api/users/1766/",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74724/mbox/",
    "series": [
        {
            "id": 11269,
            "url": "https://patches.dpdk.org/api/series/11269/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11269",
            "date": "2020-07-24T05:32:13",
            "name": "bnxt patches",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/11269/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74724/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74724/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Gm-Message-State": "AOAM530AsmA9jgzeLNZtQvuqLX2OuhXtoMg7S3OkyxiXA5fNMScFb5S2\n Vm5ue5mbbibUsYIkIWZKcGNI6MK4d0ou7St8z0s3gCnayoM4K1Lqc2Vk9a3Kfv2o194FZBY574Z\n 70vdcBcZ16Jxyf6XQWsDFCIXLuBkd7BwmeitAyA9SKUf1hJGB4r0Gzd878EjH8iOHUEiAMVBzcR\n 36gg==",
        "X-Google-Smtp-Source": "\n ABdhPJxyzd8AwbA79Z5wWK6g3CO/Dhod5LKTB+pYnuAklA+V4geg8AG78hTVi5f9SitSM+bakG4P2JcT1vkI",
        "List-Post": "<mailto:dev@dpdk.org>",
        "MIME-Version": "1.0",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200723115639.22357-1-somnath.kotur@broadcom.com>\n <20200724053235.71069-1-ajit.khaparde@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH v3 14/22] net/bnxt: fix port default rule create\n\tand destroy",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B11AAA0518;\n\tFri, 24 Jul 2020 07:35:28 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2AC641C122;\n\tFri, 24 Jul 2020 07:33:49 +0200 (CEST)",
            "from mail-vs1-f97.google.com (mail-vs1-f97.google.com\n [209.85.217.97]) by dpdk.org (Postfix) with ESMTP id 323721BFE7\n for <dev@dpdk.org>; Fri, 24 Jul 2020 07:33:39 +0200 (CEST)",
            "by mail-vs1-f97.google.com with SMTP id s20so4307212vsq.5\n for <dev@dpdk.org>; Thu, 23 Jul 2020 22:33:39 -0700 (PDT)",
            "from localhost.localdomain ([192.19.223.252])\n by smtp-relay.gmail.com with ESMTPS id h17sm592840vsk.0.2020.07.23.22.33.34\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 23 Jul 2020 22:33:38 -0700 (PDT)"
        ],
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "X-Mailer": "git-send-email 2.21.1 (Apple Git-122.3)",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=IZP1dslok6xwiK3reYB9FMKij4Y4XZBoWw3CE7LKtEw=;\n b=dS/jR5lr+RRrgzH8N9GM8TKa1tqbgZPzkKQ+dyNhOv6xmD2tnui3RATlr4djVI9/4f\n h4geeji61CEwRkf2MMqvV79Jq856qlCfMb6pKaXnZ5QJfDc0vHnxTohXEUwzv9wTlW0m\n kKNHVvvS4tCaXr5j04DMznnQ/TihIW+uWSdNeyxUL/x66ulqjx9Ptpn3ZuECduUuQSCa\n nP3fOQFAB3ShosBlFpOyJKCvU7WaoiCxYNn6DnjXzqZaf/ydws/Oboi1xXpYQ+nYXjO+\n 1g7I3qOYocywCdYLBL5Y4KhZDp4llmmWCdE0p0+3ImyML2GzEqux6vqPtVeNZ5Wyzwgc\n 65xA==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com;\n s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=IZP1dslok6xwiK3reYB9FMKij4Y4XZBoWw3CE7LKtEw=;\n b=G28AmGMN1H52hHREbJ7l2hMyJBtZS2vFmDKHTRLyMgJJ6xiCC2AmEGOxbPgg14+TFJ\n ri5s1aDu8tbkgBRAS8GrPLUFFQVOp7C8i62QtDKK/Y8adxPaklto++dz5eGwNW8q9z5N\n ZEDHrHLc5XDkqbV2XHJ8gDhwMKui5qErts4MU=",
        "Date": "Thu, 23 Jul 2020 22:32:27 -0700",
        "Content-Transfer-Encoding": "8bit",
        "X-Received": "by 2002:a67:d599:: with SMTP id m25mr6770276vsj.149.1595568818425;\n Thu, 23 Jul 2020 22:33:38 -0700 (PDT)",
        "To": "dev@dpdk.org",
        "X-Relaying-Domain": "broadcom.com",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "In-Reply-To": "<20200724053235.71069-1-ajit.khaparde@broadcom.com>",
        "Cc": "ferruh.yigit@intel.com, Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>,\n Somnath Kotur <somnath.kotur@broadcom.com>,\n Kishore Padmanabha <kishore.padmanabha@broadcom.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200724053235.71069-15-ajit.khaparde@broadcom.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\n\nCurrently, the flow_ids of port_to_app/app_to_port & tx_cfa_action\nfor the first port are getting over-written by the second port because\nthese fields are stored in the ulp context which is common across the\nports.\n\nThis patch fixes the problem by having per port structure to store these\nfields.\n\nFixes: 9f702636d7ba (\"net/bnxt: add port default rules for ingress and egress\")\n\nSigned-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\nReviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>\nReviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\n---\n drivers/net/bnxt/bnxt.h                 |   5 +-\n drivers/net/bnxt/bnxt_ethdev.c          |  81 +----------------\n drivers/net/bnxt/bnxt_txq.h             |   1 -\n drivers/net/bnxt/bnxt_txr.c             |   6 +-\n drivers/net/bnxt/tf_ulp/bnxt_ulp.c      |  12 ++-\n drivers/net/bnxt/tf_ulp/bnxt_ulp.h      |  14 ++-\n drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 116 ++++++++++++++++++++++++\n drivers/net/bnxt/tf_ulp/ulp_flow_db.c   |   2 +-\n drivers/net/bnxt/tf_ulp/ulp_flow_db.h   |   2 +-\n 9 files changed, 151 insertions(+), 88 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h\nindex 50f93ff5b..41e7ae5bd 100644\n--- a/drivers/net/bnxt/bnxt.h\n+++ b/drivers/net/bnxt/bnxt.h\n@@ -784,6 +784,7 @@ struct bnxt {\n \tstruct bnxt_flow_stat_info *flow_stat;\n \tuint8_t\t\t\tflow_xstat;\n \tuint16_t\t\tmax_num_kflows;\n+\tuint16_t\t\ttx_cfa_action;\n };\n \n #define BNXT_FC_TIMER\t1 /* Timer freq in Sec Flow Counters */\n@@ -797,7 +798,7 @@ struct bnxt_vf_representor {\n \tuint16_t\t\tfw_fid;\n \tuint16_t\t\tdflt_vnic_id;\n \tuint16_t\t\tsvif;\n-\tuint32_t\t\tvfr_tx_cfa_action;\n+\tuint16_t\t\tvfr_tx_cfa_action;\n \tuint16_t\t\trx_cfa_code;\n \tuint32_t\t\trep2vf_flow_id;\n \tuint32_t\t\tvf2rep_flow_id;\n@@ -872,6 +873,8 @@ extern int bnxt_logtype_driver;\n extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;\n int32_t bnxt_ulp_init(struct bnxt *bp);\n void bnxt_ulp_deinit(struct bnxt *bp);\n+int32_t bnxt_ulp_create_df_rules(struct bnxt *bp);\n+void bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global);\n \n uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);\n uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif,\ndiff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c\nindex 0829493ea..dfc4b4190 100644\n--- a/drivers/net/bnxt/bnxt_ethdev.c\n+++ b/drivers/net/bnxt/bnxt_ethdev.c\n@@ -1168,73 +1168,6 @@ static int bnxt_handle_if_change_status(struct bnxt *bp)\n \treturn rc;\n }\n \n-static int32_t\n-bnxt_create_port_app_df_rule(struct bnxt *bp, uint8_t flow_type,\n-\t\t\t     uint32_t *flow_id)\n-{\n-\tuint16_t port_id = bp->eth_dev->data->port_id;\n-\tstruct ulp_tlv_param param_list[] = {\n-\t\t{\n-\t\t\t.type = BNXT_ULP_DF_PARAM_TYPE_DEV_PORT_ID,\n-\t\t\t.length = 2,\n-\t\t\t.value = {(port_id >> 8) & 0xff, port_id & 0xff}\n-\t\t},\n-\t\t{\n-\t\t\t.type = BNXT_ULP_DF_PARAM_TYPE_LAST,\n-\t\t\t.length = 0,\n-\t\t\t.value = {0}\n-\t\t}\n-\t};\n-\n-\treturn ulp_default_flow_create(bp->eth_dev, param_list, flow_type,\n-\t\t\t\t       flow_id);\n-}\n-\n-static int32_t\n-bnxt_create_df_rules(struct bnxt *bp)\n-{\n-\tstruct bnxt_ulp_data *cfg_data;\n-\tint rc;\n-\n-\tcfg_data = bp->ulp_ctx->cfg_data;\n-\trc = bnxt_create_port_app_df_rule(bp, BNXT_ULP_DF_TPL_PORT_TO_VS,\n-\t\t\t\t\t  &cfg_data->port_to_app_flow_id);\n-\tif (rc) {\n-\t\tPMD_DRV_LOG(ERR,\n-\t\t\t    \"Failed to create port to app default rule\\n\");\n-\t\treturn rc;\n-\t}\n-\n-\tBNXT_TF_DBG(DEBUG, \"***** created port to app default rule ******\\n\");\n-\trc = bnxt_create_port_app_df_rule(bp, BNXT_ULP_DF_TPL_VS_TO_PORT,\n-\t\t\t\t\t  &cfg_data->app_to_port_flow_id);\n-\tif (!rc) {\n-\t\trc = ulp_default_flow_db_cfa_action_get(bp->ulp_ctx,\n-\t\t\t\t\t\t\tcfg_data->app_to_port_flow_id,\n-\t\t\t\t\t\t\t&cfg_data->tx_cfa_action);\n-\t\tif (rc)\n-\t\t\tgoto err;\n-\n-\t\tBNXT_TF_DBG(DEBUG,\n-\t\t\t    \"***** created app to port default rule *****\\n\");\n-\t\treturn 0;\n-\t}\n-\n-err:\n-\tBNXT_TF_DBG(DEBUG, \"Failed to create app to port default rule\\n\");\n-\treturn rc;\n-}\n-\n-static void\n-bnxt_destroy_df_rules(struct bnxt *bp)\n-{\n-\tstruct bnxt_ulp_data *cfg_data;\n-\n-\tcfg_data = bp->ulp_ctx->cfg_data;\n-\tulp_default_flow_destroy(bp->eth_dev, cfg_data->port_to_app_flow_id);\n-\tulp_default_flow_destroy(bp->eth_dev, cfg_data->app_to_port_flow_id);\n-}\n-\n static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)\n {\n \tstruct bnxt *bp = eth_dev->data->dev_private;\n@@ -1296,8 +1229,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)\n \tbnxt_schedule_fw_health_check(bp);\n \tpthread_mutex_unlock(&bp->def_cp_lock);\n \n-\tif (BNXT_TRUFLOW_EN(bp))\n-\t\tbnxt_ulp_init(bp);\n+\tbnxt_ulp_init(bp);\n \n \treturn 0;\n \n@@ -1358,6 +1290,9 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)\n \t/* disable uio/vfio intr/eventfd mapping */\n \trte_intr_disable(intr_handle);\n \n+\tbnxt_ulp_destroy_df_rules(bp, false);\n+\tbnxt_ulp_deinit(bp);\n+\n \tbnxt_cancel_fw_health_check(bp);\n \n \tbnxt_dev_set_link_down_op(eth_dev);\n@@ -1403,11 +1338,6 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)\n \trte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp);\n \tbnxt_cancel_fc_thread(bp);\n \n-\tif (BNXT_TRUFLOW_EN(bp)) {\n-\t\tbnxt_destroy_df_rules(bp);\n-\t\tbnxt_ulp_deinit(bp);\n-\t}\n-\n \tif (eth_dev->data->dev_started)\n \t\tbnxt_dev_stop_op(eth_dev);\n \n@@ -1656,8 +1586,7 @@ static int bnxt_promiscuous_disable_op(struct rte_eth_dev *eth_dev)\n \tif (rc != 0)\n \t\tvnic->flags = old_flags;\n \n-\tif (BNXT_TRUFLOW_EN(bp))\n-\t\tbnxt_create_df_rules(bp);\n+\tbnxt_ulp_create_df_rules(bp);\n \n \treturn rc;\n }\ndiff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h\nindex a1ab3f39a..83a98536d 100644\n--- a/drivers/net/bnxt/bnxt_txq.h\n+++ b/drivers/net/bnxt/bnxt_txq.h\n@@ -29,7 +29,6 @@ struct bnxt_tx_queue {\n \tstruct bnxt\t\t*bp;\n \tint\t\t\tindex;\n \tint\t\t\ttx_wake_thresh;\n-\tuint32_t                tx_cfa_action;\n \tuint32_t\t\tvfr_tx_cfa_action;\n \tstruct bnxt_tx_ring_info\t*tx_ring;\n \ndiff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c\nindex c741c7188..1113aca44 100644\n--- a/drivers/net/bnxt/bnxt_txr.c\n+++ b/drivers/net/bnxt/bnxt_txr.c\n@@ -133,8 +133,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,\n \t\t\t\tPKT_TX_TUNNEL_GENEVE | PKT_TX_IEEE1588_TMST |\n \t\t\t\tPKT_TX_QINQ_PKT) ||\n \t     (BNXT_TRUFLOW_EN(txq->bp) &&\n-\t      (txq->bp->ulp_ctx->cfg_data->tx_cfa_action ||\n-\t       txq->vfr_tx_cfa_action)))\n+\t      (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action)))\n \t\tlong_bd = true;\n \n \tnr_bds = long_bd + tx_pkt->nb_segs;\n@@ -192,8 +191,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,\n \t\t\tif (txq->vfr_tx_cfa_action)\n \t\t\t\tcfa_action = txq->vfr_tx_cfa_action;\n \t\t\telse\n-\t\t\t\tcfa_action =\n-\t\t\t\t      txq->bp->ulp_ctx->cfg_data->tx_cfa_action;\n+\t\t\t\tcfa_action = txq->bp->tx_cfa_action;\n \t\t}\n \n \t\t/* HW can accelerate only outer vlan in QinQ mode */\ndiff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\nindex 7c65a4b1b..2febd5814 100644\n--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n@@ -9,9 +9,9 @@\n #include <rte_flow_driver.h>\n #include <rte_tailq.h>\n \n+#include \"bnxt.h\"\n #include \"bnxt_ulp.h\"\n #include \"bnxt_tf_common.h\"\n-#include \"bnxt.h\"\n #include \"tf_core.h\"\n #include \"tf_ext_flow_handle.h\"\n \n@@ -381,6 +381,7 @@ ulp_ctx_init(struct bnxt *bp,\n \t\t(void)ulp_ctx_deinit(bp, session);\n \t\treturn rc;\n \t}\n+\n \tbnxt_ulp_cntxt_tfp_set(bp->ulp_ctx, session->g_tfp);\n \treturn rc;\n }\n@@ -654,6 +655,9 @@ bnxt_ulp_init(struct bnxt *bp)\n \tbool init;\n \tint rc;\n \n+\tif (!BNXT_TRUFLOW_EN(bp))\n+\t\treturn 0;\n+\n \tif (bp->ulp_ctx) {\n \t\tBNXT_TF_DBG(DEBUG, \"ulp ctx already allocated\\n\");\n \t\treturn -EINVAL;\n@@ -822,6 +826,9 @@ bnxt_ulp_deinit(struct bnxt *bp)\n \tstruct rte_pci_device\t\t*pci_dev;\n \tstruct rte_pci_addr\t\t*pci_addr;\n \n+\tif (!BNXT_TRUFLOW_EN(bp))\n+\t\treturn;\n+\n \t/* Get the session first */\n \tpci_dev = RTE_DEV_TO_PCI(bp->eth_dev->device);\n \tpci_addr = &pci_dev->addr;\n@@ -833,6 +840,9 @@ bnxt_ulp_deinit(struct bnxt *bp)\n \tif (!session)\n \t\treturn;\n \n+\t/* clean up default flows */\n+\tbnxt_ulp_destroy_df_rules(bp, true);\n+\n \t/* clean up regular flows */\n \tulp_flow_db_flush_flows(bp->ulp_ctx, BNXT_ULP_REGULAR_FLOW_TABLE);\n \ndiff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h\nindex 7c95ead55..d53245215 100644\n--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h\n+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h\n@@ -22,6 +22,12 @@\n #define BNXT_ULP_VF_REP_ENABLED\t\t0x1\n #define ULP_VF_REP_IS_ENABLED(flag)\t((flag) & BNXT_ULP_VF_REP_ENABLED)\n \n+struct bnxt_ulp_df_rule_info {\n+\tuint32_t\t\t\tport_to_app_flow_id;\n+\tuint32_t\t\t\tapp_to_port_flow_id;\n+\tuint8_t\t\t\t\tvalid;\n+};\n+\n struct bnxt_ulp_data {\n \tuint32_t\t\t\ttbl_scope_id;\n \tstruct bnxt_ulp_mark_tbl\t*mark_tbl;\n@@ -32,9 +38,7 @@ struct bnxt_ulp_data {\n \tstruct bnxt_ulp_port_db\t\t*port_db;\n \tstruct bnxt_ulp_fc_info\t\t*fc_info;\n \tuint32_t\t\t\tulp_flags;\n-\tuint32_t\t\t\tport_to_app_flow_id;\n-\tuint32_t\t\t\tapp_to_port_flow_id;\n-\tuint32_t\t\t\ttx_cfa_action;\n+\tstruct bnxt_ulp_df_rule_info   df_rule_info[RTE_MAX_ETHPORTS];\n };\n \n struct bnxt_ulp_context {\n@@ -175,4 +179,8 @@ int32_t\n bnxt_ulp_cntxt_ptr2_ulp_flags_get(struct bnxt_ulp_context *ulp_ctx,\n \t\t\t\t  uint32_t *flags);\n \n+int32_t\n+bnxt_ulp_get_df_rule_info(uint8_t port_id, struct bnxt_ulp_context *ulp_ctx,\n+\t\t\t  struct bnxt_ulp_df_rule_info *info);\n+\n #endif /* _BNXT_ULP_H_ */\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c\nindex ddc6da8a8..9fb1a028f 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c\n@@ -392,3 +392,119 @@ ulp_default_flow_destroy(struct rte_eth_dev *eth_dev, uint32_t flow_id)\n \n \treturn rc;\n }\n+\n+void\n+bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)\n+{\n+\tstruct bnxt_ulp_df_rule_info *info;\n+\tuint8_t port_id;\n+\n+\tif (!BNXT_TRUFLOW_EN(bp) ||\n+\t    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))\n+\t\treturn;\n+\n+\tif (!bp->ulp_ctx || !bp->ulp_ctx->cfg_data)\n+\t\treturn;\n+\n+\t/* Delete default rules per port */\n+\tif (!global) {\n+\t\tport_id = bp->eth_dev->data->port_id;\n+\t\tinfo = &bp->ulp_ctx->cfg_data->df_rule_info[port_id];\n+\t\tif (!info->valid)\n+\t\t\treturn;\n+\n+\t\tulp_default_flow_destroy(bp->eth_dev,\n+\t\t\t\t\t info->port_to_app_flow_id);\n+\t\tulp_default_flow_destroy(bp->eth_dev,\n+\t\t\t\t\t info->app_to_port_flow_id);\n+\t\tinfo->valid = false;\n+\t\treturn;\n+\t}\n+\n+\t/* Delete default rules for all ports */\n+\tfor (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) {\n+\t\tinfo = &bp->ulp_ctx->cfg_data->df_rule_info[port_id];\n+\t\tif (!info->valid)\n+\t\t\tcontinue;\n+\n+\t\tulp_default_flow_destroy(bp->eth_dev,\n+\t\t\t\t\t info->port_to_app_flow_id);\n+\t\tulp_default_flow_destroy(bp->eth_dev,\n+\t\t\t\t\t info->app_to_port_flow_id);\n+\t\tinfo->valid = false;\n+\t}\n+}\n+\n+static int32_t\n+bnxt_create_port_app_df_rule(struct bnxt *bp, uint8_t flow_type,\n+\t\t\t     uint32_t *flow_id)\n+{\n+\tuint16_t port_id = bp->eth_dev->data->port_id;\n+\tstruct ulp_tlv_param param_list[] = {\n+\t\t{\n+\t\t\t.type = BNXT_ULP_DF_PARAM_TYPE_DEV_PORT_ID,\n+\t\t\t.length = 2,\n+\t\t\t.value = {(port_id >> 8) & 0xff, port_id & 0xff}\n+\t\t},\n+\t\t{\n+\t\t\t.type = BNXT_ULP_DF_PARAM_TYPE_LAST,\n+\t\t\t.length = 0,\n+\t\t\t.value = {0}\n+\t\t}\n+\t};\n+\n+\treturn ulp_default_flow_create(bp->eth_dev, param_list, flow_type,\n+\t\t\t\t       flow_id);\n+}\n+\n+int32_t\n+bnxt_ulp_create_df_rules(struct bnxt *bp)\n+{\n+\tstruct bnxt_ulp_df_rule_info *info;\n+\tuint8_t port_id;\n+\tint rc;\n+\n+\tif (!BNXT_TRUFLOW_EN(bp) ||\n+\t    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))\n+\t\treturn 0;\n+\n+\tport_id = bp->eth_dev->data->port_id;\n+\tinfo = &bp->ulp_ctx->cfg_data->df_rule_info[port_id];\n+\tBNXT_TF_DBG(INFO, \"*** creating port to app default rule ***\\n\");\n+\trc = bnxt_create_port_app_df_rule(bp, BNXT_ULP_DF_TPL_PORT_TO_VS,\n+\t\t\t\t\t  &info->port_to_app_flow_id);\n+\tif (rc) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Failed to create port to app default rule\\n\");\n+\t\treturn rc;\n+\t}\n+\tBNXT_TF_DBG(INFO, \"*** created port to app default rule ***\\n\");\n+\n+\tbp->tx_cfa_action = 0;\n+\tBNXT_TF_DBG(INFO, \"*** creating app to port default rule ***\\n\");\n+\trc = bnxt_create_port_app_df_rule(bp, BNXT_ULP_DF_TPL_VS_TO_PORT,\n+\t\t\t\t\t  &info->app_to_port_flow_id);\n+\tif (rc) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Failed to create app to port default rule\\n\");\n+\t\tgoto port_to_app_free;\n+\t}\n+\n+\trc = ulp_default_flow_db_cfa_action_get(bp->ulp_ctx,\n+\t\t\t\t\t\tinfo->app_to_port_flow_id,\n+\t\t\t\t\t\t&bp->tx_cfa_action);\n+\tif (rc)\n+\t\tgoto app_to_port_free;\n+\n+\tinfo->valid = true;\n+\tBNXT_TF_DBG(INFO, \"*** created app to port default rule ***\\n\");\n+\treturn 0;\n+\n+app_to_port_free:\n+\tulp_default_flow_destroy(bp->eth_dev, info->app_to_port_flow_id);\n+port_to_app_free:\n+\tulp_default_flow_destroy(bp->eth_dev, info->port_to_app_flow_id);\n+\tinfo->valid = false;\n+\n+\treturn rc;\n+}\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c\nindex a3cfe54bf..714451740 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c\n@@ -962,7 +962,7 @@ ulp_flow_db_resource_hndl_get(struct bnxt_ulp_context *ulp_ctx,\n int32_t\n ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,\n \t\t\t\t   uint32_t flow_id,\n-\t\t\t\t   uint32_t *cfa_action)\n+\t\t\t\t   uint16_t *cfa_action)\n {\n \tuint8_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_VFR_CFA_ACTION;\n \tuint64_t hndl;\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_flow_db.h b/drivers/net/bnxt/tf_ulp/ulp_flow_db.h\nindex 1fc06012f..117e250d6 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_flow_db.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_flow_db.h\n@@ -234,7 +234,7 @@ ulp_flow_db_validate_flow_func(struct bnxt_ulp_context *ulp_ctx,\n int32_t\n ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,\n \t\t\t\t   uint32_t flow_id,\n-\t\t\t\t   uint32_t *cfa_action);\n+\t\t\t\t   uint16_t *cfa_action);\n \n #ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG\n /*\n",
    "prefixes": [
        "v3",
        "14/22"
    ]
}