get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2115313,
    "url": "http://patchwork.ozlabs.org/api/patches/2115313/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20250724160903.151997-1-jerome.forissier@linaro.org/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20250724160903.151997-1-jerome.forissier@linaro.org>",
    "list_archive_url": null,
    "date": "2025-07-24T16:08:24",
    "name": "lwip: tftp: resend initial request",
    "commit_ref": "46fc56559933777051bcc7b58d06424f1f4af504",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e40249c9f7b8bce19a37a128d8313e4913fee6cc",
    "submitter": {
        "id": 69192,
        "url": "http://patchwork.ozlabs.org/api/people/69192/?format=api",
        "name": "Jerome Forissier",
        "email": "jerome.forissier@linaro.org"
    },
    "delegate": {
        "id": 157425,
        "url": "http://patchwork.ozlabs.org/api/users/157425/?format=api",
        "username": "jforissier",
        "first_name": "Jerome",
        "last_name": "Forissier",
        "email": "jerome.forissier@linaro.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20250724160903.151997-1-jerome.forissier@linaro.org/mbox/",
    "series": [
        {
            "id": 466572,
            "url": "http://patchwork.ozlabs.org/api/series/466572/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=466572",
            "date": "2025-07-24T16:08:24",
            "name": "lwip: tftp: resend initial request",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/466572/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2115313/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2115313/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=GDZCtVBo;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.b=\"GDZCtVBo\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=jerome.forissier@linaro.org"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4bnwtV6MdQz1xsw\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 25 Jul 2025 02:09:22 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 32D24838C5;\n\tThu, 24 Jul 2025 18:09:30 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id B7BBC838C7; Thu, 24 Jul 2025 18:09:27 +0200 (CEST)",
            "from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com\n [IPv6:2a00:1450:4864:20::42a])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 5473083844\n for <u-boot@lists.denx.de>; Thu, 24 Jul 2025 18:09:25 +0200 (CEST)",
            "by mail-wr1-x42a.google.com with SMTP id\n ffacd0b85a97d-3a4e742dc97so1234892f8f.0\n for <u-boot@lists.denx.de>; Thu, 24 Jul 2025 09:09:25 -0700 (PDT)",
            "from builder.. ([2a01:e0a:3cb:7bb0:1615:f41c:6665:df29])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-3b76fc6d07asm2620466f8f.19.2025.07.24.09.09.23\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 24 Jul 2025 09:09:24 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1753373364; x=1753978164; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=g1Kv1rzX24QBvW0lBpP3H15NIer5VnrkMgxkEJ7MMqI=;\n b=GDZCtVBoCZDRnMpOcqjS4nJ2mYaBUaq3cJZZKdmt3Zq+h6DurCHU5r+c80YmeZYwoT\n numMCl3Gy9M3/2Dwc5OKkj+4kyRfn20Vy89LNQ8C2OxjPKr5AZGP1iZC8wrjKd1d0O+k\n PQsq404fTj6bYBp1r/Yc9uTCChpeHuNqbkfHmwXn6+POVeS5nrDEpVAAeS0kljLaINeh\n bvxOOUsSwwCvyFJUlty3aYPlHGn2RaK4hXS9J21sEoQpHZbdD44M34gDuB0kJv52qhqO\n tIJgoPsqxjsGJ4vEN9BUBsNjedALa7YaT72YAMeptx0SktzEmZq+YhezllSb0rGmpSPC\n k8jA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1753373364; x=1753978164;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=g1Kv1rzX24QBvW0lBpP3H15NIer5VnrkMgxkEJ7MMqI=;\n b=VBT5llTu4mqDe++e5rkfIo+ttlG8FcxaMyy7/360uEW/Ny+xsn0ugKeQRkypoP94g4\n kLoHvQn5t5ixzxZOKvBvq5Jqok/q+mB/YnqVUlFYT3rTTkuqvV/Ka0j+pVgFVXZE+760\n oVhko+RZKZC74+KLix6tkV9ovNMY4jdiqJKZOrFalt4M8iYNcxsfExjlwzE5mOQYMxKo\n FzAeZ0LNcamm0Tnn40tvmVUKujaNzQT18F5izLg0DSu19pOuI0PQkVGAhgPdlFOh/j4v\n FvMmV8RCk34VMl6AJFiEFvTVQ56F0mFfbfI31DMsIHUZwxNpmRQY1WmJvAg4KUbBGs+f\n MeaA==",
        "X-Gm-Message-State": "AOJu0YwgiPHY5OMu5Z4wXK2VTKzECNHsCrvxm0BXTuPp9YjNSoYisX8H\n S+cduYl2WALzWlDrAW3dDtAqSUJJKI73Krrc0FYeeQ1uSJ58JtfMlE6hFOZ2Ey4gDfy+BwplJxH\n CoF/Lufw=",
        "X-Gm-Gg": "ASbGncsXfahvmSzYvZxlw00mQQo8qoHaj7T2AXI0an7YX+Zj5VdxrTAFWzNZ5/ire2m\n TVHMxwUT/AeR1TqwEjnH9mXWhDNmulFCkqwMUG1fZTUs+/sKkwFjvbsN+yx+IdaRHftScNlrds8\n OOXVrl0raLfiIwSFb8olW22R66dffLNfimKiTyoTC/AbIyPJMaEtgSjxzSEEPsW7Bx6S6YoWfOU\n T6YAozgHvhprapuJ5IDw6JswVMb9b37uEe2Y2GpD68RmL+cRL7rw2xfV40ha3ng/zRsCYDibcKW\n XRrY+vPmAjvpepcFUPG2AC0LhJh3e62nkJH5S5JMfB1TfLNewan9lvGGdSIu4cMA8cnN98Us7wJ\n bM3bIu8z9HJbx+A9Bd/KJ0HtNRMhJMvk=",
        "X-Google-Smtp-Source": "\n AGHT+IEXtUXvDGRjHk971aZILQ+PvlMZnLwPB8K4EU6P4+UPDEXsw/K+DE4U4XGpbopOiFH4kWqQ/A==",
        "X-Received": "by 2002:a5d:6886:0:b0:3a3:6478:e08 with SMTP id\n ffacd0b85a97d-3b771374ee2mr2030041f8f.23.1753373364382;\n Thu, 24 Jul 2025 09:09:24 -0700 (PDT)",
        "From": "Jerome Forissier <jerome.forissier@linaro.org>",
        "To": "U-Boot mailing list <u-boot@lists.denx.de>",
        "Cc": "Jerome Forissier <jerome.forissier@linaro.org>,\n Venkatesh Abbarapu <venkatesh.abbarapu@amd.com>,\n Michal Simek <michal.simek@amd.com>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>, Tom Rini <trini@konsulko.com>",
        "Subject": "[PATCH] lwip: tftp: resend initial request",
        "Date": "Thu, 24 Jul 2025 18:08:24 +0200",
        "Message-ID": "<20250724160903.151997-1-jerome.forissier@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "The TFTP implementation does not resend the initial request if there is\nno response from the server. Since TFTP is based on UDP, there should be\na mechanism to deal with unreliable transmissions at this point, similar\nto what we have for data packets. Therefore, introduce request\nretransmission.\n\nSigned-off-by: Jerome Forissier <jerome.forissier@linaro.org>\nCC: Venkatesh Abbarapu <venkatesh.abbarapu@amd.com>\nCC: Michal Simek <michal.simek@amd.com>\nCC: Ilias Apalodimas <ilias.apalodimas@linaro.org>\n---\n\n lib/lwip/lwip/src/apps/tftp/tftp.c | 74 +++++++++++++++++++++++++++++-\n 1 file changed, 72 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/lwip/lwip/src/apps/tftp/tftp.c b/lib/lwip/lwip/src/apps/tftp/tftp.c\nindex 63b1e0e0e20..ecb6c55ae11 100644\n--- a/lib/lwip/lwip/src/apps/tftp/tftp.c\n+++ b/lib/lwip/lwip/src/apps/tftp/tftp.c\n@@ -79,6 +79,14 @@ enum tftp_error {\n \n #include <string.h>\n \n+struct tftp_req {\n+  ip_addr_t addr;\n+  u16_t port;\n+  u16_t opcode;\n+  enum tftp_transfer_mode mode;\n+  char* fname;\n+};\n+\n struct tftp_state {\n   const struct tftp_context *ctx;\n   void *handle;\n@@ -97,14 +105,33 @@ struct tftp_state {\n };\n \n static struct tftp_state tftp_state;\n+static struct tftp_req tftp_req;\n \n static void tftp_tmr(void *arg);\n+static void tftp_req_tmr(void *arg);\n+static const char *mode_to_string(enum tftp_transfer_mode mode);\n+\n+static void\n+clear_req(void)\n+{\n+  ip_addr_set_any(0, &tftp_req.addr);\n+  tftp_req.port = 0;\n+  tftp_req.opcode = 0;\n+  free(tftp_req.fname);\n+  tftp_req.fname = NULL;\n+  tftp_req.mode = 0;\n+\n+  sys_untimeout(tftp_req_tmr, NULL);\n+}\n \n static void\n close_handle(void)\n {\n+  clear_req();\n+\n   tftp_state.port = 0;\n   ip_addr_set_any(0, &tftp_state.addr);\n+  tftp_state.retries = 0;\n \n   if (tftp_state.last_data != NULL) {\n     pbuf_free(tftp_state.last_data);\n@@ -209,6 +236,12 @@ send_ack(const ip_addr_t *addr, u16_t port, u16_t blknum)\n   return ret;\n }\n \n+static err_t\n+resend_request(void)\n+{\n+  return send_request(&tftp_req.addr, tftp_req.port, tftp_req.opcode, tftp_req.fname, mode_to_string(tftp_req.mode));\n+}\n+\n static err_t\n resend_data(const ip_addr_t *addr, u16_t port)\n {\n@@ -336,6 +369,9 @@ tftp_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr\n   tftp_state.last_pkt = tftp_state.timer;\n   tftp_state.retries = 0;\n \n+  if (tftp_req.fname)\n+    clear_req();\n+\n   switch (opcode) {\n     case PP_HTONS(TFTP_RRQ): /* fall through */\n     case PP_HTONS(TFTP_WRQ): {\n@@ -542,6 +578,26 @@ tftp_tmr(void *arg)\n   }\n }\n \n+static void\n+tftp_req_tmr(void *arg)\n+{\n+  if (tftp_state.handle == NULL) {\n+    return;\n+  }\n+\n+  sys_timeout(TFTP_TIMER_MSECS, tftp_req_tmr, NULL);\n+\n+  if (tftp_state.retries < TFTP_MAX_RETRIES) {\n+    LWIP_DEBUGF(TFTP_DEBUG | LWIP_DBG_STATE, (\"tftp: req timeout, retrying\\n\"));\n+    resend_request();\n+    tftp_state.retries++;\n+  } else {\n+    LWIP_DEBUGF(TFTP_DEBUG | LWIP_DBG_STATE, (\"tftp: req timeout\\n\"));\n+    tftp_state.ctx->error(tftp_state.handle, -1, \"Request timeout\", strlen(\"Request timeout\"));\n+    close_handle();\n+  }\n+}\n+\n /**\n  * Initialize TFTP client/server.\n  * @param mode TFTP mode (client/server)\n@@ -637,6 +693,20 @@ mode_to_string(enum tftp_transfer_mode mode)\n   return NULL;\n }\n \n+err_t\n+start_send_requests(const ip_addr_t *addr, u16_t port, u16_t opcode, const char* fname, enum tftp_transfer_mode mode)\n+{\n+  tftp_req.addr = *addr;\n+  tftp_req.port = port;\n+  tftp_req.opcode = opcode;\n+  tftp_req.fname = strdup(fname);\n+  tftp_req.mode = mode;\n+  if (!tftp_req.fname)\n+    return ERR_MEM;\n+  sys_timeout(TFTP_TIMER_MSECS, tftp_req_tmr, NULL);\n+  return resend_request();\n+}\n+\n err_t\n tftp_get(void* handle, const ip_addr_t *addr, u16_t port, const char* fname, enum tftp_transfer_mode mode)\n {\n@@ -647,7 +717,7 @@ tftp_get(void* handle, const ip_addr_t *addr, u16_t port, const char* fname, enu\n   tftp_state.handle = handle;\n   tftp_state.blknum = 1;\n   tftp_state.mode_write = 1; /* We want to receive data */\n-  return send_request(addr, port, TFTP_RRQ, fname, mode_to_string(mode));\n+  return start_send_requests(addr, port, TFTP_RRQ, fname, mode);\n }\n \n err_t\n@@ -660,7 +730,7 @@ tftp_put(void* handle, const ip_addr_t *addr, u16_t port, const char* fname, enu\n   tftp_state.handle = handle;\n   tftp_state.blknum = 1;\n   tftp_state.mode_write = 0; /* We want to send data */\n-  return send_request(addr, port, TFTP_WRQ, fname, mode_to_string(mode));\n+  return start_send_requests(addr, port, TFTP_WRQ, fname, mode);\n }\n \n #endif /* LWIP_UDP */\n",
    "prefixes": []
}