Skip to content

Commit ff3bc1e

Browse files
author
Ben Hutchings
committed
sfc: Fix assignment of ip_summed for pre-allocated skbs
When pre-allocating skbs for received packets, we set ip_summed = CHECKSUM_UNNCESSARY. We used to change it back to CHECKSUM_NONE when the received packet had an incorrect checksum or unhandled protocol. Commit bc8acf2 ('drivers/net: avoid some skb->ip_summed initializations') mistakenly replaced the latter assignment with a DEBUG-only assertion that ip_summed == CHECKSUM_NONE. This assertion is always false, but it seems no-one has exercised this code path in a DEBUG build. Fix this by moving our assignment of CHECKSUM_UNNECESSARY into efx_rx_packet_gro(). Signed-off-by: Ben Hutchings <[email protected]>
1 parent 3d74747 commit ff3bc1e

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/sfc

1 file changed

+2
-2
lines changed

drivers/net/ethernet/sfc/rx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,10 @@ static int efx_init_rx_buffers_skb(struct efx_rx_queue *rx_queue)
156156
if (unlikely(!skb))
157157
return -ENOMEM;
158158

159-
/* Adjust the SKB for padding and checksum */
159+
/* Adjust the SKB for padding */
160160
skb_reserve(skb, NET_IP_ALIGN);
161161
rx_buf->len = skb_len - NET_IP_ALIGN;
162162
rx_buf->is_page = false;
163-
skb->ip_summed = CHECKSUM_UNNECESSARY;
164163

165164
rx_buf->dma_addr = pci_map_single(efx->pci_dev,
166165
skb->data, rx_buf->len,
@@ -496,6 +495,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel,
496495

497496
EFX_BUG_ON_PARANOID(!checksummed);
498497
rx_buf->u.skb = NULL;
498+
skb->ip_summed = CHECKSUM_UNNECESSARY;
499499

500500
gro_result = napi_gro_receive(napi, skb);
501501
}

0 commit comments

Comments
 (0)