@@ -4809,24 +4809,24 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb,
}
__be16 skb_network_protocol(struct sk_buff *skb, int *depth);
-static inline bool can_checksum_protocol(netdev_features_t features,
+static inline bool can_checksum_protocol(const netdev_features_t *features,
__be16 protocol)
{
if (protocol == htons(ETH_P_FCOE))
- return netdev_feature_test(NETIF_F_FCOE_CRC_BIT, features);
+ return netdev_feature_test(NETIF_F_FCOE_CRC_BIT, *features);
/* Assume this is an IP checksum (not SCTP CRC) */
- if (netdev_feature_test(NETIF_F_HW_CSUM_BIT, features)) {
+ if (netdev_feature_test(NETIF_F_HW_CSUM_BIT, *features)) {
/* Can checksum everything */
return true;
}
switch (protocol) {
case htons(ETH_P_IP):
- return netdev_feature_test(NETIF_F_IP_CSUM_BIT, features);
+ return netdev_feature_test(NETIF_F_IP_CSUM_BIT, *features);
case htons(ETH_P_IPV6):
- return netdev_feature_test(NETIF_F_IPV6_CSUM_BIT, features);
+ return netdev_feature_test(NETIF_F_IPV6_CSUM_BIT, *features);
default:
return false;
}
@@ -372,7 +372,7 @@ static inline void vxlan_features_check(struct sk_buff *skb,
(skb_inner_mac_header(skb) - skb_transport_header(skb) !=
sizeof(struct udphdr) + sizeof(struct vxlanhdr)) ||
(skb->ip_summed != CHECKSUM_NONE &&
- !can_checksum_protocol(*features, inner_eth_hdr(skb)->h_proto)))) {
+ !can_checksum_protocol(features, inner_eth_hdr(skb)->h_proto)))) {
netdev_features_clear(*features, netdev_csum_gso_features_mask);
return;
}
@@ -3485,7 +3485,7 @@ static void harmonize_features(struct sk_buff *skb, netdev_features_t *features)
net_mpls_features(skb, features, type);
if (skb->ip_summed != CHECKSUM_NONE &&
- !can_checksum_protocol(*features, type)) {
+ !can_checksum_protocol(features, type)) {
netdev_features_clear(*features,
netdev_csum_gso_features_mask);
}
@@ -4060,7 +4060,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
return ERR_PTR(-EINVAL);
sg = netdev_feature_test(NETIF_F_SG_BIT, features);
- csum = !!can_checksum_protocol(features, proto);
+ csum = !!can_checksum_protocol(&features, proto);
if (sg && csum && (mss != GSO_BY_FRAGS)) {
if (!netdev_feature_test(NETIF_F_GSO_PARTIAL_BIT, features)) {
The function can_checksum_protocol() using netdev_features_t as parameters. For the prototype of netdev_features_t will be extended to be largerthan 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/netdevice.h | 10 +++++----- include/net/vxlan.h | 2 +- net/core/dev.c | 2 +- net/core/skbuff.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)