get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 108586,
    "url": "https://patches.dpdk.org/api/patches/108586/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220307223337.27876-1-jeffd@silicom-usa.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": "<20220307223337.27876-1-jeffd@silicom-usa.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220307223337.27876-1-jeffd@silicom-usa.com",
    "date": "2022-03-07T22:33:37",
    "name": "net/ixgbe: Retry SFP ID read field to handle misbehaving SFPs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ddf6579e444f7b20b4d146bcc8872c147414ef35",
    "submitter": {
        "id": 2500,
        "url": "https://patches.dpdk.org/api/people/2500/?format=api",
        "name": "Jeff Daly",
        "email": "jeffd@silicom-usa.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220307223337.27876-1-jeffd@silicom-usa.com/mbox/",
    "series": [
        {
            "id": 22059,
            "url": "https://patches.dpdk.org/api/series/22059/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22059",
            "date": "2022-03-07T22:33:37",
            "name": "net/ixgbe: Retry SFP ID read field to handle misbehaving SFPs",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/22059/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/108586/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/108586/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 6987AA0093;\n\tMon,  7 Mar 2022 23:33:57 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 086AA41238;\n\tMon,  7 Mar 2022 23:33:57 +0100 (CET)",
            "from EUR05-VI1-obe.outbound.protection.outlook.com\n (mail-vi1eur05on2107.outbound.protection.outlook.com [40.107.21.107])\n by mails.dpdk.org (Postfix) with ESMTP id C0D2A4122E\n for <dev@dpdk.org>; Mon,  7 Mar 2022 23:33:53 +0100 (CET)",
            "from VI1PR0402MB3517.eurprd04.prod.outlook.com (2603:10a6:803:b::16)\n by AM0PR04MB6819.eurprd04.prod.outlook.com (2603:10a6:208:17f::15)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.16; Mon, 7 Mar\n 2022 22:33:52 +0000",
            "from VI1PR0402MB3517.eurprd04.prod.outlook.com\n ([fe80::a0f5:7a14:c41a:7d62]) by VI1PR0402MB3517.eurprd04.prod.outlook.com\n ([fe80::a0f5:7a14:c41a:7d62%3]) with mapi id 15.20.5038.027; Mon, 7 Mar 2022\n 22:33:52 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=YcZJPnm4Lo4Mrt9lIg4UiRVufAIyY9mF1+GEAIRNuzj8FmlO0ft0DIdN3qMU/lSP8H2CuB9mVGaIkTWg1YOYr5Wk9FsGW7gC1hqzWzopPHXWINKXspwhJ7zXAXcKetgN6bqUjElDl+uY5H/OYWf2V7HLJfUsO+Ohi21x/HX87BJJmwp7WlxjF5ksypGIEwRanGDXX+kp7kBN49sLNZ8QghbeFaL12G8hHLKQu2FeDJscdtjr+y4VMAQSMqSOTa2YHWvXSdj9fxnnXE0X7NjzHlcVOwwawZIXecpPVAcxDsdFAh+pOOMALsb3cM/j11yd+8+tRtvGD5PPl75xhzdtYQ==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=P2j9asUeugT1I5g6qXvriswhWcLFP95jVPq8T8ru6D8=;\n b=GoLHxP7Ra8DSZSHUoxBFxWvxnjqkNIybLWTW/pxepaKRJIuTK3KJrwn8xOvoebVHNvPsnx6KvCkUDDyxL4fy8YZYQO5HTl0NfPXgozF+z2S3Nt7A4tTc4Wlo4mqywXAat2upCz1z7Tb6kpj83FXKZ5wgLUT0uCtk9Uweu4uussbRm45ceqFyhn7B7W8923NTuc4fD7HnIwLSzzD4DHBr7X57eoWT2LHgH20h9vDKWiN57Zoi8EgBIYKdM9j+AcZo0F24/yjy+Z04dXv2LviC/MmKuvm8Os5QLqExXgDBTk7gQNe4D+Bs+AWzWAGereTKm1d1MAh3t17G7uFA/23GIg==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=silicom-usa.com; dmarc=pass action=none\n header.from=silicom-usa.com; dkim=pass header.d=silicom-usa.com; arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=SILICOMLTD.onmicrosoft.com; s=selector2-SILICOMLTD-onmicrosoft-com;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=P2j9asUeugT1I5g6qXvriswhWcLFP95jVPq8T8ru6D8=;\n b=Tn1GeDVnqW7jUDq/wBZf/gVW2TTCeZ7S6nJdstpLf0q4Q+47gMtprWFwcV8fjytyvy8GCAigvwX+SgNm3TtwwRcBg52FMBoI3ZzMTp7p12u+wny06EZ5+K4u1V+r/FnWSwhrlAXeSVwMV+qZliC0U6ZF6asRb4+l1CiJSa+4jYg=",
        "Authentication-Results": "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=silicom-usa.com;",
        "From": "jeffd@silicom-usa.com",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Douthit <stephend@silicom-usa.com>,\n Jeff Daly <jeffd@silicom-usa.com>, Haiyue Wang <haiyue.wang@intel.com>",
        "Subject": "[PATCH] net/ixgbe: Retry SFP ID read field to handle misbehaving SFPs",
        "Date": "Mon,  7 Mar 2022 17:33:37 -0500",
        "Message-Id": "<20220307223337.27876-1-jeffd@silicom-usa.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "BN6PR14CA0023.namprd14.prod.outlook.com\n (2603:10b6:404:79::33) To VI1PR0402MB3517.eurprd04.prod.outlook.com\n (2603:10a6:803:b::16)",
        "MIME-Version": "1.0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "1115d7a7-05d7-4710-5aa6-08da008a8e3c",
        "X-MS-TrafficTypeDiagnostic": "AM0PR04MB6819:EE_",
        "X-Microsoft-Antispam-PRVS": "\n <AM0PR04MB68192D353DD5A1CC69149C94EA089@AM0PR04MB6819.eurprd04.prod.outlook.com>",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n OUVmjWb+DYHW/Axtzy9uIWytYgyt1pi6Vhaff0Kfq9whJhaXHpkbLpU8/AUCGrnr81NqwDqSxm2n5dpl/WAB9sDP5a/Z1BV/Ek4XSpE4rDaFSQLRtlXcnaLU9dnggmaJ7ij0TBaAYdOSXnyFbBxdciLiq+Gn0EUTfKZsJjCYTBZsLGDKjmpkz+Awvtv5B0ABKNDBbE0Yob7FI3Bpf5cM0b5FHaL97IUCvDhBmb+BhHiS0h5sEBk1Xg34l2a2aDGhGynB5AJ3UhyP96PmwPK2zL5jWhQYo1Qn1Dodnlrm3JXVDIMViOrG18yiILNGD0M1GOpN/6nDsPEUmvUbLc5H98KXskDGUp4Qdqre7x4ZY0gmpnu2f5VTIpX3hT7N9uKSXKl8VDAEzUNjf3JZSSIwVqIuHoCfYW4MU9OtLpBWfpyr6sYNfeO/RqY3+nSCR0SeUZsfWnh6F1TJ7ay8yODmGy3cobFIJJR7E/9PuFF377FUQclZRHIFFfONkkwk7FpGDgSpCbocE3BX3Uz4nUkauoRbNLIH6yJPaRCgH4VqZ7GOzKXJe6us53fLd18EY6hJ33dC/gqj0YE5rJ9hilfksgvd7VDMAQMKh41WGK+VMW0I9DUMUXJSaxdAAf8jJW7if1brCi4qFGvqSvTYnkTiy8s+ZCY28UIlvWT0v+6aMkq/kqy3oCCpBE8mk7ASZw9ynwjLIIgtbLLdJt4gGhW/5A==",
        "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:VI1PR0402MB3517.eurprd04.prod.outlook.com; PTR:;\n CAT:NONE;\n SFS:(13230001)(4636009)(366004)(86362001)(8936002)(6512007)(6506007)(6486002)(6666004)(9686003)(5660300002)(6916009)(316002)(36756003)(52116002)(2906002)(38350700002)(1076003)(4326008)(186003)(8676002)(2616005)(83380400001)(508600001)(54906003)(66556008)(66476007)(66946007)(26005)(38100700002);\n DIR:OUT; SFP:1102;",
        "X-MS-Exchange-AntiSpam-MessageData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vA2Yi3IICsjDaYHPc3KGen8TR7x89eZA8aR55IRwYMAkW+eYnxyTquCUoaKAT3hmTxx+q+Gx1A+mDkHBNd8UT2qpdDdw2SNkJIkxouf2xSF2ABagz4dPVcib7FWF95m8rWlg8EzExYWs78xoho2pi0zJ0YFyVTlb/XsvkifhHinwQsibxwnaQgtNogc7/ISEN3tpaXlIBZ0TtbxDwgx615gI353Vz+FPauFZjPLQfTQ8jFVy+SpZFeqahTp2rMUV1SLql1YhxFYKmsiLqbe3Qxd32qqF4Ni5X5vt4OwIrAB+e85MSfD87ZpQKiOVnFxacBVeriJ2+4caYPeq8SV10Y96yP81int3QxfWxHnRTkRplxEL1k/sjcVRmSHIRAGx6azNnNfVlJ9M6pJ1amQwpBOG9V83U5UYzulmTyUIwG5YaWE/pbCP0p4XAO8d90qCslOe1qCEZb5L3GcVYOYtN5WefkQ6ZafOiH/GeKt+CWVMWDDENSXTRweGFjEE24ejQ/3V3WTjQvh2igA/R3ZwzAq5YXYsXSWZvYmZGuUJA/Mb3yyhDIzajKo3Uqfpm4GwEMgwx+Cuda+LZkSKvqqEg==",
        "X-OriginatorOrg": "silicom-usa.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 1115d7a7-05d7-4710-5aa6-08da008a8e3c",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n VI1PR0402MB3517.eurprd04.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "07 Mar 2022 22:33:52.3621 (UTC)",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-MS-Exchange-CrossTenant-Id": "c9e326d8-ce47-4930-8612-cc99d3c87ad1",
        "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED",
        "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n uYiQUEulhiijFUybl51stQd9KECjT2xeBPHT0JsmkVbKd5AVmASWh8UeRckOQl8Y90NCM+0ZNKM8MUsoAeMAAw==",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM0PR04MB6819",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "From: Stephen Douthit <stephend@silicom-usa.com>\n\nSome XGS-PON SFPs have been observed ACKing I2C reads and returning\nuninitialized garbage while their uC boots.  This can lead to the SFP ID\ncode marking an otherwise working SFP module as unsupported if a bogus\nID value is read while its internal PHY/microcontroller is still\nbooting.\n\nRetry the ID read several times looking not just for NAK, but also for a\nvalid ID field.\n\nSince the device isn't NAKing the trasanction the existing longer retry\ncode in ixgbe_read_i2c_byte_generic_int() doesn't apply here.\n\nSigned-off-by: Stephen Douthit <stephend@silicom-usa.com>\nSigned-off-by: Jeff Daly <jeffd@silicom-usa.com>\n---\n drivers/net/ixgbe/base/ixgbe_phy.c | 31 ++++++++++++++++++++++++++----\n 1 file changed, 27 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/base/ixgbe_phy.c b/drivers/net/ixgbe/base/ixgbe_phy.c\nindex d8d51d2c3f..27bce066a1 100644\n--- a/drivers/net/ixgbe/base/ixgbe_phy.c\n+++ b/drivers/net/ixgbe/base/ixgbe_phy.c\n@@ -1275,6 +1275,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)\n \tu8 cable_tech = 0;\n \tu8 cable_spec = 0;\n \tu16 enforce_sfp = 0;\n+\tu8 id_reads;\n \n \tDEBUGFUNC(\"ixgbe_identify_sfp_module_generic\");\n \n@@ -1287,12 +1288,34 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)\n \t/* LAN ID is needed for I2C access */\n \thw->mac.ops.set_lan_id(hw);\n \n-\tstatus = hw->phy.ops.read_i2c_eeprom(hw,\n-\t\t\t\t\t     IXGBE_SFF_IDENTIFIER,\n-\t\t\t\t\t     &identifier);\n+\t/* Need to check this a couple of times for a sane value.\n+\t *\n+\t * SFPs that have a uC slaved to the I2C bus (vs. a dumb EEPROM) can be\n+\t * poorly designed such that they will ACK I2C reads and return\n+\t * whatever bogus data is in the SRAM (or whatever is backing the target\n+\t * device) before things are truly initialized.\n+\t *\n+\t * In a perfect world devices would NAK I2C requests until they were\n+\t * sane, but here we are.\n+\t *\n+\t * Give such devices a couple tries to get their act together before\n+\t * marking the device as unsupported.\n+\t */\n+\tfor (id_reads = 0; id_reads < 5; id_reads++) {\n+\t\tstatus = hw->phy.ops.read_i2c_eeprom(hw,\n+\t\t\t\t\t\t     IXGBE_SFF_IDENTIFIER,\n+\t\t\t\t\t\t     &identifier);\n \n-\tif (status != IXGBE_SUCCESS)\n+\t\tDEBUGOUT(\"status %d, id %d\\n\", status, identifier);\n+\t\tif (!status &&\n+\t\t    identifier == IXGBE_SFF_IDENTIFIER_SFP)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (status != IXGBE_SUCCESS) {\n+\t\tDEBUGOUT(\"Failed SFF ID read (%d attempts)\\n\", id_reads);\n \t\tgoto err_read_i2c_eeprom;\n+\t}\n \n \tif (identifier != IXGBE_SFF_IDENTIFIER_SFP) {\n \t\thw->phy.type = ixgbe_phy_sfp_unsupported;\n",
    "prefixes": []
}