Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1320194/?format=api
{ "id": 1320194, "url": "http://patchwork.ozlabs.org/api/patches/1320194/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200701012557.40234-4-haiyue.wang@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20200701012557.40234-4-haiyue.wang@intel.com>", "list_archive_url": null, "date": "2020-07-01T01:25:55", "name": "[net-next,v7,3/5] ice: support to get the VSI mapping", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "3a21d36ee05b8ccac7b9bf78931ffaf0af3a1bfa", "submitter": { "id": 79056, "url": "http://patchwork.ozlabs.org/api/people/79056/?format=api", "name": "Haiyue Wang", "email": "haiyue.wang@intel.com" }, "delegate": { "id": 109701, "url": "http://patchwork.ozlabs.org/api/users/109701/?format=api", "username": "anguy11", "first_name": "Anthony", "last_name": "Nguyen", "email": "anthony.l.nguyen@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200701012557.40234-4-haiyue.wang@intel.com/mbox/", "series": [ { "id": 186808, "url": "http://patchwork.ozlabs.org/api/series/186808/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=186808", "date": "2020-07-01T01:25:52", "name": "ice: add Intel DCF mode support", "version": 7, "mbox": "http://patchwork.ozlabs.org/series/186808/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1320194/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1320194/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)", "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49xP213vbFz9sQt\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 1 Jul 2020 11:35:53 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id E5A0A8848C;\n\tWed, 1 Jul 2020 01:35:51 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Zhz9c1VlAME4; Wed, 1 Jul 2020 01:35:48 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B270288498;\n\tWed, 1 Jul 2020 01:35:47 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by ash.osuosl.org (Postfix) with ESMTP id 7167B1BF34E\n for <intel-wired-lan@lists.osuosl.org>; Wed, 1 Jul 2020 01:35:46 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by fraxinus.osuosl.org (Postfix) with ESMTP id 6E1DF877FB\n for <intel-wired-lan@lists.osuosl.org>; Wed, 1 Jul 2020 01:35:46 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id YJWlQD_0My40 for <intel-wired-lan@lists.osuosl.org>;\n Wed, 1 Jul 2020 01:35:45 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by fraxinus.osuosl.org (Postfix) with ESMTPS id BE34A87803\n for <intel-wired-lan@lists.osuosl.org>; Wed, 1 Jul 2020 01:35:45 +0000 (UTC)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 30 Jun 2020 18:35:43 -0700", "from npg-dpdk-haiyue-1.sh.intel.com ([10.67.119.213])\n by fmsmga005.fm.intel.com with ESMTP; 30 Jun 2020 18:35:41 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "IronPort-SDR": [ "\n sk79sL8xIGcDbEQCPK5AQ3Fm/3NfJxw8hQSAjCdz9yWDtHmgFRQ3hKzY4xpuf+A0vWV2l2WsqF\n ULGuiKzFA68g==", "\n ZOif1Z4oRAENryQRlD8FMPD+6G4tAHm1HUWzwzOMuRm0WjlWRkM3c3RIMYLl5vf+8CBJJWca0S\n iCy6KAhnwDAw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9668\"; a=\"144601243\"", "E=Sophos;i=\"5.75,298,1589266800\"; d=\"scan'208\";a=\"144601243\"", "E=Sophos;i=\"5.75,298,1589266800\"; d=\"scan'208\";a=\"481399971\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Haiyue Wang <haiyue.wang@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 1 Jul 2020 09:25:55 +0800", "Message-Id": "<20200701012557.40234-4-haiyue.wang@intel.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200701012557.40234-1-haiyue.wang@intel.com>", "References": "<20200619045711.16055-1-haiyue.wang@intel.com>\n <20200701012557.40234-1-haiyue.wang@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [net-next,\n v7 3/5] ice: support to get the VSI mapping", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "Beilei Xing <beilei.xing@intel.com>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "The DCF needs the mapping information of the VF ID to logical hardware\nVSI ID, so that it can create the switch flow rules for other VFs.\n\nSigned-off-by: Beilei Xing <beilei.xing@intel.com>\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 61 +++++++++++++++++++\n include/linux/avf/virtchnl.h | 21 +++++++\n 2 files changed, 82 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 622b16efae0b..2584c3f199e3 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -3848,6 +3848,64 @@ static int ice_vc_dis_dcf_cap(struct ice_vf *vf)\n \t\t\t\t v_ret, NULL, 0);\n }\n \n+/**\n+ * ice_vc_dcf_get_vsi_map - get VSI mapping table\n+ * @vf: pointer to the VF info\n+ */\n+static int ice_vc_dcf_get_vsi_map(struct ice_vf *vf)\n+{\n+\tenum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;\n+\tstruct virtchnl_dcf_vsi_map *vsi_map = NULL;\n+\tstruct ice_pf *pf = vf->pf;\n+\tstruct ice_vsi *pf_vsi;\n+\tu16 len = 0;\n+\tint vf_id;\n+\tint ret;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\tif (!ice_is_vf_dcf(vf) || ice_dcf_get_state(pf) != ICE_DCF_STATE_ON) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\tlen = struct_size(vsi_map, vf_vsi, pf->num_alloc_vfs - 1);\n+\tvsi_map = kzalloc(len, GFP_KERNEL);\n+\tif (!vsi_map) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY;\n+\t\tlen = 0;\n+\t\tgoto err;\n+\t}\n+\n+\tpf_vsi = ice_get_main_vsi(pf);\n+\tif (!pf_vsi) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\tlen = 0;\n+\t\tgoto err;\n+\t}\n+\n+\tvsi_map->pf_vsi = pf_vsi->vsi_num;\n+\tvsi_map->num_vfs = pf->num_alloc_vfs;\n+\n+\tice_for_each_vf(pf, vf_id) {\n+\t\tstruct ice_vf *tmp_vf = &pf->vf[vf_id];\n+\n+\t\tif (!ice_is_vf_disabled(tmp_vf) &&\n+\t\t test_bit(ICE_VF_STATE_INIT, tmp_vf->vf_states))\n+\t\t\tvsi_map->vf_vsi[vf_id] = tmp_vf->lan_vsi_num |\n+\t\t\t\tVIRTCHNL_DCF_VF_VSI_VALID;\n+\t}\n+\n+err:\n+\tret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DCF_GET_VSI_MAP, v_ret,\n+\t\t\t\t (u8 *)vsi_map, len);\n+\tkfree(vsi_map);\n+\treturn ret;\n+}\n+\n /**\n * ice_vc_process_vf_msg - Process request from VF\n * @pf: pointer to the PF structure\n@@ -3967,6 +4025,9 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \tcase VIRTCHNL_OP_DCF_DISABLE:\n \t\terr = ice_vc_dis_dcf_cap(vf);\n \t\tbreak;\n+\tcase VIRTCHNL_OP_DCF_GET_VSI_MAP:\n+\t\terr = ice_vc_dcf_get_vsi_map(vf);\n+\t\tbreak;\n \tcase VIRTCHNL_OP_UNKNOWN:\n \tdefault:\n \t\tdev_err(dev, \"Unsupported opcode %d from VF %d\\n\", v_opcode,\ndiff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h\nindex e219cafabccd..ef07cff40662 100644\n--- a/include/linux/avf/virtchnl.h\n+++ b/include/linux/avf/virtchnl.h\n@@ -140,6 +140,7 @@ enum virtchnl_ops {\n \tVIRTCHNL_OP_DCF_CMD_DESC = 39,\n \tVIRTCHNL_OP_DCF_CMD_BUFF = 40,\n \tVIRTCHNL_OP_DCF_DISABLE = 41,\n+\tVIRTCHNL_OP_DCF_GET_VSI_MAP = 42,\n \t/* New major set of opcodes introduced and so leaving room for\n \t * old misc opcodes to be added in future. Also these opcodes may only\n \t * be used if both the PF and VF have successfully negotiated the\n@@ -627,6 +628,25 @@ struct virtchnl_filter {\n \n VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter);\n \n+/* VIRTCHNL_OP_DCF_GET_VSI_MAP\n+ * VF sends this message to get VSI mapping table.\n+ * PF responds with an indirect message containing VF's\n+ * HW VSI IDs.\n+ * The index of vf_vsi array is the logical VF ID, the\n+ * value of vf_vsi array is the VF's HW VSI ID with its\n+ * valid configuration.\n+ */\n+struct virtchnl_dcf_vsi_map {\n+\tu16 pf_vsi;\t/* PF's HW VSI ID */\n+\tu16 num_vfs;\t/* The actual number of VFs allocated */\n+#define VIRTCHNL_DCF_VF_VSI_ID_S\t0\n+#define VIRTCHNL_DCF_VF_VSI_ID_M\t(0xFFF << VIRTCHNL_DCF_VF_VSI_ID_S)\n+#define VIRTCHNL_DCF_VF_VSI_VALID\tBIT(15)\n+\tu16 vf_vsi[1];\n+};\n+\n+VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_dcf_vsi_map);\n+\n /* VIRTCHNL_OP_EVENT\n * PF sends this message to inform the VF driver of events that may affect it.\n * No direct response is expected from the VF, though it may generate other\n@@ -1280,6 +1300,7 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,\n \t\tvalid_len = msglen;\n \t\tbreak;\n \tcase VIRTCHNL_OP_DCF_DISABLE:\n+\tcase VIRTCHNL_OP_DCF_GET_VSI_MAP:\n \t\tbreak;\n \tcase VIRTCHNL_OP_GET_CAPS:\n \t\tvalid_len = sizeof(struct virtchnl_get_capabilities);\n", "prefixes": [ "net-next", "v7", "3/5" ] }