mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
Revert "udp: move udp->gro_enabled to udp->udp_flags"
This reverts commit 753886c0b9 which is
commit e1dc0615c6b08ef36414f08c011965b8fb56198b upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: I7d75a59f256d9e2a5b7e2adb8afc0e649fe8dba6
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -34,7 +34,6 @@ enum {
|
|||||||
UDP_FLAGS_CORK, /* Cork is required */
|
UDP_FLAGS_CORK, /* Cork is required */
|
||||||
UDP_FLAGS_NO_CHECK6_TX, /* Send zero UDP6 checksums on TX? */
|
UDP_FLAGS_NO_CHECK6_TX, /* Send zero UDP6 checksums on TX? */
|
||||||
UDP_FLAGS_NO_CHECK6_RX, /* Allow zero UDP6 checksums on RX? */
|
UDP_FLAGS_NO_CHECK6_RX, /* Allow zero UDP6 checksums on RX? */
|
||||||
UDP_FLAGS_GRO_ENABLED, /* Request GRO aggregation */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct udp_sock {
|
struct udp_sock {
|
||||||
@@ -53,6 +52,7 @@ struct udp_sock {
|
|||||||
* different encapsulation layer set
|
* different encapsulation layer set
|
||||||
* this
|
* this
|
||||||
*/
|
*/
|
||||||
|
gro_enabled:1, /* Request GRO aggregation */
|
||||||
accept_udp_l4:1,
|
accept_udp_l4:1,
|
||||||
accept_udp_fraglist:1;
|
accept_udp_fraglist:1;
|
||||||
/* indicator bits used by pcflag: */
|
/* indicator bits used by pcflag: */
|
||||||
|
|||||||
@@ -1901,7 +1901,7 @@ try_again:
|
|||||||
(struct sockaddr *)sin);
|
(struct sockaddr *)sin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (udp_test_bit(GRO_ENABLED, sk))
|
if (udp_sk(sk)->gro_enabled)
|
||||||
udp_cmsg_recv(msg, sk, skb);
|
udp_cmsg_recv(msg, sk, skb);
|
||||||
|
|
||||||
if (inet->cmsg_flags)
|
if (inet->cmsg_flags)
|
||||||
@@ -2730,7 +2730,7 @@ int udp_lib_setsockopt(struct sock *sk, int level, int optname,
|
|||||||
/* when enabling GRO, accept the related GSO packet type */
|
/* when enabling GRO, accept the related GSO packet type */
|
||||||
if (valbool)
|
if (valbool)
|
||||||
udp_tunnel_encap_enable(sk->sk_socket);
|
udp_tunnel_encap_enable(sk->sk_socket);
|
||||||
udp_assign_bit(GRO_ENABLED, sk, valbool);
|
up->gro_enabled = valbool;
|
||||||
up->accept_udp_l4 = valbool;
|
up->accept_udp_l4 = valbool;
|
||||||
release_sock(sk);
|
release_sock(sk);
|
||||||
break;
|
break;
|
||||||
@@ -2820,7 +2820,7 @@ int udp_lib_getsockopt(struct sock *sk, int level, int optname,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UDP_GRO:
|
case UDP_GRO:
|
||||||
val = udp_test_bit(GRO_ENABLED, sk);
|
val = up->gro_enabled;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* The following two cannot be changed on UDP sockets, the return is
|
/* The following two cannot be changed on UDP sockets, the return is
|
||||||
|
|||||||
@@ -549,10 +549,10 @@ struct sk_buff *udp_gro_receive(struct list_head *head, struct sk_buff *skb,
|
|||||||
NAPI_GRO_CB(skb)->is_flist = 0;
|
NAPI_GRO_CB(skb)->is_flist = 0;
|
||||||
if (!sk || !udp_sk(sk)->gro_receive) {
|
if (!sk || !udp_sk(sk)->gro_receive) {
|
||||||
if (skb->dev->features & NETIF_F_GRO_FRAGLIST)
|
if (skb->dev->features & NETIF_F_GRO_FRAGLIST)
|
||||||
NAPI_GRO_CB(skb)->is_flist = sk ? !udp_test_bit(GRO_ENABLED, sk) : 1;
|
NAPI_GRO_CB(skb)->is_flist = sk ? !udp_sk(sk)->gro_enabled : 1;
|
||||||
|
|
||||||
if ((!sk && (skb->dev->features & NETIF_F_GRO_UDP_FWD)) ||
|
if ((!sk && (skb->dev->features & NETIF_F_GRO_UDP_FWD)) ||
|
||||||
(sk && udp_test_bit(GRO_ENABLED, sk)) || NAPI_GRO_CB(skb)->is_flist)
|
(sk && udp_sk(sk)->gro_enabled) || NAPI_GRO_CB(skb)->is_flist)
|
||||||
return call_gro_receive(udp_gro_receive_segment, head, skb);
|
return call_gro_receive(udp_gro_receive_segment, head, skb);
|
||||||
|
|
||||||
/* no GRO, be sure flush the current packet */
|
/* no GRO, be sure flush the current packet */
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ try_again:
|
|||||||
(struct sockaddr *)sin6);
|
(struct sockaddr *)sin6);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (udp_test_bit(GRO_ENABLED, sk))
|
if (udp_sk(sk)->gro_enabled)
|
||||||
udp_cmsg_recv(msg, sk, skb);
|
udp_cmsg_recv(msg, sk, skb);
|
||||||
|
|
||||||
if (np->rxopt.all)
|
if (np->rxopt.all)
|
||||||
|
|||||||
Reference in New Issue
Block a user