mirror of https://gitee.com/openkylin/linux.git
net: Drop unecessary enc_features variable from tunnel segmentation functions
The enc_features variable isn't necessary since features isn't used anywhere after we create enc_features so instead just use a destructive AND on features itself and save ourselves the variable declaration. Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Acked-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a060679c6b
commit
bef3c6c937
|
@ -19,7 +19,6 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
|
||||||
netdev_features_t features)
|
netdev_features_t features)
|
||||||
{
|
{
|
||||||
struct sk_buff *segs = ERR_PTR(-EINVAL);
|
struct sk_buff *segs = ERR_PTR(-EINVAL);
|
||||||
netdev_features_t enc_features;
|
|
||||||
int ghl;
|
int ghl;
|
||||||
struct gre_base_hdr *greh;
|
struct gre_base_hdr *greh;
|
||||||
u16 mac_offset = skb->mac_header;
|
u16 mac_offset = skb->mac_header;
|
||||||
|
@ -68,9 +67,10 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
|
||||||
skb_set_network_header(skb, skb_inner_network_offset(skb));
|
skb_set_network_header(skb, skb_inner_network_offset(skb));
|
||||||
skb->mac_len = skb_inner_network_offset(skb);
|
skb->mac_len = skb_inner_network_offset(skb);
|
||||||
|
|
||||||
|
features &= skb->dev->hw_enc_features;
|
||||||
|
|
||||||
/* segment inner packet. */
|
/* segment inner packet. */
|
||||||
enc_features = skb->dev->hw_enc_features & features;
|
segs = skb_mac_gso_segment(skb, features);
|
||||||
segs = skb_mac_gso_segment(skb, enc_features);
|
|
||||||
if (IS_ERR_OR_NULL(segs)) {
|
if (IS_ERR_OR_NULL(segs)) {
|
||||||
skb_gso_error_unwind(skb, protocol, ghl, mac_offset, mac_len);
|
skb_gso_error_unwind(skb, protocol, ghl, mac_offset, mac_len);
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -37,7 +37,6 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
|
||||||
int mac_len = skb->mac_len;
|
int mac_len = skb->mac_len;
|
||||||
int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb);
|
int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb);
|
||||||
__be16 protocol = skb->protocol;
|
__be16 protocol = skb->protocol;
|
||||||
netdev_features_t enc_features;
|
|
||||||
int udp_offset, outer_hlen;
|
int udp_offset, outer_hlen;
|
||||||
unsigned int oldlen;
|
unsigned int oldlen;
|
||||||
bool need_csum = !!(skb_shinfo(skb)->gso_type &
|
bool need_csum = !!(skb_shinfo(skb)->gso_type &
|
||||||
|
@ -65,9 +64,10 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
|
||||||
(skb->dev->features & (is_ipv6 ?
|
(skb->dev->features & (is_ipv6 ?
|
||||||
NETIF_F_IPV6_CSUM : NETIF_F_IP_CSUM))));
|
NETIF_F_IPV6_CSUM : NETIF_F_IP_CSUM))));
|
||||||
|
|
||||||
|
features &= skb->dev->hw_enc_features;
|
||||||
|
|
||||||
/* segment inner packet. */
|
/* segment inner packet. */
|
||||||
enc_features = skb->dev->hw_enc_features & features;
|
segs = gso_inner_segment(skb, features);
|
||||||
segs = gso_inner_segment(skb, enc_features);
|
|
||||||
if (IS_ERR_OR_NULL(segs)) {
|
if (IS_ERR_OR_NULL(segs)) {
|
||||||
skb_gso_error_unwind(skb, protocol, tnl_hlen, mac_offset,
|
skb_gso_error_unwind(skb, protocol, tnl_hlen, mac_offset,
|
||||||
mac_len);
|
mac_len);
|
||||||
|
|
Loading…
Reference in New Issue