Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/554180/?format=api
{ "id": 554180, "url": "http://patchwork.ozlabs.org/api/patches/554180/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20151209012044.134015.19530.stgit@bwallan-cwp1.jf.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": "<20151209012044.134015.19530.stgit@bwallan-cwp1.jf.intel.com>", "list_archive_url": null, "date": "2015-12-09T01:20:44", "name": "fm10k: cleanup mailbox code comments etc.", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "589ba2511e833e18b7397df3c7bc2f986ad70597", "submitter": { "id": 503, "url": "http://patchwork.ozlabs.org/api/people/503/?format=api", "name": "Allan, Bruce W", "email": "bruce.w.allan@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20151209012044.134015.19530.stgit@bwallan-cwp1.jf.intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/554180/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/554180/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.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" ], "Received": [ "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id 272A2140281\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 9 Dec 2015 12:20:50 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id EA94D32FAC;\n\tWed, 9 Dec 2015 01:20:49 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id hQO1wze9oc7U; Wed, 9 Dec 2015 01:20:47 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 58E0E329A3;\n\tWed, 9 Dec 2015 01:20:47 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id BA2F71C0FB4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Dec 2015 01:20:44 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B224E8C0C3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Dec 2015 01:20:44 +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 y9OFWiRwZkOi for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Dec 2015 01:20:43 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 633E78BF0C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 9 Dec 2015 01:20:43 +0000 (UTC)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga103.fm.intel.com with ESMTP; 08 Dec 2015 17:20:42 -0800", "from bwallan-cwp1.jf.intel.com (HELO bwallan-cwp1)\n\t([10.166.136.47])\n\tby fmsmga002.fm.intel.com with ESMTP; 08 Dec 2015 17:20:42 -0800", "from bwallan-cwp1.jf.intel.com (localhost [127.0.0.1])\n\tby bwallan-cwp1 (8.15.2/8.15.1) with ESMTP id tB91KihV134041\n\tfor <intel-wired-lan@lists.osuosl.org>; Tue, 8 Dec 2015 17:20:44 -0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.20,401,1444719600\"; d=\"scan'208\";a=\"869624525\"", "From": "Bruce Allan <bruce.w.allan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 08 Dec 2015 17:20:44 -0800", "Message-ID": "<20151209012044.134015.19530.stgit@bwallan-cwp1.jf.intel.com>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH] fm10k: cleanup mailbox code comments etc.", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "Cleanup a number of issues with function header comments, lower-case\nacronyms (i.e. FIFO, TLV), duplicate comments and a stubbed-out header\ncomment for fm10k_sm_mbx_init.\n\nSigned-off-by: Bruce Allan <bruce.w.allan@intel.com>\n---\n drivers/net/ethernet/intel/fm10k/fm10k_mbx.c | 50 ++++++++++++++++----------\n drivers/net/ethernet/intel/fm10k/fm10k_mbx.h | 4 +-\n drivers/net/ethernet/intel/fm10k/fm10k_tlv.h | 4 +-\n 3 files changed, 34 insertions(+), 24 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c\nindex c7fea47..98202c3 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c\n@@ -57,7 +57,7 @@ static u16 fm10k_fifo_unused(struct fm10k_mbx_fifo *fifo)\n }\n \n /**\n- * fm10k_fifo_empty - Test to verify if fifo is empty\n+ * fm10k_fifo_empty - Test to verify if FIFO is empty\n * @fifo: pointer to FIFO\n *\n * This function returns true if the FIFO is empty, else false\n@@ -72,7 +72,7 @@ static bool fm10k_fifo_empty(struct fm10k_mbx_fifo *fifo)\n * @fifo: pointer to FIFO\n * @offset: offset to add to head\n *\n- * This function returns the indices into the fifo based on head + offset\n+ * This function returns the indices into the FIFO based on head + offset\n **/\n static u16 fm10k_fifo_head_offset(struct fm10k_mbx_fifo *fifo, u16 offset)\n {\n@@ -84,7 +84,7 @@ static u16 fm10k_fifo_head_offset(struct fm10k_mbx_fifo *fifo, u16 offset)\n * @fifo: pointer to FIFO\n * @offset: offset to add to tail\n *\n- * This function returns the indices into the fifo based on tail + offset\n+ * This function returns the indices into the FIFO based on tail + offset\n **/\n static u16 fm10k_fifo_tail_offset(struct fm10k_mbx_fifo *fifo, u16 offset)\n {\n@@ -160,7 +160,7 @@ static u16 fm10k_mbx_index_len(struct fm10k_mbx_info *mbx, u16 head, u16 tail)\n /**\n * fm10k_mbx_tail_add - Determine new tail value with added offset\n * @mbx: pointer to mailbox\n- * @offset: length to add to head offset\n+ * @offset: length to add to tail offset\n *\n * This function takes the local tail index and recomputes it for\n * a given length added as an offset.\n@@ -176,7 +176,7 @@ static u16 fm10k_mbx_tail_add(struct fm10k_mbx_info *mbx, u16 offset)\n /**\n * fm10k_mbx_tail_sub - Determine new tail value with subtracted offset\n * @mbx: pointer to mailbox\n- * @offset: length to add to head offset\n+ * @offset: length to add to tail offset\n *\n * This function takes the local tail index and recomputes it for\n * a given length added as an offset.\n@@ -240,7 +240,7 @@ static u16 fm10k_mbx_pushed_tail_len(struct fm10k_mbx_info *mbx)\n }\n \n /**\n- * fm10k_fifo_write_copy - pulls data off of msg and places it in fifo\n+ * fm10k_fifo_write_copy - pulls data off of msg and places it in FIFO\n * @fifo: pointer to FIFO\n * @msg: message array to populate\n * @tail_offset: additional offset to add to tail pointer\n@@ -336,6 +336,7 @@ static u16 fm10k_mbx_validate_msg_size(struct fm10k_mbx_info *mbx, u16 len)\n \n /**\n * fm10k_mbx_write_copy - pulls data off of Tx FIFO and places it in mbmem\n+ * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n *\n * This function will take a section of the Tx FIFO and copy it into the\n@@ -711,7 +712,7 @@ static bool fm10k_mbx_tx_complete(struct fm10k_mbx_info *mbx)\n * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n *\n- * This function dequeues messages and hands them off to the tlv parser.\n+ * This function dequeues messages and hands them off to the TLV parser.\n * It will return the number of messages processed when called.\n **/\n static u16 fm10k_mbx_dequeue_rx(struct fm10k_hw *hw,\n@@ -924,7 +925,7 @@ static void fm10k_mbx_create_fake_disconnect_hdr(struct fm10k_mbx_info *mbx)\n }\n \n /**\n- * fm10k_mbx_create_error_msg - Generate a error message\n+ * fm10k_mbx_create_error_msg - Generate an error message\n * @mbx: pointer to mailbox\n * @err: local error encountered\n *\n@@ -957,7 +958,6 @@ static void fm10k_mbx_create_error_msg(struct fm10k_mbx_info *mbx, s32 err)\n /**\n * fm10k_mbx_validate_msg_hdr - Validate common fields in the message header\n * @mbx: pointer to mailbox\n- * @msg: message array to read\n *\n * This function will parse up the fields in the mailbox header and return\n * an error if the header contains any of a number of invalid configurations\n@@ -1021,11 +1021,12 @@ static s32 fm10k_mbx_validate_msg_hdr(struct fm10k_mbx_info *mbx)\n \n /**\n * fm10k_mbx_create_reply - Generate reply based on state and remote head\n+ * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n * @head: acknowledgement number\n *\n * This function will generate an outgoing message based on the current\n- * mailbox state and the remote fifo head. It will return the length\n+ * mailbox state and the remote FIFO head. It will return the length\n * of the outgoing message excluding header on success, and a negative value\n * on error.\n **/\n@@ -1151,8 +1152,8 @@ static void fm10k_mbx_connect_reset(struct fm10k_mbx_info *mbx)\n \n /**\n * fm10k_mbx_process_connect - Process connect header\n+ * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n- * @msg: message array to process\n *\n * This function will read an incoming connect header and reply with the\n * appropriate message. It will return a value indicating the number of\n@@ -1198,6 +1199,7 @@ static s32 fm10k_mbx_process_connect(struct fm10k_hw *hw,\n \n /**\n * fm10k_mbx_process_data - Process data header\n+ * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n *\n * This function will read an incoming data header and reply with the\n@@ -1239,6 +1241,7 @@ static s32 fm10k_mbx_process_data(struct fm10k_hw *hw,\n \n /**\n * fm10k_mbx_process_disconnect - Process disconnect header\n+ * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n *\n * This function will read an incoming disconnect header and reply with the\n@@ -1291,6 +1294,7 @@ static s32 fm10k_mbx_process_disconnect(struct fm10k_hw *hw,\n \n /**\n * fm10k_mbx_process_error - Process error header\n+ * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n *\n * This function will read an incoming error header and reply with the\n@@ -1560,7 +1564,7 @@ static s32 fm10k_mbx_register_handlers(struct fm10k_mbx_info *mbx,\n * @id: ID reference for PF as it supports up to 64 PF/VF mailboxes\n *\n * This function initializes the mailbox for use. It will split the\n- * buffer provided an use that th populate both the Tx and Rx FIFO by\n+ * buffer provided and use that to populate both the Tx and Rx FIFO by\n * evenly splitting it. In order to allow for easy masking of head/tail\n * the value reported in size must be a power of 2 and is reported in\n * DWORDs, not bytes. Any invalid values will cause the mailbox to return\n@@ -1637,7 +1641,7 @@ s32 fm10k_pfvf_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx,\n * fm10k_sm_mbx_create_data_hdr - Generate a mailbox header for local FIFO\n * @mbx: pointer to mailbox\n *\n- * This function returns a connection mailbox header\n+ * This function returns a data mailbox header\n **/\n static void fm10k_sm_mbx_create_data_hdr(struct fm10k_mbx_info *mbx)\n {\n@@ -1730,8 +1734,6 @@ static s32 fm10k_sm_mbx_connect(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx)\n \tfm10k_sm_mbx_create_connect_hdr(mbx, 0);\n \tfm10k_mbx_write(hw, mbx);\n \n-\t/* enable interrupt and notify other party of new message */\n-\n \treturn 0;\n }\n \n@@ -1775,7 +1777,7 @@ static void fm10k_sm_mbx_disconnect(struct fm10k_hw *hw,\n }\n \n /**\n- * fm10k_mbx_validate_fifo_hdr - Validate fields in the remote FIFO header\n+ * fm10k_sm_mbx_validate_fifo_hdr - Validate fields in the remote FIFO header\n * @mbx: pointer to mailbox\n *\n * This function will parse up the fields in the mailbox header and return\n@@ -1853,7 +1855,7 @@ static void fm10k_sm_mbx_process_error(struct fm10k_mbx_info *mbx)\n }\n \n /**\n- * fm10k_sm_mbx_create_error_message - Process an error in FIFO hdr\n+ * fm10k_sm_mbx_create_error_msg - Process an error in FIFO header\n * @mbx: pointer to mailbox\n * @err: local error encountered\n *\n@@ -1883,6 +1885,7 @@ static void fm10k_sm_mbx_create_error_msg(struct fm10k_mbx_info *mbx, s32 err)\n * fm10k_sm_mbx_receive - Take message from Rx mailbox FIFO and put it in Rx\n * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n+ * @tail: tail index of message\n *\n * This function will dequeue one message from the Rx switch manager mailbox\n * FIFO and place it in the Rx mailbox FIFO for processing by software.\n@@ -1922,6 +1925,7 @@ static s32 fm10k_sm_mbx_receive(struct fm10k_hw *hw,\n * fm10k_sm_mbx_transmit - Take message from Tx and put it in Tx mailbox FIFO\n * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n+ * @head: head index of message\n *\n * This function will dequeue one message from the Tx mailbox FIFO and place\n * it in the Tx switch manager mailbox FIFO for processing by hardware.\n@@ -1961,11 +1965,12 @@ static void fm10k_sm_mbx_transmit(struct fm10k_hw *hw,\n \n /**\n * fm10k_sm_mbx_create_reply - Generate reply based on state and remote head\n+ * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n * @head: acknowledgement number\n *\n * This function will generate an outgoing message based on the current\n- * mailbox state and the remote fifo head. It will return the length\n+ * mailbox state and the remote FIFO head. It will return the length\n * of the outgoing message excluding header on success, and a negative value\n * on error.\n **/\n@@ -2077,7 +2082,7 @@ send_reply:\n }\n \n /**\n- * fm10k_sm_mbx_process - Process mailbox switch mailbox interrupt\n+ * fm10k_sm_mbx_process - Process switch manager mailbox interrupt\n * @hw: pointer to hardware structure\n * @mbx: pointer to mailbox\n *\n@@ -2133,7 +2138,12 @@ fifo_err:\n * @mbx: pointer to mailbox\n * @msg_data: handlers for mailbox events\n *\n- * This function for now is used to stub out the PF/SM mailbox\n+ * This function initializes the PF/SM mailbox for use. It will split the\n+ * buffer provided and use that to populate both the Tx and Rx FIFO by\n+ * evenly splitting it. In order to allow for easy masking of head/tail\n+ * the value reported in size must be a power of 2 and is reported in\n+ * DWORDs, not bytes. Any invalid values will cause the mailbox to return\n+ * error.\n **/\n s32 fm10k_sm_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx,\n \t\t const struct fm10k_msg_data *msg_data)\ndiff --git a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.h b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.h\nindex c4f18a8..245a0a3 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.h\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.h\n@@ -128,11 +128,11 @@ enum fm10k_mbx_state {\n *\t\tThe maximum message size is provided during connect to avoid\n *\t\tjamming the mailbox with messages that do not fit.\n * Err_no: Error number - Applies only to error headers\n- *\t\tThe error number provides a indication of the type of error\n+ *\t\tThe error number provides an indication of the type of error\n *\t\texperienced.\n */\n \n-/* macros for retriving and setting header values */\n+/* macros for retrieving and setting header values */\n #define FM10K_MSG_HDR_MASK(name) \\\n \t((0x1u << FM10K_MSG_##name##_SIZE) - 1)\n #define FM10K_MSG_HDR_FIELD_SET(value, name) \\\ndiff --git a/drivers/net/ethernet/intel/fm10k/fm10k_tlv.h b/drivers/net/ethernet/intel/fm10k/fm10k_tlv.h\nindex d5ad359..e1845e0 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_tlv.h\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_tlv.h\n@@ -38,9 +38,9 @@ struct fm10k_msg_data;\n * mailbox size we will provide a message with the above header and it\n * will be segmented and transported to the mailbox to the other side where\n * it is reassembled. It contains the following fields:\n- * Len: Length of the message in bytes excluding the message header\n+ * Length: Length of the message in bytes excluding the message header\n * Flags: TBD\n- * Rule: These will be the message/argument types we pass\n+ * Type/ID: These will be the message/argument types we pass\n */\n /* message data header */\n #define FM10K_TLV_ID_SHIFT\t\t0\n", "prefixes": [] }