get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 95037,
    "url": "https://patches.dpdk.org/api/patches/95037/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210630065344.50352-7-ting.xu@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210630065344.50352-7-ting.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210630065344.50352-7-ting.xu@intel.com",
    "date": "2021-06-30T06:53:43",
    "name": "[v4,6/7] net/iavf: check Tx packet with correct UP and queue",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d9395d9bfa533a8f2f895d9dae1736ed5d88bb6b",
    "submitter": {
        "id": 1363,
        "url": "https://patches.dpdk.org/api/people/1363/?format=api",
        "name": "Xu, Ting",
        "email": "ting.xu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210630065344.50352-7-ting.xu@intel.com/mbox/",
    "series": [
        {
            "id": 17540,
            "url": "https://patches.dpdk.org/api/series/17540/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17540",
            "date": "2021-06-30T06:53:37",
            "name": "Enable ETS-based Tx QoS for VF in DCF",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/17540/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/95037/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/95037/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 07429A0A0F;\n\tWed, 30 Jun 2021 08:51:19 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DA1D941250;\n\tWed, 30 Jun 2021 08:50:59 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id A91C040141\n for <dev@dpdk.org>; Wed, 30 Jun 2021 08:50:54 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 29 Jun 2021 23:50:54 -0700",
            "from dpdk-xuting-second.sh.intel.com ([10.67.116.193])\n by orsmga005.jf.intel.com with ESMTP; 29 Jun 2021 23:50:51 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10030\"; a=\"208247082\"",
            "E=Sophos;i=\"5.83,311,1616482800\"; d=\"scan'208\";a=\"208247082\"",
            "E=Sophos;i=\"5.83,311,1616482800\"; d=\"scan'208\";a=\"625911259\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ting Xu <ting.xu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com,\n qiming.yang@intel.com, Ting Xu <ting.xu@intel.com>",
        "Date": "Wed, 30 Jun 2021 14:53:43 +0800",
        "Message-Id": "<20210630065344.50352-7-ting.xu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210630065344.50352-1-ting.xu@intel.com>",
        "References": "<20210601014034.36100-1-ting.xu@intel.com>\n <20210630065344.50352-1-ting.xu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 6/7] net/iavf: check Tx packet with correct UP\n and queue",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add check in the Tx packet preparation function, to guarantee that the\npacket with specific user priority is distributed to the correct Tx\nqueue according to the configured Tx queue TC mapping.\n\nSigned-off-by: Ting Xu <ting.xu@intel.com>\n---\n drivers/net/iavf/iavf.h      | 10 +++++++++\n drivers/net/iavf/iavf_rxtx.c | 43 ++++++++++++++++++++++++++++++++++++\n drivers/net/iavf/iavf_tm.c   | 13 +++++++++++\n 3 files changed, 66 insertions(+)",
    "diff": "diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h\nindex feb8337b55..b3bd078111 100644\n--- a/drivers/net/iavf/iavf.h\n+++ b/drivers/net/iavf/iavf.h\n@@ -86,6 +86,8 @@\n \n #define IAVF_BITS_PER_BYTE 8\n \n+#define IAVF_VLAN_TAG_PCP_OFFSET 13\n+\n struct iavf_adapter;\n struct iavf_rx_queue;\n struct iavf_tx_queue;\n@@ -165,6 +167,13 @@ struct iavf_tm_conf {\n \tbool committed;\n };\n \n+/* Struct to store queue TC mapping. Queue is continuous in one TC */\n+struct iavf_qtc_map {\n+\tuint8_t\ttc;\n+\tuint16_t start_queue_id;\n+\tuint16_t queue_count;\n+};\n+\n /* Structure to store private data specific for VF instance. */\n struct iavf_info {\n \tuint16_t num_queue_pairs;\n@@ -213,6 +222,7 @@ struct iavf_info {\n \tbool lv_enabled;\n \n \tstruct virtchnl_qos_cap_list *qos_cap;\n+\tstruct iavf_qtc_map *qtc_map;\n \tstruct iavf_tm_conf tm_conf;\n };\n \ndiff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c\nindex 0361af0d85..eb6d83a165 100644\n--- a/drivers/net/iavf/iavf_rxtx.c\n+++ b/drivers/net/iavf/iavf_rxtx.c\n@@ -2342,14 +2342,49 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n \treturn nb_tx;\n }\n \n+/* Check if the packet with vlan user priority is transmitted in the\n+ * correct queue.\n+ */\n+static int\n+iavf_check_vlan_up2tc(struct iavf_tx_queue *txq, uint8_t tc, struct rte_mbuf *m)\n+{\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[txq->port_id];\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n+\tuint16_t up;\n+\n+\tup = m->vlan_tci >> IAVF_VLAN_TAG_PCP_OFFSET;\n+\n+\tif (!(vf->qos_cap->cap[tc].tc_prio & BIT(up))) {\n+\t\tPMD_TX_LOG(ERR, \"packet with vlan pcp %u cannot transmit in queue %u\\n\",\n+\t\t\tup, txq->queue_id);\n+\t\treturn -1;\n+\t} else {\n+\t\treturn 0;\n+\t}\n+}\n+\n /* TX prep functions */\n uint16_t\n iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n \t      uint16_t nb_pkts)\n {\n \tint i, ret;\n+\tuint8_t tc = 0;\n \tuint64_t ol_flags;\n \tstruct rte_mbuf *m;\n+\tstruct iavf_tx_queue *txq = tx_queue;\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[txq->port_id];\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n+\n+\tif (vf->tm_conf.committed) {\n+\t\tfor (i = 0; i < vf->qos_cap->num_elem; i++) {\n+\t\t\tif (txq->queue_id >= vf->qtc_map[i].start_queue_id &&\n+\t\t\t\ttxq->queue_id < (vf->qtc_map[i].start_queue_id +\n+\t\t\t\tvf->qtc_map[i].queue_count))\n+\t\t\t\tbreak;\n+\t\t}\n+\t\ttc = i;\n+\t}\n \n \tfor (i = 0; i < nb_pkts; i++) {\n \t\tm = tx_pkts[i];\n@@ -2385,6 +2420,14 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t\trte_errno = -ret;\n \t\t\treturn i;\n \t\t}\n+\n+\t\tif (ol_flags & (PKT_RX_VLAN_STRIPPED | PKT_RX_VLAN)) {\n+\t\t\tret = iavf_check_vlan_up2tc(txq, tc, m);\n+\t\t\tif (ret != 0) {\n+\t\t\t\trte_errno = -ret;\n+\t\t\t\treturn i;\n+\t\t\t}\n+\t\t}\n \t}\n \n \treturn i;\ndiff --git a/drivers/net/iavf/iavf_tm.c b/drivers/net/iavf/iavf_tm.c\nindex a8fc142c89..185b37b970 100644\n--- a/drivers/net/iavf/iavf_tm.c\n+++ b/drivers/net/iavf/iavf_tm.c\n@@ -653,6 +653,7 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev,\n \tstruct virtchnl_queue_tc_mapping *q_tc_mapping;\n \tstruct iavf_tm_node_list *queue_list = &vf->tm_conf.queue_list;\n \tstruct iavf_tm_node *tm_node;\n+\tstruct iavf_qtc_map *qtc_map;\n \tuint16_t size;\n \tint index = 0, node_committed = 0;\n \tint i, ret_val = IAVF_SUCCESS;\n@@ -675,6 +676,7 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev,\n \tq_tc_mapping->vsi_id = vf->vsi.vsi_id;\n \tq_tc_mapping->num_tc = vf->qos_cap->num_elem;\n \tq_tc_mapping->num_queue_pairs = vf->num_queue_pairs;\n+\n \tTAILQ_FOREACH(tm_node, queue_list, node) {\n \t\tif (tm_node->tc >= q_tc_mapping->num_tc) {\n \t\t\tPMD_DRV_LOG(ERR, \"TC%d is not enabled\", tm_node->tc);\n@@ -692,15 +694,26 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev,\n \t\tgoto fail_clear;\n \t}\n \n+\t/* store the queue TC mapping info */\n+\tqtc_map = rte_zmalloc(\"qtc_map\",\n+\t\tsizeof(struct iavf_qtc_map) * q_tc_mapping->num_tc, 0);\n+\tif (!qtc_map)\n+\t\treturn IAVF_ERR_NO_MEMORY;\n+\n \tfor (i = 0; i < q_tc_mapping->num_tc; i++) {\n \t\tq_tc_mapping->tc[i].req.start_queue_id = index;\n \t\tindex += q_tc_mapping->tc[i].req.queue_count;\n+\t\tqtc_map[i].tc = i;\n+\t\tqtc_map[i].start_queue_id =\n+\t\t\tq_tc_mapping->tc[i].req.start_queue_id;\n+\t\tqtc_map[i].queue_count = q_tc_mapping->tc[i].req.queue_count;\n \t}\n \n \tret_val = iavf_set_q_tc_map(dev, q_tc_mapping, size);\n \tif (ret_val)\n \t\tgoto fail_clear;\n \n+\tvf->qtc_map = qtc_map;\n \tvf->tm_conf.committed = true;\n \treturn ret_val;\n \n",
    "prefixes": [
        "v4",
        "6/7"
    ]
}