get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 4956,
    "url": "https://patches.dpdk.org/api/patches/4956/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1432887044-24777-5-git-send-email-jing.d.chen@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": "<1432887044-24777-5-git-send-email-jing.d.chen@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1432887044-24777-5-git-send-email-jing.d.chen@intel.com",
    "date": "2015-05-29T08:10:42",
    "name": "[dpdk-dev,4/6] fm10k: Fix issue that MAC addr can't be set to silicon",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f3f7e64ae2a6015e3c14be2016d6addd3bcacf60",
    "submitter": {
        "id": 40,
        "url": "https://patches.dpdk.org/api/people/40/?format=api",
        "name": "Chen, Jing D",
        "email": "jing.d.chen@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1432887044-24777-5-git-send-email-jing.d.chen@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/4956/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/4956/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id C43E6C318;\n\tFri, 29 May 2015 10:11:04 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 922902716\n\tfor <dev@dpdk.org>; Fri, 29 May 2015 10:11:02 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga103.jf.intel.com with ESMTP; 29 May 2015 01:11:01 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 29 May 2015 01:11:00 -0700",
            "from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com\n\t[10.239.29.90])\n\tby shvmail01.sh.intel.com with ESMTP id t4T8AwTr010781;\n\tFri, 29 May 2015 16:10:58 +0800",
            "from shecgisg003.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t4T8AuQh024839; Fri, 29 May 2015 16:10:58 +0800",
            "(from jingche2@localhost)\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t4T8AuiE024835; \n\tFri, 29 May 2015 16:10:56 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.13,515,1427785200\"; d=\"scan'208\";a=\"717419211\"",
        "From": "\"Chen Jing D(Mark)\" <jing.d.chen@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 29 May 2015 16:10:42 +0800",
        "Message-Id": "<1432887044-24777-5-git-send-email-jing.d.chen@intel.com>",
        "X-Mailer": "git-send-email 1.7.12.2",
        "In-Reply-To": "<1432887044-24777-1-git-send-email-jing.d.chen@intel.com>",
        "References": "<1432887044-24777-1-git-send-email-jing.d.chen@intel.com>",
        "Cc": "shaopeng.he@intel.com",
        "Subject": "[dpdk-dev] [PATCH 4/6] fm10k: Fix issue that MAC addr can't be set\n\tto silicon",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: \"Chen Jing D(Mark)\" <jing.d.chen@intel.com>\n\nIn fm10k, PF driver needs to communicate with switch through\nmailbox if it needs to add/delete MAC address.\nThis fix will validate if switch is ready before going forward.\nThen, it is necessary to acquire LPORT_MAP info after issuing\nMAC addr request to switch.\n\nSigned-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>\n---\n drivers/net/fm10k/fm10k_ethdev.c |   34 +++++++++++++++++++++++++++++++---\n 1 files changed, 31 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c\nindex 19e718b..dedfbb4 100644\n--- a/drivers/net/fm10k/fm10k_ethdev.c\n+++ b/drivers/net/fm10k/fm10k_ethdev.c\n@@ -45,6 +45,10 @@\n #define FM10K_MBXLOCK_DELAY_US 20\n #define UINT64_LOWER_32BITS_MASK 0x00000000ffffffffULL\n \n+/* Max try times to aquire switch status */\n+#define MAX_QUERY_SWITCH_STATE_TIMES 10\n+/* Wait interval to get switch status */\n+#define WAIT_SWITCH_MSG_US    100000\n /* Number of chars per uint32 type */\n #define CHARS_PER_UINT32 (sizeof(uint32_t))\n #define BIT_MASK_PER_UINT32 ((1 << CHARS_PER_UINT32) - 1)\n@@ -1802,6 +1806,32 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)\n \t\tfm10k_dev_enable_intr_vf(dev);\n \t}\n \n+\t/* Enable uio intr after callback registered */\n+\trte_intr_enable(&(dev->pci_dev->intr_handle));\n+\n+\thw->mac.ops.update_int_moderator(hw);\n+\n+\t/* Make sure Switch Manager is ready before going forward. */\n+\tif (hw->mac.type == fm10k_mac_pf) {\n+\t\tint switch_ready = 0;\n+\t\tint i;\n+\n+\t\tfor (i = 0; i < MAX_QUERY_SWITCH_STATE_TIMES; i++) {\n+\t\t\tfm10k_mbx_lock(hw);\n+\t\t\thw->mac.ops.get_host_state(hw, &switch_ready);\n+\t\t\tfm10k_mbx_unlock(hw);\n+\t\t\tif (switch_ready)\n+\t\t\t\tbreak;\n+\t\t\t/* Delay some time to acquire async LPORT_MAP info. */\n+\t\t\trte_delay_us(WAIT_SWITCH_MSG_US);\n+\t\t}\n+\n+\t\tif (switch_ready == 0) {\n+\t\t\tPMD_INIT_LOG(ERR, \"switch is not ready\");\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n \t/*\n \t * Below function will trigger operations on mailbox, acquire lock to\n \t * avoid race condition from interrupt handler. Operations on mailbox\n@@ -1811,7 +1841,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)\n \t */\n \tfm10k_mbx_lock(hw);\n \t/* Enable port first */\n-\thw->mac.ops.update_lport_state(hw, 0, 0, 1);\n+\thw->mac.ops.update_lport_state(hw, hw->mac.dglort_map, 1, 1);\n \n \t/* Update default vlan */\n \thw->mac.ops.update_vlan(hw, hw->mac.default_vid, 0, true);\n@@ -1831,8 +1861,6 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)\n \n \tfm10k_mbx_unlock(hw);\n \n-\t/* enable uio intr after callback registered */\n-\trte_intr_enable(&(dev->pci_dev->intr_handle));\n \n \treturn 0;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "4/6"
    ]
}