Show a patch.

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

{
    "id": 185,
    "url": "http://patches.dpdk.org/api/patches/185/",
    "web_url": "http://patches.dpdk.org/patch/185/",
    "project": {
        "id": 1,
        "url": "http://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": "<1408505611-6959-2-git-send-email-helin.zhang@intel.com>",
    "date": "2014-08-20T03:33:29",
    "name": "[dpdk-dev,1/3] i40evf: support I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX in DPDK PF host",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "17f4c60dabc1a9a38c1445b25f9b6b15f807540a",
    "submitter": {
        "id": 14,
        "url": "http://patches.dpdk.org/api/people/14/",
        "name": "Helin Zhang",
        "email": "helin.zhang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/185/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/185/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/185/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<hzhan75@shecgisg004.sh.intel.com>",
        "References": "<1408505611-6959-1-git-send-email-helin.zhang@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"4.97,862,1389772800\"; d=\"scan'208\";a=\"374568452\"",
        "From": "Helin Zhang <helin.zhang@intel.com>",
        "X-List-Received-Date": "Wed, 20 Aug 2014 03:30:13 -0000",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1408505611-6959-2-git-send-email-helin.zhang@intel.com>",
        "Received": [
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 317CCB36B\n\tfor <dev@dpdk.org>; Wed, 20 Aug 2014 05:30:12 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP; 19 Aug 2014 20:33:41 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 19 Aug 2014 20:29:54 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id s7K3Xbog014172;\n\tWed, 20 Aug 2014 11:33:37 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid s7K3XYWV007077; Wed, 20 Aug 2014 11:33:36 +0800",
            "(from hzhan75@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s7K3XYqC007073; \n\tWed, 20 Aug 2014 11:33:34 +0800"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Precedence": "list",
        "Date": "Wed, 20 Aug 2014 11:33:29 +0800",
        "Subject": "[dpdk-dev] [PATCH 1/3] i40evf: support\n\tI40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX in DPDK PF host",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "In-Reply-To": "<1408505611-6959-1-git-send-email-helin.zhang@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org"
    },
    "content": "To configure VSI queues for VF, Linux PF host supports\noperation of I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES with\nlimited configurations. To support more configurations\n(e.g configurable CRC stripping in VF), a new operation\nof I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX has been\nsupported in DPDK PF host.\n\nSigned-off-by: Helin Zhang <helin.zhang@intel.com>\nReviewed-by: Jingjing Wu <jingjing.wu@intel.com>\nReviewed-by: Jing Chen <jing.d.chen@intel.com>\n---\n lib/librte_pmd_i40e/i40e_pf.c | 90 ++++++++++++++++++++++++++-----------------\n lib/librte_pmd_i40e/i40e_pf.h |  7 ++++\n 2 files changed, 61 insertions(+), 36 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_i40e/i40e_pf.c b/lib/librte_pmd_i40e/i40e_pf.c\nindex e8b154d..9a03e74 100644\n--- a/lib/librte_pmd_i40e/i40e_pf.c\n+++ b/lib/librte_pmd_i40e/i40e_pf.c\n@@ -327,7 +327,8 @@ send_msg:\n static int\n i40e_pf_host_hmc_config_rxq(struct i40e_hw *hw,\n \t\t\t    struct i40e_pf_vf *vf,\n-\t\t\t    struct i40e_virtchnl_rxq_info *rxq)\n+\t\t\t    struct i40e_virtchnl_rxq_info *rxq,\n+\t\t\t    struct i40e_virtchnl_queue_pair_extra_info *qpei)\n {\n \tint err = I40E_SUCCESS;\n \tstruct i40e_hmc_obj_rxq rx_ctx;\n@@ -356,7 +357,10 @@ i40e_pf_host_hmc_config_rxq(struct i40e_hw *hw,\n \trx_ctx.tphdata_ena = 1;\n \trx_ctx.tphhead_ena = 1;\n \trx_ctx.lrxqthresh = 2;\n-\trx_ctx.crcstrip = 1;\n+\tif (qpei) /* For DPDK PF host */\n+\t\trx_ctx.crcstrip = qpei->crcstrip ? 1 : 0;\n+\telse /* For Linux PF host */\n+\t\trx_ctx.crcstrip = 1;\n \trx_ctx.l2tsel = 1;\n \trx_ctx.prefena = 1;\n \n@@ -411,42 +415,56 @@ i40e_pf_host_hmc_config_txq(struct i40e_hw *hw,\n static int\n i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,\n \t\t\t\t\t   uint8_t *msg,\n-\t\t\t\t\t   uint16_t msglen)\n+\t\t\t\t\t   uint16_t msglen,\n+\t\t\t\t\t   int opcode)\n {\n \tstruct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);\n \tstruct i40e_vsi *vsi = vf->vsi;\n-\tint ret = I40E_SUCCESS;\n-\tstruct i40e_virtchnl_vsi_queue_config_info *qconfig =\n-\t    (struct i40e_virtchnl_vsi_queue_config_info *)msg;\n-\tint i;\n-\tstruct i40e_virtchnl_queue_pair_info *qpair;\n-\n-\tif (msg == NULL || msglen <= sizeof(*qconfig) ||\n-\t\tqconfig->num_queue_pairs > vsi->nb_qps) {\n+\tstruct i40e_virtchnl_vsi_queue_config_info *vc_vqci =\n+\t\t(struct i40e_virtchnl_vsi_queue_config_info *)msg;\n+\tstruct i40e_virtchnl_queue_pair_info *vc_qpi;\n+\tstruct i40e_virtchnl_queue_pair_extra_info *vc_qpei = NULL;\n+\tint i, ret = I40E_SUCCESS;\n+\n+\tif (msg == NULL || msglen <= sizeof(*vc_vqci) ||\n+\t\tvc_vqci->num_queue_pairs > vsi->nb_qps) {\n \t\tPMD_DRV_LOG(ERR, \"vsi_queue_config_info argument wrong\\n\");\n \t\tret = I40E_ERR_PARAM;\n \t\tgoto send_msg;\n \t}\n \n-\tqpair = qconfig->qpair;\n-\tfor (i = 0; i < qconfig->num_queue_pairs; i++) {\n-\t\tif (qpair[i].rxq.queue_id > vsi->nb_qps - 1 ||\n-\t\t\tqpair[i].txq.queue_id > vsi->nb_qps - 1) {\n+\tvc_qpi = vc_vqci->qpair;\n+\tif (opcode == I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX)\n+\t\tvc_qpei = (struct i40e_virtchnl_queue_pair_extra_info *)\n+\t\t\t\t\t\t(((uint8_t *)vc_qpi) +\n+\t\t\t(sizeof(struct i40e_virtchnl_queue_pair_info) *\n+\t\t\t\t\tvc_vqci->num_queue_pairs));\n+\n+\tfor (i = 0; i < vc_vqci->num_queue_pairs; i++) {\n+\t\tif (vc_qpi[i].rxq.queue_id > vsi->nb_qps - 1 ||\n+\t\t\tvc_qpi[i].txq.queue_id > vsi->nb_qps - 1) {\n \t\t\tret = I40E_ERR_PARAM;\n \t\t\tgoto send_msg;\n \t\t}\n \n-\t\t/* Apply VF RX queue setting to HMC */\n-\t\tif (i40e_pf_host_hmc_config_rxq(hw, vf, &qpair[i].rxq)\n-\t\t\t!= I40E_SUCCESS) {\n+\t\t/*\n+\t\t * Apply VF RX queue setting to HMC.\n+\t\t * If the opcode is I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX,\n+\t\t * then the extra information of\n+\t\t * 'struct i40e_virtchnl_queue_pair_extra_info' is needed,\n+\t\t * otherwise set the last parameter to NULL.\n+\t\t */\n+\t\tif (i40e_pf_host_hmc_config_rxq(hw, vf, &vc_qpi[i].rxq,\n+\t\t\t(vc_qpei != NULL ? (&vc_qpei[i]) : NULL)) !=\n+\t\t\t\t\t\t\tI40E_SUCCESS) {\n \t\t\tPMD_DRV_LOG(ERR, \"Configure RX queue HMC failed\");\n \t\t\tret = I40E_ERR_PARAM;\n \t\t\tgoto send_msg;\n \t\t}\n \n \t\t/* Apply VF TX queue setting to HMC */\n-\t\tif (i40e_pf_host_hmc_config_txq(hw, vf, &qpair[i].txq)\n-\t\t\t!= I40E_SUCCESS) {\n+\t\tif (i40e_pf_host_hmc_config_txq(hw, vf,\n+\t\t\t&vc_qpi[i].txq) != I40E_SUCCESS) {\n \t\t\tPMD_DRV_LOG(ERR, \"Configure TX queue HMC failed\");\n \t\t\tret = I40E_ERR_PARAM;\n \t\t\tgoto send_msg;\n@@ -454,8 +472,8 @@ i40e_pf_host_process_cmd_config_vsi_queues(struct i40e_pf_vf *vf,\n \t}\n \n send_msg:\n-\ti40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES,\n-\t\t\t\t\t\t\tret, NULL, 0);\n+\ti40e_pf_host_send_msg_to_vf(vf, opcode, ret, NULL, 0);\n+\n \treturn ret;\n }\n \n@@ -871,8 +889,13 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,\n \t\tbreak;\n \tcase I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES:\n \t\tPMD_DRV_LOG(INFO, \"OP_CONFIG_VSI_QUEUES received\\n\");\n-\t\ti40e_pf_host_process_cmd_config_vsi_queues(vf,\n-\t\t\t\t\t\tmsg, msglen);\n+\t\ti40e_pf_host_process_cmd_config_vsi_queues(vf, msg,\n+\t\t\t\t\t\tmsglen, opcode);\n+\t\tbreak;\n+\tcase I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX:\n+\t\tPMD_DRV_LOG(INFO, \"OP_CONFIG_VSI_QUEUES_EX received\\n\");\n+\t\ti40e_pf_host_process_cmd_config_vsi_queues(vf, msg,\n+\t\t\t\t\t\tmsglen, opcode);\n \t\tbreak;\n \tcase I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP:\n \t\tPMD_DRV_LOG(INFO, \"OP_CONFIG_IRQ_MAP received\\n\");\n@@ -880,23 +903,19 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,\n \t\tbreak;\n \tcase I40E_VIRTCHNL_OP_ENABLE_QUEUES:\n \t\tPMD_DRV_LOG(INFO, \"OP_ENABLE_QUEUES received\\n\");\n-\t\ti40e_pf_host_process_cmd_enable_queues(vf,\n-\t\t\t\t\t\tmsg, msglen);\n+\t\ti40e_pf_host_process_cmd_enable_queues(vf, msg, msglen);\n \t\tbreak;\n \tcase I40E_VIRTCHNL_OP_DISABLE_QUEUES:\n \t\tPMD_DRV_LOG(INFO, \"OP_DISABLE_QUEUE received\\n\");\n-\t\ti40e_pf_host_process_cmd_disable_queues(vf,\n-\t\t\t\t\t\tmsg, msglen);\n+\t\ti40e_pf_host_process_cmd_disable_queues(vf, msg, msglen);\n \t\tbreak;\n \tcase I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS:\n \t\tPMD_DRV_LOG(INFO, \"OP_ADD_ETHER_ADDRESS received\\n\");\n-\t\ti40e_pf_host_process_cmd_add_ether_address(vf,\n-\t\t\t\t\t\tmsg, msglen);\n+\t\ti40e_pf_host_process_cmd_add_ether_address(vf, msg, msglen);\n \t\tbreak;\n \tcase I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS:\n \t\tPMD_DRV_LOG(INFO, \"OP_DEL_ETHER_ADDRESS received\\n\");\n-\t\ti40e_pf_host_process_cmd_del_ether_address(vf,\n-\t\t\t\t\t\tmsg, msglen);\n+\t\ti40e_pf_host_process_cmd_del_ether_address(vf, msg, msglen);\n \t\tbreak;\n \tcase I40E_VIRTCHNL_OP_ADD_VLAN:\n \t\tPMD_DRV_LOG(INFO, \"OP_ADD_VLAN received\\n\");\n@@ -932,10 +951,9 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,\n \tcase I40E_VIRTCHNL_OP_FCOE:\n \t\tPMD_DRV_LOG(ERR, \"OP_FCOE received, not supported\\n\");\n \tdefault:\n-\t\tPMD_DRV_LOG(ERR, \"%u received, not supported\\n\",\n-\t\t\t\t\t\t\topcode);\n-\t\ti40e_pf_host_send_msg_to_vf(vf, opcode,\n-\t\t\t\tI40E_ERR_PARAM, NULL, 0);\n+\t\tPMD_DRV_LOG(ERR, \"%u received, not supported\\n\", opcode);\n+\t\ti40e_pf_host_send_msg_to_vf(vf, opcode, I40E_ERR_PARAM,\n+\t\t\t\t\t\t\t\tNULL, 0);\n \t\tbreak;\n \t}\n }\ndiff --git a/lib/librte_pmd_i40e/i40e_pf.h b/lib/librte_pmd_i40e/i40e_pf.h\nindex 41b6826..19e1379 100644\n--- a/lib/librte_pmd_i40e/i40e_pf.h\n+++ b/lib/librte_pmd_i40e/i40e_pf.h\n@@ -57,7 +57,14 @@ enum i40e_virtchnl_ops_DPDK {\n \tI40E_VIRTCHNL_OP_GET_LINK_STAT = I40E_VIRTCHNL_OP_EVENT + 0x100,\n \tI40E_VIRTCHNL_OP_CFG_VLAN_OFFLOAD,\n \tI40E_VIRTCHNL_OP_CFG_VLAN_PVID,\n+\tI40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES_EX,\n };\n+\n+/* DPDK extra configurations for queues */\n+struct i40e_virtchnl_queue_pair_extra_info {\n+\tuint8_t crcstrip;\n+};\n+\n struct i40e_virtchnl_vlan_offload_info {\n \tuint16_t vsi_id;\n \tuint8_t enable_vlan_strip;\n",
    "prefixes": [
        "dpdk-dev",
        "1/3"
    ]
}