Show a patch.

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

{
    "id": 74676,
    "url": "https://patches.dpdk.org/api/patches/74676/",
    "web_url": "https://patches.dpdk.org/patch/74676/",
    "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": "<20200723115639.22357-15-somnath.kotur@broadcom.com>",
    "date": "2020-07-23T11:56:33",
    "name": "[v2,14/20] net/bnxt: fix port default rule create and destroy",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f2aaf929732f069131024a2b2007215d607afeb6",
    "submitter": {
        "id": 908,
        "url": "https://patches.dpdk.org/api/people/908/",
        "name": "Somnath Kotur",
        "email": "somnath.kotur@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/74676/mbox/",
    "series": [
        {
            "id": 11254,
            "url": "https://patches.dpdk.org/api/series/11254/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11254",
            "date": "2020-07-23T11:56:19",
            "name": "bnxt patches",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/11254/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74676/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74676/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-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": "<20200723111329.21855-1-somnath.kotur@broadcom.com>\n <20200723115639.22357-1-somnath.kotur@broadcom.com>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com B71F929ADBE",
        "Subject": "[dpdk-dev] [PATCH v2 14/20] 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 E2F9EA0521;\n\tThu, 23 Jul 2020 14:04:54 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BE9351C0D6;\n\tThu, 23 Jul 2020 14:02:39 +0200 (CEST)",
            "from relay.smtp.broadcom.com (relay.smtp.broadcom.com\n [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 309F01BFE9\n for <dev@dpdk.org>; Thu, 23 Jul 2020 14:02:06 +0200 (CEST)",
            "from dhcp-10-123-153-55.dhcp.broadcom.net\n (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55])\n by relay.smtp.broadcom.com (Postfix) with ESMTP id B71F929ADBE;\n Thu, 23 Jul 2020 05:02:05 -0700 (PDT)"
        ],
        "To": "dev@dpdk.org",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1595505725;\n bh=qnOfKKYid328Bf4RZpknf96zjT5kM5QAnhomydeCP6o=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=MwGCSpNOAWPu+jWYzdgTO8wjgiStSN1sMUxHknXH9LVrZCjA6sZXUZPYs5W/cxF37\n dzPOshTjZ6UM/5dpy3CNi55yf6HlhRQAXdyaiiMOTWqavXh/SNHfS1tHtN9hu+Ix+r\n IZM9X3GOBvuL2BR79+sdkqHH/d5mcKLWUIgx1Ccs=",
        "Date": "Thu, 23 Jul 2020 17:26:33 +0530",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "In-Reply-To": "<20200723115639.22357-1-somnath.kotur@broadcom.com>",
        "Cc": "ferruh.yigit@intel.com",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200723115639.22357-15-somnath.kotur@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 50f93ff..41e7ae5 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 0829493..dfc4b41 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 a1ab3f3..83a9853 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 c741c71..1113aca 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 7c65a4b..2febd58 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 7c95ead..d532452 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 ddc6da8..9fb1a02 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 a3cfe54..7144517 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 1fc0601..117e250 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": [
        "v2",
        "14/20"
    ]
}