aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/sfc_tso.c
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-07-04 10:40:06 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-07-04 10:48:05 +0200
commit8d53e9f3c6001dcb2865f6e894da5b54e1418f88 (patch)
tree63907f21c13636a987d43463c675d0727a04e327 /drivers/net/sfc/sfc_tso.c
parente2bea7436061ca2e7e14bfcfdc5870f2555c3965 (diff)
New upstream version 18.11.2upstream-18.11-stable
Change-Id: I23eb4f9179abf1f9c659891f8fddb27ee68ad26b Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'drivers/net/sfc/sfc_tso.c')
-rw-r--r--drivers/net/sfc/sfc_tso.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c
index 076a25d4..a28af0e7 100644
--- a/drivers/net/sfc/sfc_tso.c
+++ b/drivers/net/sfc/sfc_tso.c
@@ -107,10 +107,6 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
idx += SFC_TSO_OPT_DESCS_NUM;
- /* Packets which have too big headers should be discarded */
- if (unlikely(header_len > SFC_TSOH_STD_LEN))
- return EMSGSIZE;
-
/*
* The TCP header must start at most 208 bytes into the frame.
* If it starts later than this then the NIC won't realise
@@ -129,6 +125,13 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
* limitations on address boundaries crossing by DMA descriptor data.
*/
if (m->data_len < header_len) {
+ /*
+ * Discard a packet if header linearization is needed but
+ * the header is too big.
+ */
+ if (unlikely(header_len > SFC_TSOH_STD_LEN))
+ return EMSGSIZE;
+
tsoh = txq->sw_ring[idx & txq->ptr_mask].tsoh;
sfc_tso_prepare_header(tsoh, header_len, in_seg, in_off);