]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: remove sk_route_forced_caps
authorEric Dumazet <edumazet@google.com>
Mon, 15 Nov 2021 19:02:34 +0000 (11:02 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Nov 2021 13:10:34 +0000 (13:10 +0000)
We were only using one bit, and we can replace it by sk_is_tcp()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/core/sock.c
net/ipv4/tcp.c

index 5bdeffdea5ecdb6069d13906bbf872d4479a1ce7..ebad629dd9eda4bcec6f621cf2d4f783f293b7b7 100644 (file)
@@ -285,8 +285,6 @@ struct bpf_local_storage;
   *    @sk_no_check_rx: allow zero checksum in RX packets
   *    @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
   *    @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK)
-  *    @sk_route_forced_caps: static, forced route capabilities
-  *            (set in tcp_init_sock())
   *    @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)
   *    @sk_gso_max_size: Maximum GSO segment size to build
   *    @sk_gso_max_segs: Maximum number of GSO segments
@@ -461,7 +459,6 @@ struct sock {
        struct page_frag        sk_frag;
        netdev_features_t       sk_route_caps;
        netdev_features_t       sk_route_nocaps;
-       netdev_features_t       sk_route_forced_caps;
        int                     sk_gso_type;
        unsigned int            sk_gso_max_size;
        gfp_t                   sk_allocation;
index 0be8e43f44b9e68678f4e20c3a86324ba1bfe03e..257b5fa604804ea671c0dbede4455ade8d65ede8 100644 (file)
@@ -2244,7 +2244,9 @@ void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
        u32 max_segs = 1;
 
        sk_dst_set(sk, dst);
-       sk->sk_route_caps = dst->dev->features | sk->sk_route_forced_caps;
+       sk->sk_route_caps = dst->dev->features;
+       if (sk_is_tcp(sk))
+               sk->sk_route_caps |= NETIF_F_GSO;
        if (sk->sk_route_caps & NETIF_F_GSO)
                sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE;
        sk->sk_route_caps &= ~sk->sk_route_nocaps;
index b7796b4cf0a099e9f14b28e50cb07367021a7cbf..4fa4b29260bd4c08da70b3fb199e3459013114f3 100644 (file)
@@ -456,7 +456,6 @@ void tcp_init_sock(struct sock *sk)
        WRITE_ONCE(sk->sk_rcvbuf, sock_net(sk)->ipv4.sysctl_tcp_rmem[1]);
 
        sk_sockets_allocated_inc(sk);
-       sk->sk_route_forced_caps = NETIF_F_GSO;
 }
 EXPORT_SYMBOL(tcp_init_sock);