diff mbox series

[RFCv8,net-next,47/55] net: adjust the prototype of skb_needs_linearize()

Message ID 20220918094336.28958-48-shenjian15@huawei.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series net: extend the type of netdev_features_t to bitmap | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count fail Series longer than 15 patches (and no cover letter)
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5397 this patch: 5397
netdev/cc_maintainers warning 3 maintainers not CCed: edumazet@google.com pabeni@redhat.com imagedong@tencent.com
netdev/build_clang fail Errors and warnings before: 14998 this patch: 15089
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 4918 this patch: 4918
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 38 lines checked
netdev/kdoc success Errors and warnings before: 2 this patch: 2
netdev/source_inline success Was 0 now: 0

Commit Message

shenjian (K) Sept. 18, 2022, 9:43 a.m. UTC
The function skb_needs_linearize() using netdev_features_t
as parameters.

For the prototype of netdev_features_t will be extended to
be larger than 8 bytes, so change the prototype of the
function, change the prototype of input features to
'netdev_features_t *'.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 include/linux/skbuff.h | 6 +++---
 net/core/dev.c         | 2 +-
 net/core/skbuff.c      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2f163b12c54d..122190c334cb 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -4035,11 +4035,11 @@  skb_header_pointer(const struct sk_buff *skb, int offset, int len, void *buffer)
  *	2. skb is fragmented and the device does not support SG.
  */
 static inline bool skb_needs_linearize(struct sk_buff *skb,
-				       netdev_features_t features)
+				       const netdev_features_t *features)
 {
 	return skb_is_nonlinear(skb) &&
-	       ((skb_has_frag_list(skb) && !(features & NETIF_F_FRAGLIST)) ||
-		(skb_shinfo(skb)->nr_frags && !(features & NETIF_F_SG)));
+	       ((skb_has_frag_list(skb) && !(*features & NETIF_F_FRAGLIST)) ||
+		(skb_shinfo(skb)->nr_frags && !(*features & NETIF_F_SG)));
 }
 
 static inline void skb_copy_from_linear_data(const struct sk_buff *skb,
diff --git a/net/core/dev.c b/net/core/dev.c
index 3436b640db67..b8bb83a65221 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3676,7 +3676,7 @@  static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
 			skb = segs;
 		}
 	} else {
-		if (skb_needs_linearize(skb, features) &&
+		if (skb_needs_linearize(skb, &features) &&
 		    __skb_linearize(skb))
 			goto out_kfree_skb;
 
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 124de0e772fc..3e6935386637 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3973,7 +3973,7 @@  struct sk_buff *skb_segment_list(struct sk_buff *skb,
 						 nskb->data - tnl_hlen,
 						 offset + tnl_hlen);
 
-		if (skb_needs_linearize(nskb, *features) &&
+		if (skb_needs_linearize(nskb, features) &&
 		    __skb_linearize(nskb))
 			goto err_linearize;
 
@@ -3987,7 +3987,7 @@  struct sk_buff *skb_segment_list(struct sk_buff *skb,
 
 	skb->prev = tail;
 
-	if (skb_needs_linearize(skb, *features) &&
+	if (skb_needs_linearize(skb, features) &&
 	    __skb_linearize(skb))
 		goto err_linearize;