From 4ce018700b726ebec8dbcb3a780ef17bfafb6548 Mon Sep 17 00:00:00 2001 From: sephe Date: Thu, 16 Jun 2016 04:21:27 +0000 Subject: [PATCH] MFC 297265 tcp/lro: Return TCP_LRO_NO_ENTRIES if we are short of LRO entries. So that callers could react accordingly. Reviewed by: gallatin (no objection) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5695 git-svn-id: svn://svn.freebsd.org/base/stable/10@301949 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/netinet/tcp_lro.c | 2 +- sys/netinet/tcp_lro.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 63a6bbafc..335fcc952 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -570,7 +570,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) /* Try to find an empty slot. */ if (SLIST_EMPTY(&lc->lro_free)) - return (TCP_LRO_CANNOT); + return (TCP_LRO_NO_ENTRIES); /* Start a new segment chain. */ le = SLIST_FIRST(&lc->lro_free); diff --git a/sys/netinet/tcp_lro.h b/sys/netinet/tcp_lro.h index ab6d74ac9..f963ab99e 100644 --- a/sys/netinet/tcp_lro.h +++ b/sys/netinet/tcp_lro.h @@ -90,6 +90,7 @@ void tcp_lro_flush_inactive(struct lro_ctrl *, const struct timeval *); void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *); int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); +#define TCP_LRO_NO_ENTRIES -2 #define TCP_LRO_CANNOT -1 #define TCP_LRO_NOT_SUPPORTED 1 -- 2.45.0