forked from mirrors/linux
		
	sk_buff: track dst status in slow_gro
Similar to the previous patch, but covering the dst field: the slow_gro flag is additionally set when a dst is attached to the skb RFC -> v1: - use the existing flag instead of adding a new one Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									5fc88f93ed
								
							
						
					
					
						commit
						8a886b142b
					
				
					 2 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -992,6 +992,7 @@ static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
 | 
					static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						skb->slow_gro |= !!dst;
 | 
				
			||||||
	skb->_skb_refdst = (unsigned long)dst;
 | 
						skb->_skb_refdst = (unsigned long)dst;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1008,6 +1009,7 @@ static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
 | 
				
			||||||
static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst)
 | 
					static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
 | 
						WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
 | 
				
			||||||
 | 
						skb->slow_gro = !!dst;
 | 
				
			||||||
	skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF;
 | 
						skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -277,6 +277,7 @@ static inline void skb_dst_drop(struct sk_buff *skb)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
 | 
					static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						nskb->slow_gro |= !!refdst;
 | 
				
			||||||
	nskb->_skb_refdst = refdst;
 | 
						nskb->_skb_refdst = refdst;
 | 
				
			||||||
	if (!(nskb->_skb_refdst & SKB_DST_NOREF))
 | 
						if (!(nskb->_skb_refdst & SKB_DST_NOREF))
 | 
				
			||||||
		dst_clone(skb_dst(nskb));
 | 
							dst_clone(skb_dst(nskb));
 | 
				
			||||||
| 
						 | 
					@ -316,6 +317,7 @@ static inline bool skb_dst_force(struct sk_buff *skb)
 | 
				
			||||||
			dst = NULL;
 | 
								dst = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		skb->_skb_refdst = (unsigned long)dst;
 | 
							skb->_skb_refdst = (unsigned long)dst;
 | 
				
			||||||
 | 
							skb->slow_gro |= !!dst;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return skb->_skb_refdst != 0UL;
 | 
						return skb->_skb_refdst != 0UL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue