Displaying 20 results from an estimated 94 matches for "sk_type".
2019 Oct 23
0
[PATCH net-next 08/14] vsock: add vsock_create_connected() called by transports
...k_release(struct sock *sk, int level)
{
@@ -705,6 +704,13 @@ static int vsock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
return err;
}
+struct sock *vsock_create_connected(struct sock *parent)
+{
+ return __vsock_create(sock_net(parent), NULL, parent, GFP_KERNEL,
+ parent->sk_type, 0);
+}
+EXPORT_SYMBOL_GPL(vsock_create_connected);
+
s64 vsock_stream_has_data(struct vsock_sock *vsk)
{
return vsk->transport->stream_has_data(vsk);
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index d62297a62ca6..0ce792a1bf6c 100644
--- a/net/vmw_vso...
2023 Aug 22
0
[RFC PATCH v1 1/2] vsock: send SIGPIPE on write to shutdowned socket
...gt; +++ b/net/vmw_vsock/af_vsock.c
>>>>> @@ -1921,6 +1921,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg,
>>>>> ??????????? err = total_written;
>>>>> ????}
>>>>> out:
>>>>> +??? if (sk->sk_type == SOCK_STREAM)
>>>>> +??????? err = sk_stream_error(sk, msg->msg_flags, err);
>>>>
>>>> Do you know why we don't need this for SOCK_SEQPACKET and SOCK_DGRAM?
>>>
>>> Yes, here is my explanation:
>>>
>>> This function...
2019 May 10
1
[PATCH v2 2/8] vsock/virtio: free packets during the socket release
...k_sock *vsk)
>
> void virtio_transport_release(struct vsock_sock *vsk)
> {
> + struct virtio_vsock_sock *vvs = vsk->trans;
> + struct virtio_vsock_buf *buf;
> struct sock *sk = &vsk->sk;
> bool remove_sock = true;
>
> lock_sock(sk);
> if (sk->sk_type == SOCK_STREAM)
> remove_sock = virtio_transport_close(vsk);
> + while (!list_empty(&vvs->rx_queue)) {
> + buf = list_first_entry(&vvs->rx_queue,
> + struct virtio_vsock_buf, list);
Please use list_for_each_entry_safe().
2019 Oct 23
2
[PATCH net-next 11/14] vsock: add multi-transports support
...e CID <= VMADDR_CID_HOST will use guest->host transport
> + */
> +int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
> +{
> + const struct vsock_transport *new_transport;
> + struct sock *sk = sk_vsock(vsk);
> +
> + switch (sk->sk_type) {
> + case SOCK_DGRAM:
> + new_transport = transport_dgram;
> + break;
> + case SOCK_STREAM:
> + if (vsk->remote_addr.svm_cid > VMADDR_CID_HOST)
> + new_transport = transport_h2g;
> +...
2019 Oct 23
2
[PATCH net-next 11/14] vsock: add multi-transports support
...e CID <= VMADDR_CID_HOST will use guest->host transport
> + */
> +int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
> +{
> + const struct vsock_transport *new_transport;
> + struct sock *sk = sk_vsock(vsk);
> +
> + switch (sk->sk_type) {
> + case SOCK_DGRAM:
> + new_transport = transport_dgram;
> + break;
> + case SOCK_STREAM:
> + if (vsk->remote_addr.svm_cid > VMADDR_CID_HOST)
> + new_transport = transport_h2g;
> +...
2019 Oct 23
0
[PATCH net-next 11/14] vsock: add multi-transports support
...D_HOST will use host->guest transport
+ * - remote CID <= VMADDR_CID_HOST will use guest->host transport
+ */
+int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
+{
+ const struct vsock_transport *new_transport;
+ struct sock *sk = sk_vsock(vsk);
+
+ switch (sk->sk_type) {
+ case SOCK_DGRAM:
+ new_transport = transport_dgram;
+ break;
+ case SOCK_STREAM:
+ if (vsk->remote_addr.svm_cid > VMADDR_CID_HOST)
+ new_transport = transport_h2g;
+ else
+ new_transport = transport_g2h;
+ break;
+ default:
+ return -ESOCKTNOSUPPORT;
+ }
+
+ if (vsk->transpo...
2019 Sep 27
0
[RFC PATCH 10/13] vsock: add multi-transports support
...R_CID_HOST will use guest->host transport
+ */
+int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
+{
+ struct sock *sk = sk_vsock(vsk);
+ /* RFC-TODO: should vsk->transport be already assigned?
+ * How to handle?
+ */
+ WARN_ON(vsk->transport);
+
+ switch (sk->sk_type) {
+ case SOCK_DGRAM:
+ vsk->transport = transport_dgram;
+ break;
+ case SOCK_STREAM:
+ if (vsk->remote_addr.svm_cid > VMADDR_CID_HOST)
+ vsk->transport = transport_h2g;
+ else
+ vsk->transport = transport_g2h;
+ break;
+ default:
+ return -ESOCKTNOSUPPORT;
+ }
+
+ if (!vs...
2019 May 10
0
[PATCH v2 2/8] vsock/virtio: free packets during the socket release
...@@ static bool virtio_transport_close(struct vsock_sock *vsk)
void virtio_transport_release(struct vsock_sock *vsk)
{
+ struct virtio_vsock_sock *vvs = vsk->trans;
+ struct virtio_vsock_buf *buf;
struct sock *sk = &vsk->sk;
bool remove_sock = true;
lock_sock(sk);
if (sk->sk_type == SOCK_STREAM)
remove_sock = virtio_transport_close(vsk);
+ while (!list_empty(&vvs->rx_queue)) {
+ buf = list_first_entry(&vvs->rx_queue,
+ struct virtio_vsock_buf, list);
+ list_del(&buf->list);
+ virtio_transport_free_buf(buf);
+ }
release_sock(sk);
if...
2019 May 17
1
[PATCH v3] vsock/virtio: free packets during the socket release
...atic bool virtio_transport_close(struct vsock_sock *vsk)
void virtio_transport_release(struct vsock_sock *vsk)
{
+ struct virtio_vsock_sock *vvs = vsk->trans;
+ struct virtio_vsock_pkt *pkt, *tmp;
struct sock *sk = &vsk->sk;
bool remove_sock = true;
lock_sock(sk);
if (sk->sk_type == SOCK_STREAM)
remove_sock = virtio_transport_close(vsk);
+
+ list_for_each_entry_safe(pkt, tmp, &vvs->rx_queue, list) {
+ list_del(&pkt->list);
+ virtio_transport_free_pkt(pkt);
+ }
release_sock(sk);
if (remove_sock)
--
2.20.1
2019 Oct 30
0
[PATCH net-next 11/14] vsock: add multi-transports support
...HOST will use guest->host transport
> > +*/ int vsock_assign_transport(struct vsock_sock *vsk, struct
> > +vsock_sock *psk) {
> > + const struct vsock_transport *new_transport;
> > + struct sock *sk = sk_vsock(vsk);
> > +
> > + switch (sk->sk_type) {
> > + case SOCK_DGRAM:
> > + new_transport = transport_dgram;
> > + break;
> > + case SOCK_STREAM:
> > + if (vsk->remote_addr.svm_cid > VMADDR_CID_HOST)
> > + new_transport = tra...
2023 Aug 31
0
[RFC PATCH v2 1/2] vsock: send SIGPIPE on write to shutdowned socket
..._vsock/af_vsock.c
>index 020cf17ab7e4..013b65241b65 100644
>--- a/net/vmw_vsock/af_vsock.c
>+++ b/net/vmw_vsock/af_vsock.c
>@@ -1921,6 +1921,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg,
> err = total_written;
> }
> out:
>+ if (sk->sk_type == SOCK_STREAM)
>+ err = sk_stream_error(sk, msg->msg_flags, err);
>+
> release_sock(sk);
> return err;
> }
>--
>2.25.1
>
2019 Nov 11
2
[PATCH net-next 11/14] vsock: add multi-transports support
...nsport
> + * - remote CID <= VMADDR_CID_HOST will use guest->host transport */
> +int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock
> +*psk) {
> + const struct vsock_transport *new_transport;
> + struct sock *sk = sk_vsock(vsk);
> +
> + switch (sk->sk_type) {
> + case SOCK_DGRAM:
> + new_transport = transport_dgram;
> + break;
> + case SOCK_STREAM:
> + if (vsk->remote_addr.svm_cid > VMADDR_CID_HOST)
> + new_transport = transport_h2g;
> + else
> + new_transport = transport_g2h;
> + break;
You already mentione...
2019 Nov 11
2
[PATCH net-next 11/14] vsock: add multi-transports support
...nsport
> + * - remote CID <= VMADDR_CID_HOST will use guest->host transport */
> +int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock
> +*psk) {
> + const struct vsock_transport *new_transport;
> + struct sock *sk = sk_vsock(vsk);
> +
> + switch (sk->sk_type) {
> + case SOCK_DGRAM:
> + new_transport = transport_dgram;
> + break;
> + case SOCK_STREAM:
> + if (vsk->remote_addr.svm_cid > VMADDR_CID_HOST)
> + new_transport = transport_h2g;
> + else
> + new_transport = transport_g2h;
> + break;
You already mentione...
2023 Aug 04
0
[RFC PATCH v1 1/2] vsock: send SIGPIPE on write to shutdowned socket
...--- a/net/vmw_vsock/af_vsock.c
>>> +++ b/net/vmw_vsock/af_vsock.c
>>> @@ -1921,6 +1921,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg,
>>> ??????????? err = total_written;
>>> ????}
>>> out:
>>> +??? if (sk->sk_type == SOCK_STREAM)
>>> +??????? err = sk_stream_error(sk, msg->msg_flags, err);
>>
>> Do you know why we don't need this for SOCK_SEQPACKET and SOCK_DGRAM?
>
>Yes, here is my explanation:
>
>This function checks that input error is SIGPIPE, and if so it sends SI...
2023 Aug 04
0
[RFC PATCH v1 1/2] vsock: send SIGPIPE on write to shutdowned socket
...gt; +++ b/net/vmw_vsock/af_vsock.c
>>>>> @@ -1921,6 +1921,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg,
>>>>> ??????????? err = total_written;
>>>>> ????}
>>>>> out:
>>>>> +??? if (sk->sk_type == SOCK_STREAM)
>>>>> +??????? err = sk_stream_error(sk, msg->msg_flags, err);
>>>>
>>>> Do you know why we don't need this for SOCK_SEQPACKET and SOCK_DGRAM?
>>>
>>> Yes, here is my explanation:
>>>
>>> This function...
2019 Oct 01
0
[PATCH net v3] vsock: Fix a lockdep warning in __vsock_release()
...t; +++ b/net/vmw_vsock/virtio_transport_common.c
> @@ -820,7 +820,7 @@ void virtio_transport_release(struct vsock_sock *vsk)
> struct sock *sk = &vsk->sk;
> bool remove_sock = true;
>
> - lock_sock(sk);
> + lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
> if (sk->sk_type == SOCK_STREAM)
> remove_sock = virtio_transport_close(vsk);
>
> --
> 2.19.1
>
--
2019 Sep 26
0
[PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()
...t; +++ b/net/vmw_vsock/virtio_transport_common.c
> @@ -820,7 +820,7 @@ void virtio_transport_release(struct vsock_sock *vsk)
> struct sock *sk = &vsk->sk;
> bool remove_sock = true;
>
> - lock_sock(sk);
> + lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
> if (sk->sk_type == SOCK_STREAM)
> remove_sock = virtio_transport_close(vsk);
>
Thanks,
Stefano
2023 Mar 10
0
[PATCH net-next v3 0/3] vsock: add support for sockmap
...in v2:
> - vsock/bpf: rename vsock_dgram_* -> vsock_*
> - vsock/bpf: change sk_psock_{get,put} and {lock,release}_sock() order
> to minimize slock hold time
> - vsock/bpf: use "new style" wait
> - vsock/bpf: fix bug in wait log
> - vsock/bpf: add check that recvmsg sk_type is one dgram, seqpacket, or
> stream. Return error if not one of the three.
> - virtio/vsock: comment __skb_recv_datagram() usage
> - virtio/vsock: do not init copied in read_skb()
> - vsock/bpf: add ifdef guard around struct proto in dgram_recvmsg()
> - selftests/bpf: add vsock l...
2019 Nov 14
15
[PATCH net-next v2 00/15] vsock: add multi-transports support
Most of the patches are reviewed by Dexuan, Stefan, and Jorgen.
The following patches need reviews:
- [11/15] vsock: add multi-transports support
- [12/15] vsock/vmci: register vmci_transport only when VMCI guest/host
are active
- [15/15] vhost/vsock: refuse CID assigned to the guest->host transport
RFC: https://patchwork.ozlabs.org/cover/1168442/
v1:
2023 Aug 22
0
[RFC PATCH v1 1/2] vsock: send SIGPIPE on write to shutdowned socket
...gt;>>>>> @@ -1921,6 +1921,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg,
>>>>>>> ??????????? err = total_written;
>>>>>>> ????}
>>>>>>> out:
>>>>>>> +??? if (sk->sk_type == SOCK_STREAM)
>>>>>>> +??????? err = sk_stream_error(sk, msg->msg_flags, err);
>>>>>>
>>>>>> Do you know why we don't need this for SOCK_SEQPACKET and SOCK_DGRAM?
>>>>>
>>>>> Yes, here is my explanation:...