get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 5717,
    "url": "https://patches.dpdk.org/api/patches/5717/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1435116386-12010-4-git-send-email-wenzhuo.lu@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": "<1435116386-12010-4-git-send-email-wenzhuo.lu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1435116386-12010-4-git-send-email-wenzhuo.lu@intel.com",
    "date": "2015-06-24T03:25:52",
    "name": "[dpdk-dev,03/37] ixgbe/base: fix 1G and 10G link stability for x550em SFP+",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "59f250b9386776f2d044e625f6710367d13fdc2c",
    "submitter": {
        "id": 258,
        "url": "https://patches.dpdk.org/api/people/258/?format=api",
        "name": "Wenzhuo Lu",
        "email": "wenzhuo.lu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1435116386-12010-4-git-send-email-wenzhuo.lu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/5717/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/5717/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 F3CB8C450;\n\tWed, 24 Jun 2015 05:26:43 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id DD5565A65\n\tfor <dev@dpdk.org>; Wed, 24 Jun 2015 05:26:41 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga101.fm.intel.com with ESMTP; 23 Jun 2015 20:26:40 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga003.jf.intel.com with ESMTP; 23 Jun 2015 20:26:40 -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 t5O3Qc9r019250;\n\tWed, 24 Jun 2015 11:26:38 +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 t5O3QZ4O012067; Wed, 24 Jun 2015 11:26:37 +0800",
            "(from wenzhuol@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5O3QY7E012063; \n\tWed, 24 Jun 2015 11:26:34 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.13,669,1427785200\"; d=\"scan'208\";a=\"593660273\"",
        "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 24 Jun 2015 11:25:52 +0800",
        "Message-Id": "<1435116386-12010-4-git-send-email-wenzhuo.lu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1435116386-12010-1-git-send-email-wenzhuo.lu@intel.com>",
        "References": "<1435116386-12010-1-git-send-email-wenzhuo.lu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 03/37] ixgbe/base: fix 1G and 10G link stability\n\tfor x550em SFP+",
        "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": "Configure the CS4227 correctly for both 1G and 10G operation,\nby moving the code to ixgbe_setup_mac_link_sfp_x550em(). It\nneeds to be in this function because we need both the module\ntype and the speed, and this is the only function in the init\nflow that knows the speed. In contrast,\nixgbe_setup_sfp_modules_X550em() does not know the speed, so we\ncan't do anything useful here. This is a fundamental difference\nfrom the 82599 flow.\n\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\n---\n drivers/net/ixgbe/base/ixgbe_phy.h  |   5 +-\n drivers/net/ixgbe/base/ixgbe_x550.c | 123 +++++++++++++++++-------------------\n 2 files changed, 63 insertions(+), 65 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/base/ixgbe_phy.h b/drivers/net/ixgbe/base/ixgbe_phy.h\nindex ffab02e..e3cf7ff 100644\n--- a/drivers/net/ixgbe/base/ixgbe_phy.h\n+++ b/drivers/net/ixgbe/base/ixgbe_phy.h\n@@ -93,7 +93,10 @@ POSSIBILITY OF SUCH DAMAGE.\n #define IXGBE_CS4227_GLOBAL_ID_VALUE\t0x03E5\n #define IXGBE_CS4227_SCRATCH_VALUE\t0x5aa5\n #define IXGBE_CS4227_RETRIES\t\t5\n-#define IXGBE_CS4227_SPARE24_LSB\t0x12B0\t/* Reg to program EDC */\n+#define IXGBE_CS4227_LINE_SPARE22_MSB\t0x12AD\t/* Reg to program speed */\n+#define IXGBE_CS4227_LINE_SPARE24_LSB\t0x12B0\t/* Reg to program EDC */\n+#define IXGBE_CS4227_HOST_SPARE22_MSB\t0x1AAD\t/* Reg to program speed */\n+#define IXGBE_CS4227_HOST_SPARE24_LSB\t0x1AB0\t/* Reg to program EDC */\n #define IXGBE_CS4227_EDC_MODE_CX1\t0x0002\n #define IXGBE_CS4227_EDC_MODE_SR\t0x0004\n #define IXGBE_CS4227_RESET_HOLD\t\t500\t/* microseconds */\ndiff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c\nindex fd46699..181264d 100644\n--- a/drivers/net/ixgbe/base/ixgbe_x550.c\n+++ b/drivers/net/ixgbe/base/ixgbe_x550.c\n@@ -995,57 +995,12 @@ enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw)\n  */\n s32 ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw)\n {\n-\tbool setup_linear;\n-\tu16 reg_slice, edc_mode;\n-\ts32 ret_val;\n-\n \tDEBUGFUNC(\"ixgbe_setup_sfp_modules_X550em\");\n \n-\tswitch (hw->phy.sfp_type) {\n-\tcase ixgbe_sfp_type_unknown:\n-\t\treturn IXGBE_SUCCESS;\n-\tcase ixgbe_sfp_type_not_present:\n-\t\treturn IXGBE_ERR_SFP_NOT_PRESENT;\n-\tcase ixgbe_sfp_type_da_cu_core0:\n-\tcase ixgbe_sfp_type_da_cu_core1:\n-\t\tsetup_linear = true;\n-\t\tbreak;\n-\tcase ixgbe_sfp_type_srlr_core0:\n-\tcase ixgbe_sfp_type_srlr_core1:\n-\tcase ixgbe_sfp_type_da_act_lmt_core0:\n-\tcase ixgbe_sfp_type_da_act_lmt_core1:\n-\tcase ixgbe_sfp_type_1g_sx_core0:\n-\tcase ixgbe_sfp_type_1g_sx_core1:\n-\tcase ixgbe_sfp_type_1g_lx_core0:\n-\tcase ixgbe_sfp_type_1g_lx_core1:\n-\t\tsetup_linear = false;\n-\t\tbreak;\n-\tdefault:\n-\t\treturn IXGBE_ERR_SFP_NOT_SUPPORTED;\n-\t}\n-\n \tixgbe_init_mac_link_ops_X550em(hw);\n \thw->phy.ops.reset = NULL;\n \n-\t/* The CS4227 slice address is the base address + the port-pair reg\n-\t * offset. I.e. Slice 0 = 0x12B0 and slice 1 = 0x22B0.\n-\t */\n-\treg_slice = IXGBE_CS4227_SPARE24_LSB + (hw->bus.lan_id << 12);\n-\n-\tif (setup_linear)\n-\t\tedc_mode = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1;\n-\telse\n-\t\tedc_mode = (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1;\n-\n-\t/* Configure CS4227 for connection type. */\n-\tret_val = ixgbe_write_i2c_combined(hw, IXGBE_CS4227, reg_slice,\n-\t\t\t\t\t   edc_mode);\n-\n-\tif (ret_val != IXGBE_SUCCESS)\n-\t\tret_val = ixgbe_write_i2c_combined(hw, 0x80, reg_slice,\n-\t\t\t\t\t\t   edc_mode);\n-\n-\treturn ret_val;\n+\treturn IXGBE_SUCCESS;\n }\n \n /**\n@@ -1346,7 +1301,6 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)\n  */\n s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)\n {\n-\tstruct ixgbe_hic_hdr fw_cmd;\n \tixgbe_link_speed link_speed;\n \ts32 status;\n \tu32 ctrl = 0;\n@@ -1355,22 +1309,6 @@ s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)\n \n \tDEBUGFUNC(\"ixgbe_reset_hw_X550em\");\n \n-\tfw_cmd.cmd = FW_PHY_MGMT_REQ_CMD;\n-\tfw_cmd.buf_len = 0;\n-\tfw_cmd.cmd_or_resp.cmd_resv = 0;\n-\tfw_cmd.checksum = FW_DEFAULT_CHECKSUM;\n-\tstatus = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,\n-\t\t\t\t\t      sizeof(fw_cmd),\n-\t\t\t\t\t      IXGBE_HI_PHY_MGMT_REQ_TIMEOUT,\n-\t\t\t\t\t      true);\n-\tif (status)\n-\t\tERROR_REPORT2(IXGBE_ERROR_CAUTION,\n-\t\t\t      \"PHY mgmt command failed with %d\\n\", status);\n-\telse if (fw_cmd.cmd_or_resp.ret_status != FW_CEM_RESP_STATUS_SUCCESS)\n-\t\tERROR_REPORT2(IXGBE_ERROR_CAUTION,\n-\t\t\t      \"PHY mgmt command returned %d\\n\",\n-\t\t\t      fw_cmd.cmd_or_resp.ret_status);\n-\n \t/* Call adapter stop to disable Tx/Rx and clear interrupts */\n \tstatus = hw->mac.ops.stop_adapter(hw);\n \tif (status != IXGBE_SUCCESS)\n@@ -1708,9 +1646,66 @@ s32 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,\n \t\t\t\t    ixgbe_link_speed speed,\n \t\t\t\t    bool autoneg_wait_to_complete)\n {\n+\ts32 ret_val;\n+\tu16 reg_slice, reg_val;\n+\tbool setup_linear;\n \tUNREFERENCED_1PARAMETER(autoneg_wait_to_complete);\n \n-\treturn ixgbe_setup_ixfi_x550em(hw, &speed);\n+\t/* Configure the external PHY. */\n+\tswitch (hw->phy.sfp_type) {\n+\tcase ixgbe_sfp_type_da_cu_core0:\n+\tcase ixgbe_sfp_type_da_cu_core1:\n+\t\tsetup_linear = true;\n+\t\tbreak;\n+\tcase ixgbe_sfp_type_srlr_core0:\n+\tcase ixgbe_sfp_type_srlr_core1:\n+\tcase ixgbe_sfp_type_da_act_lmt_core0:\n+\tcase ixgbe_sfp_type_da_act_lmt_core1:\n+\tcase ixgbe_sfp_type_1g_sx_core0:\n+\tcase ixgbe_sfp_type_1g_sx_core1:\n+#ifdef SUPPORT_1000BASE_LX\n+\tcase ixgbe_sfp_type_1g_lx_core0:\n+\tcase ixgbe_sfp_type_1g_lx_core1:\n+#endif /* SUPPORT_1000BASE_LX */\n+\t\tsetup_linear = false;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn IXGBE_ERR_SFP_NOT_SUPPORTED;\n+\t}\n+\n+\t/* Configure CS4227 for connection rate. */\n+\treg_slice = IXGBE_CS4227_LINE_SPARE22_MSB + (hw->bus.lan_id << 12);\n+\treg_val = (speed & IXGBE_LINK_SPEED_10GB_FULL) ? 0 : 0x8000;\n+\tret_val = ixgbe_write_i2c_combined(hw, IXGBE_CS4227, reg_slice,\n+\t\t\t\t\t   reg_val);\n+\n+\t/* Configure CS4227 for connection type. */\n+\treg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + (hw->bus.lan_id << 12);\n+\tif (setup_linear)\n+\t\treg_val = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1;\n+\telse\n+\t\treg_val = (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1;\n+\tret_val = ixgbe_write_i2c_combined(hw, IXGBE_CS4227, reg_slice,\n+\t\t\t\t\t   reg_val);\n+\n+\treg_slice = IXGBE_CS4227_HOST_SPARE22_MSB + (hw->bus.lan_id << 12);\n+\treg_val = (speed & IXGBE_LINK_SPEED_10GB_FULL) ? 0 : 0x8000;\n+\tret_val = ixgbe_write_i2c_combined(hw, IXGBE_CS4227, reg_slice,\n+\t\t\t\t\t   reg_val);\n+\n+\t/* Configure CS4227 for connection type. */\n+\treg_slice = IXGBE_CS4227_HOST_SPARE24_LSB + (hw->bus.lan_id << 12);\n+\tif (setup_linear)\n+\t\treg_val = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1;\n+\telse\n+\t\treg_val = (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1;\n+\tret_val = ixgbe_write_i2c_combined(hw, IXGBE_CS4227, reg_slice,\n+\t\t\t\t\t   reg_val);\n+\n+\t/* Configure the internal PHY. */\n+\tret_val = ixgbe_setup_ixfi_x550em(hw, &speed);\n+\n+\treturn ret_val;\n }\n \n /**\n",
    "prefixes": [
        "dpdk-dev",
        "03/37"
    ]
}