Blame SOURCES/0005-Use-spec-compliant-timeouts.patch

c62b1d
From bc252caa54fcfb2e9fd0ddb01ebaa50192e85c38 Mon Sep 17 00:00:00 2001
e55ecc
From: Alex Williamson <alex.williamson@redhat.com>
40e044
Date: Wed, 21 Oct 2015 11:18:40 +0200
40e044
Subject: Use spec compliant timeouts
e55ecc
e55ecc
Message-id: <20150428212403.31299.29391.stgit@gimli.home>
e55ecc
Patchwork-id: 64951
e55ecc
O-Subject: [RHEL7.2 ipxe PATCH 2/2] [dhcp][RHEL-only] Use spec compliant timeouts
e55ecc
Bugzilla: 1196352
e55ecc
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
e55ecc
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
e55ecc
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
e55ecc
e55ecc
Use local config to override iPXE's abbreviated DHCP timeouts using
e55ecc
the recommended values for spec compliance.  This matches the state
e55ecc
of RHEL6 gPXE DHCP timeouts after bz968474 + bz1206042
e55ecc
e55ecc
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
e55ecc
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
c62b1d
(cherry picked from commit 7038f41c0131d263de5165b416500009acdbf550)
e55ecc
---
e55ecc
 src/config/local/.gitignore |  1 -
e55ecc
 src/config/local/dhcp.h     | 62 +++++++++++++++++++++++++++++++++++++++++++++
e55ecc
 2 files changed, 62 insertions(+), 1 deletion(-)
e55ecc
 delete mode 100644 src/config/local/.gitignore
e55ecc
 create mode 100644 src/config/local/dhcp.h
e55ecc
e55ecc
diff --git a/src/config/local/dhcp.h b/src/config/local/dhcp.h
e55ecc
new file mode 100644
e55ecc
index 0000000..83df5b8
e55ecc
--- /dev/null
e55ecc
+++ b/src/config/local/dhcp.h
e55ecc
@@ -0,0 +1,62 @@
e55ecc
+/*
e55ecc
+ * Downstream localization
e55ecc
+ *
e55ecc
+ * For RHEL, use spec compliant DHCP timeouts (bz1196352)
e55ecc
+ */
e55ecc
+
e55ecc
+/*
e55ecc
+ * PXE spec defines timeouts of 4, 8, 16, 32 seconds
e55ecc
+ */
e55ecc
+#undef DHCP_DISC_START_TIMEOUT_SEC
e55ecc
+#define DHCP_DISC_START_TIMEOUT_SEC 4
e55ecc
+#undef DHCP_DISC_END_TIMEOUT_SEC
e55ecc
+#define DHCP_DISC_END_TIMEOUT_SEC   32
e55ecc
+
e55ecc
+/*
e55ecc
+ * Elapsed time used for early break waiting for ProxyDHCP, this therefore
e55ecc
+ * needs to be less than the cumulative time for the first 2 timeouts.
e55ecc
+ */
e55ecc
+#undef DHCP_DISC_PROXY_TIMEOUT_SEC
e55ecc
+#define DHCP_DISC_PROXY_TIMEOUT_SEC 11
e55ecc
+
e55ecc
+/*
e55ecc
+ * Approximate PXE spec requirement using minimum timeout (0.25s) for
e55ecc
+ * timeouts of 0.25, 0.5, 1, 2, 4
e55ecc
+ */
e55ecc
+#undef DHCP_REQ_START_TIMEOUT_SEC
e55ecc
+#define DHCP_REQ_START_TIMEOUT_SEC  0
e55ecc
+#undef DHCP_REQ_END_TIMEOUT_SEC
e55ecc
+#define DHCP_REQ_END_TIMEOUT_SEC    4
e55ecc
+
e55ecc
+/*
e55ecc
+ * Same as normal request phase, except non-fatal, so we extend the timer
e55ecc
+ * to 8 and set the early timeout to an elapsed time value that causes a
e55ecc
+ * break after the 4 second timeout.  At least that's what we'd like to do,
e55ecc
+ * but our timer operates at 18Hz and has a minimum resolution of 7 cycles.
e55ecc
+ * Therefore the above quarter-second starting timeout looks more like
e55ecc
+ * 0.39s, 0.78s, 1.56s, 3.11s, 6.22s.  If we had an ideal timer, we could
e55ecc
+ * set the timeout to 7s (0.25 + 0.5 + 1 + 2 + 4 = 7.75s) and exit without
e55ecc
+ * failure when the timer rolls over to 8s.  With our timer, we get 0.39 +
e55ecc
+ * 0.78 + 1.56 + 3.11 = 5.84s.  The next timeout would take us to 12.06s
e55ecc
+ * (+6.22).  That seems like a long time to wait for an optional reply, so
e55ecc
+ * we reduce the early timeout to 5s to exit before the timer exceeds the
e55ecc
+ * max and causes a failure.  This still adds one extra cycle vs the
e55ecc
+ * upstream defaults.
e55ecc
+ */
e55ecc
+#undef DHCP_PROXY_START_TIMEOUT_SEC
e55ecc
+#define DHCP_PROXY_START_TIMEOUT_SEC        0
e55ecc
+#undef DHCP_PROXY_END_TIMEOUT_SEC
e55ecc
+#define DHCP_PROXY_END_TIMEOUT_SEC  8
e55ecc
+#undef DHCP_REQ_PROXY_TIMEOUT_SEC
e55ecc
+#define DHCP_REQ_PROXY_TIMEOUT_SEC  5
e55ecc
+
e55ecc
+/*
e55ecc
+ * Same as above, retry each server using our approximation of standard
e55ecc
+ * timeouts and exit before timer induced failure.
e55ecc
+ */
e55ecc
+#undef PXEBS_START_TIMEOUT_SEC
e55ecc
+#define PXEBS_START_TIMEOUT_SEC             0
e55ecc
+#undef PXEBS_END_TIMEOUT_SEC
e55ecc
+#define PXEBS_END_TIMEOUT_SEC               8
e55ecc
+#undef PXEBS_MAX_TIMEOUT_SEC
e55ecc
+#define PXEBS_MAX_TIMEOUT_SEC               5
e55ecc
-- 
c62b1d
1.8.3.1
e55ecc