Skip to content
Permalink
Browse files
net: inline part of skb_csum_hwoffload_help
Inline a HW csum'ed part of skb_csum_hwoffload_help().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
  • Loading branch information
isilence authored and intel-lab-lkp committed Jan 11, 2022
1 parent 888baf6 commit e90b74891027be09208b388b5ff57657fce17c4a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
@@ -4908,8 +4908,20 @@ void netdev_rss_key_fill(void *buffer, size_t len);

int skb_checksum_help(struct sk_buff *skb);
int skb_crc32c_csum_help(struct sk_buff *skb);
int skb_csum_hwoffload_help(struct sk_buff *skb,
const netdev_features_t features);
int __skb_csum_hwoffload_help(struct sk_buff *skb,
const netdev_features_t features);

static inline int skb_csum_hwoffload_help(struct sk_buff *skb,
const netdev_features_t features)
{
if (unlikely(skb_csum_is_sctp(skb)))
return !!(features & NETIF_F_SCTP_CRC) ? 0 :
skb_crc32c_csum_help(skb);

if (features & NETIF_F_HW_CSUM)
return 0;
return __skb_csum_hwoffload_help(skb, features);
}

struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
netdev_features_t features, bool tx_path);
@@ -3630,16 +3630,9 @@ static struct sk_buff *validate_xmit_vlan(struct sk_buff *skb,
return skb;
}

int skb_csum_hwoffload_help(struct sk_buff *skb,
const netdev_features_t features)
int __skb_csum_hwoffload_help(struct sk_buff *skb,
const netdev_features_t features)
{
if (unlikely(skb_csum_is_sctp(skb)))
return !!(features & NETIF_F_SCTP_CRC) ? 0 :
skb_crc32c_csum_help(skb);

if (features & NETIF_F_HW_CSUM)
return 0;

if (features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) {
switch (skb->csum_offset) {
case offsetof(struct tcphdr, check):
@@ -3650,7 +3643,7 @@ int skb_csum_hwoffload_help(struct sk_buff *skb,

return skb_checksum_help(skb);
}
EXPORT_SYMBOL(skb_csum_hwoffload_help);
EXPORT_SYMBOL(__skb_csum_hwoffload_help);

static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device *dev, bool *again)
{

0 comments on commit e90b748

Please sign in to comment.