[U-Boot] [PATCH] net: tftp: Add TFTP specific config for retry count

Joe Hershberger joe.hershberger at gmail.com
Fri Jan 22 20:28:34 CET 2016


On Fri, Jan 22, 2016 at 1:18 PM,  <amessier.tyco at gmail.com> wrote:
> From: Alexandre Messier <amessier at tycoint.com>
>
> There is currently one config option (CONFIG_NET_RETRY_COUNT) that
> is available to tune the retries of the network stack.
> Unfortunately, it is global to all protocols, and the value is
> interpreted differently in all of them.
>
> Add a new config option that sets directly the number of retries
> specifically for TFTP.
>
> Signed-off-by: Alexandre Messier <amessier at tycoint.com>
> ---
>  README     | 5 +++++
>  net/tftp.c | 4 ++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/README b/README
> index ece4793..9d53c2e 100644
> --- a/README
> +++ b/README
> @@ -2845,6 +2845,11 @@ CBFS (Coreboot Filesystem) support
>                 before giving up the operation. If not defined, a
>                 default value of 5 is used.
>
> +               CONFIG_NET_RETRY_COUNT_TFTP
> +
> +               Override CONFIG_NET_RETRY_COUNT for TFTP. If not defined,
> +               falls back to CONFIG_NET_RETRY_COUNT.
> +

If you want to add a new config option, it needs to be in the Kconfig system.

>                 CONFIG_ARP_TIMEOUT
>
>                 Timeout waiting for an ARP reply in milliseconds.
> diff --git a/net/tftp.c b/net/tftp.c
> index f2889fe..884cfaa 100644
> --- a/net/tftp.c
> +++ b/net/tftp.c
> @@ -20,12 +20,16 @@
>  #define WELL_KNOWN_PORT        69
>  /* Millisecs to timeout for lost pkt */
>  #define TIMEOUT                5000UL
> +#ifndef CONFIG_NET_RETRY_COUNT_TFTP
>  #ifndef        CONFIG_NET_RETRY_COUNT
>  /* # of timeouts before giving up */
>  # define TIMEOUT_COUNT 10
>  #else
>  # define TIMEOUT_COUNT  (CONFIG_NET_RETRY_COUNT * 2)
>  #endif
> +#else
> +# define TIMEOUT_COUNT CONFIG_NET_RETRY_COUNT_TFTP
> +#endif
>  /* Number of "loading" hashes per line (for checking the image size) */
>  #define HASHES_PER_LINE        65
>
> --
> 2.7.0
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


More information about the U-Boot mailing list