sock: permit SO_ZEROCOPY on PF_RDS socket
allow the application to set SO_ZEROCOPY on the underlying sk of a PF_RDS socket Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ea8994cb01
commit
28190752c7
|
@ -1049,18 +1049,21 @@ set_rcvbuf:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SO_ZEROCOPY:
|
case SO_ZEROCOPY:
|
||||||
if (sk->sk_family != PF_INET && sk->sk_family != PF_INET6)
|
if (sk->sk_family == PF_INET || sk->sk_family == PF_INET6) {
|
||||||
|
if (sk->sk_protocol != IPPROTO_TCP)
|
||||||
|
ret = -ENOTSUPP;
|
||||||
|
else if (sk->sk_state != TCP_CLOSE)
|
||||||
|
ret = -EBUSY;
|
||||||
|
} else if (sk->sk_family != PF_RDS) {
|
||||||
ret = -ENOTSUPP;
|
ret = -ENOTSUPP;
|
||||||
else if (sk->sk_protocol != IPPROTO_TCP)
|
}
|
||||||
ret = -ENOTSUPP;
|
if (!ret) {
|
||||||
else if (sk->sk_state != TCP_CLOSE)
|
if (val < 0 || val > 1)
|
||||||
ret = -EBUSY;
|
ret = -EINVAL;
|
||||||
else if (val < 0 || val > 1)
|
else
|
||||||
ret = -EINVAL;
|
sock_valbool_flag(sk, SOCK_ZEROCOPY, valbool);
|
||||||
else
|
break;
|
||||||
sock_valbool_flag(sk, SOCK_ZEROCOPY, valbool);
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ret = -ENOPROTOOPT;
|
ret = -ENOPROTOOPT;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue