Skip to contentSkip to conversation

Question about skb_segment()

DISCUSSION Arnaud Ebalard 2 participants 2 messages Jan 29, 2014 – Feb 9, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Herbert,

I wonder if you could share some knowledge on the behaviour of skb_segment() as it is implemented in 3.13.0: when passed a GSO packet to be segmented, can the skb result have skb->next == NULL?

One would expect the number of segments of the result to usually match tcp_skb_pcount() of passed packet and hence having skb->next != NULL:
AFAICT, this what usually happens when skb_segment() is called in tcp_gso_segment() but I noticed some cases where the number of segments (length of chained sk_buff) is lower than the expected value and also have two backtraces resulting from a skb delivered with a NULL skb->next.

The whole thread leading to my question is here, in case you want to take a look:

http://thread.gmane.org/gmane.linux.network/301587

Thanks in advance,

a+

#1 lore raw
Quoted 6 lines · Arnaud Ebalard

Hi Herbert,

I wonder if you could share some knowledge on the behaviour of skb_segment() as it is implemented in 3.13.0: when passed a GSO packet to be segmented, can the skb result have skb->next == NULL?

Quoted 6 lines

One would expect the number of segments of the result to usually match tcp_skb_pcount() of passed packet and hence having skb->next != NULL:
AFAICT, this what usually happens when skb_segment() is called in tcp_gso_segment() but I noticed some cases where the number of segments (length of chained sk_buff) is lower than the expected value and also have two backtraces resulting from a skb delivered with a NULL skb->next.

Hi Arnaud:

This is definitely not expected. You said that the crash is not easily reproducible. Are you able to easily reproduce the problem where the number of segments produced is less than what is expected?

Can you print out the size of the segments produced in that case?

Thanks!

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt