udp: avoid one cache line miss in recvmsg()
UDP_SKB_CB(skb)->partial_cov is located at offset 66 in skb, requesting a cold cache line being read in cpu cache. We can avoid this cache line miss for UDP sockets, as partial_cov has a meaning only for UDPLite. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ee9d5461c0
commit
d21dbdfe0a
2 changed files with 4 additions and 2 deletions
|
@ -1389,7 +1389,8 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
|
|||
* coverage checksum (UDP-Lite), do it before the copy.
|
||||
*/
|
||||
|
||||
if (copied < ulen || UDP_SKB_CB(skb)->partial_cov || peeking) {
|
||||
if (copied < ulen || peeking ||
|
||||
(is_udplite && UDP_SKB_CB(skb)->partial_cov)) {
|
||||
checksum_valid = !udp_lib_checksum_complete(skb);
|
||||
if (!checksum_valid)
|
||||
goto csum_copy_err;
|
||||
|
|
|
@ -363,7 +363,8 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
|
|||
* coverage checksum (UDP-Lite), do it before the copy.
|
||||
*/
|
||||
|
||||
if (copied < ulen || UDP_SKB_CB(skb)->partial_cov || peeking) {
|
||||
if (copied < ulen || peeking ||
|
||||
(is_udplite && UDP_SKB_CB(skb)->partial_cov)) {
|
||||
checksum_valid = !udp_lib_checksum_complete(skb);
|
||||
if (!checksum_valid)
|
||||
goto csum_copy_err;
|
||||
|
|
Loading…
Add table
Reference in a new issue