search for: tx_cnt

Displaying 20 results from an estimated 57 matches for "tx_cnt".

Did you mean: rxcnt
2019 Oct 11
4
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...buf_alloc /* max bytes usable by this socket > > [exposed to the other peer] */ > > fwd_cnt /* increased when RX packet is consumed by the > > user space [exposed to the other peer] */ > > tx_cnt /* increased when TX packet is sent to the other peer */ > > > > /* remote vars */ > > peer_buf_alloc /* peer's buf_alloc */ > > peer_fwd_cnt /* peer's fwd_cnt */ > > > > When a peer sends a packet, it incre...
2019 Oct 11
4
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...buf_alloc /* max bytes usable by this socket > > [exposed to the other peer] */ > > fwd_cnt /* increased when RX packet is consumed by the > > user space [exposed to the other peer] */ > > tx_cnt /* increased when TX packet is sent to the other peer */ > > > > /* remote vars */ > > peer_buf_alloc /* peer's buf_alloc */ > > peer_fwd_cnt /* peer's fwd_cnt */ > > > > When a peer sends a packet, it incre...
2019 Jul 29
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...a local counter (increased when the packets are sent) and the remote counter to calculate the credit available: u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit) { u32 ret; spin_lock_bh(&vvs->tx_lock); ret = vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt); if (ret > credit) ret = credit; vvs->tx_cnt += ret; spin_unlock_bh(&vvs->tx_lock); return ret; } Maybe I can play with "buf_alloc" to take care of bytes queued but not used. Thanks, Stefano
2019 Jul 29
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...a local counter (increased when the packets are sent) and the remote counter to calculate the credit available: u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit) { u32 ret; spin_lock_bh(&vvs->tx_lock); ret = vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt); if (ret > credit) ret = credit; vvs->tx_cnt += ret; spin_unlock_bh(&vvs->tx_lock); return ret; } Maybe I can play with "buf_alloc" to take care of bytes queued but not used. Thanks, Stefano
2019 Sep 01
0
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...al vars */ > buf_alloc /* max bytes usable by this socket > [exposed to the other peer] */ > fwd_cnt /* increased when RX packet is consumed by the > user space [exposed to the other peer] */ > tx_cnt /* increased when TX packet is sent to the other peer */ > > /* remote vars */ > peer_buf_alloc /* peer's buf_alloc */ > peer_fwd_cnt /* peer's fwd_cnt */ > > When a peer sends a packet, it increases the 'tx_cnt'; when the...
2015 Dec 10
1
[PATCH v3 1/4] VSOCK: Introduce virtio-vsock-common.ko
...; > + struct vsock_sock *vsk; > + > + u32 buf_size; > + u32 buf_size_min; > + u32 buf_size_max; > + > + struct mutex tx_lock; > + struct mutex rx_lock; > + > + struct list_head rx_queue; > + u32 rx_bytes; > + > + /* Protected by trans->tx_lock */ > + u32 tx_cnt; > + u32 buf_alloc; > + u32 peer_fwd_cnt; > + u32 peer_buf_alloc; > + /* Protected by trans->rx_lock */ > + u32 fwd_cnt; > +}; > + > +struct virtio_vsock_pkt { > + struct virtio_vsock_hdr hdr; > + struct virtio_transport *trans; > + struct work_struct work; >...
2015 Dec 10
1
[PATCH v3 1/4] VSOCK: Introduce virtio-vsock-common.ko
...; > + struct vsock_sock *vsk; > + > + u32 buf_size; > + u32 buf_size_min; > + u32 buf_size_max; > + > + struct mutex tx_lock; > + struct mutex rx_lock; > + > + struct list_head rx_queue; > + u32 rx_bytes; > + > + /* Protected by trans->tx_lock */ > + u32 tx_cnt; > + u32 buf_alloc; > + u32 peer_fwd_cnt; > + u32 peer_buf_alloc; > + /* Protected by trans->rx_lock */ > + u32 fwd_cnt; > +}; > + > +struct virtio_vsock_pkt { > + struct virtio_vsock_hdr hdr; > + struct virtio_transport *trans; > + struct work_struct work; >...
2013 Jun 27
1
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...; > + struct vsock_sock *vsk; > + > + u64 buf_size; > + u64 buf_size_min; > + u64 buf_size_max; > + > + struct mutex tx_lock; > + struct mutex rx_lock; > + > + struct list_head rx_queue; > + u64 rx_bytes; > + > + /* Protected by trans->tx_lock */ > + u64 tx_cnt; > + u64 buf_alloc; > + u64 peer_fwd_cnt; > + u64 peer_buf_alloc; > + /* Protected by trans->rx_lock */ > + u64 fwd_cnt; > +}; > + > +struct virtio_vsock_pkt { > + struct virtio_vsock_hdr hdr; > + struct virtio_transport *trans; > + struct work_struct work; >...
2013 Jun 27
1
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...; > + struct vsock_sock *vsk; > + > + u64 buf_size; > + u64 buf_size_min; > + u64 buf_size_max; > + > + struct mutex tx_lock; > + struct mutex rx_lock; > + > + struct list_head rx_queue; > + u64 rx_bytes; > + > + /* Protected by trans->tx_lock */ > + u64 tx_cnt; > + u64 buf_alloc; > + u64 peer_fwd_cnt; > + u64 peer_buf_alloc; > + /* Protected by trans->rx_lock */ > + u64 fwd_cnt; > +}; > + > +struct virtio_vsock_pkt { > + struct virtio_vsock_hdr hdr; > + struct virtio_transport *trans; > + struct work_struct work; >...
2019 Sep 02
1
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...buf_alloc /* max bytes usable by this socket > > [exposed to the other peer] */ > > fwd_cnt /* increased when RX packet is consumed by the > > user space [exposed to the other peer] */ > > tx_cnt /* increased when TX packet is sent to the other peer */ > > > > /* remote vars */ > > peer_buf_alloc /* peer's buf_alloc */ > > peer_fwd_cnt /* peer's fwd_cnt */ > > > > When a peer sends a packet, it increases...
2023 Mar 23
0
[RFC PATCH v5 2/2] virtio/vsock: check argument to avoid no effect call
...+ b/net/vmw_vsock/virtio_transport_common.c >@@ -302,6 +302,9 @@ u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit) > { > u32 ret; > >+ if (!credit) >+ return 0; >+ > spin_lock_bh(&vvs->tx_lock); > ret = vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt); > if (ret > credit) >@@ -315,6 +318,9 @@ EXPORT_SYMBOL_GPL(virtio_transport_get_credit); > > void virtio_transport_put_credit(struct virtio_vsock_sock *vvs, u32 credit) > { >+ if (!credit) >+ return; >+ > spin_lock_bh(&vvs->tx_lock);...
2019 Oct 11
0
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
.../* max bytes usable by this socket > > > [exposed to the other peer] */ > > > fwd_cnt /* increased when RX packet is consumed by the > > > user space [exposed to the other peer] */ > > > tx_cnt /* increased when TX packet is sent to the other peer */ > > > > > > /* remote vars */ > > > peer_buf_alloc /* peer's buf_alloc */ > > > peer_fwd_cnt /* peer's fwd_cnt */ > > > > > > When a...
2019 Oct 14
0
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
.../* max bytes usable by this socket > > > [exposed to the other peer] */ > > > fwd_cnt /* increased when RX packet is consumed by the > > > user space [exposed to the other peer] */ > > > tx_cnt /* increased when TX packet is sent to the other peer */ > > > > > > /* remote vars */ > > > peer_buf_alloc /* peer's buf_alloc */ > > > peer_fwd_cnt /* peer's fwd_cnt */ > > > > > > When a...
2015 Dec 09
0
[PATCH v3 1/4] VSOCK: Introduce virtio-vsock-common.ko
...e */ +struct virtio_transport { + struct virtio_transport_pkt_ops *ops; + struct vsock_sock *vsk; + + u32 buf_size; + u32 buf_size_min; + u32 buf_size_max; + + struct mutex tx_lock; + struct mutex rx_lock; + + struct list_head rx_queue; + u32 rx_bytes; + + /* Protected by trans->tx_lock */ + u32 tx_cnt; + u32 buf_alloc; + u32 peer_fwd_cnt; + u32 peer_buf_alloc; + /* Protected by trans->rx_lock */ + u32 fwd_cnt; +}; + +struct virtio_vsock_pkt { + struct virtio_vsock_hdr hdr; + struct virtio_transport *trans; + struct work_struct work; + struct list_head list; + void *buf; + u32 len; + u32 off;...
2013 Jun 27
0
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...e */ +struct virtio_transport { + struct virtio_transport_pkt_ops *ops; + struct vsock_sock *vsk; + + u64 buf_size; + u64 buf_size_min; + u64 buf_size_max; + + struct mutex tx_lock; + struct mutex rx_lock; + + struct list_head rx_queue; + u64 rx_bytes; + + /* Protected by trans->tx_lock */ + u64 tx_cnt; + u64 buf_alloc; + u64 peer_fwd_cnt; + u64 peer_buf_alloc; + /* Protected by trans->rx_lock */ + u64 fwd_cnt; +}; + +struct virtio_vsock_pkt { + struct virtio_vsock_hdr hdr; + struct virtio_transport *trans; + struct work_struct work; + struct list_head list; + void *buf; + u32 len; + u32 off;...
2019 Jul 17
1
[PATCH v4 3/5] vsock/virtio: fix locking in virtio_transport_inc_tx_pkt()
...diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h > index 49fc9d20bc43..4c7781f4b29b 100644 > --- a/include/linux/virtio_vsock.h > +++ b/include/linux/virtio_vsock.h > @@ -35,7 +35,6 @@ struct virtio_vsock_sock { > > /* Protected by tx_lock */ > u32 tx_cnt; > - u32 buf_alloc; > u32 peer_fwd_cnt; > u32 peer_buf_alloc; > > @@ -43,6 +42,7 @@ struct virtio_vsock_sock { > u32 fwd_cnt; > u32 last_fwd_cnt; > u32 rx_bytes; > + u32 buf_alloc; > struct list_head rx_queue; > }; > > diff --git a/net/vmw_vso...
2019 Jul 30
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...counter to calculate the credit available: > > > > u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit) > > { > > u32 ret; > > > > spin_lock_bh(&vvs->tx_lock); > > ret = vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt); > > if (ret > credit) > > ret = credit; > > vvs->tx_cnt += ret; > > spin_unlock_bh(&vvs->tx_lock); > > > > return ret; > > } > > > > Maybe I can play with "buf_alloc&quot...
2019 Jul 30
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...counter to calculate the credit available: > > > > u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit) > > { > > u32 ret; > > > > spin_lock_bh(&vvs->tx_lock); > > ret = vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt); > > if (ret > credit) > > ret = credit; > > vvs->tx_cnt += ret; > > spin_unlock_bh(&vvs->tx_lock); > > > > return ret; > > } > > > > Maybe I can play with "buf_alloc&quot...
2019 Jul 29
0
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...; packets are sent) and the remote counter to calculate the credit available: > > u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit) > { > u32 ret; > > spin_lock_bh(&vvs->tx_lock); > ret = vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt); > if (ret > credit) > ret = credit; > vvs->tx_cnt += ret; > spin_unlock_bh(&vvs->tx_lock); > > return ret; > } > > Maybe I can play with "buf_alloc" to take care of bytes queued but not > u...
2013 Jun 27
13
[RFC 0/5] Introduce VM Sockets virtio transport
...TIO_VSOCK_OP_REQUEST to server 2) Server reponses with VIRTIO_VSOCK_OP_NEGOTIATE to client 3) Client sends VIRTIO_VSOCK_OP_OFFER to server 4) Server responses with VIRTIO_VSOCK_OP_ATTACH to client Virtio VM socket credit update: Virtio VM socket uses credit-based flow control. The sender maintains tx_cnt which counts the totoal number of bytes it has sent out, peer_fwd_cnt which counts the totoal number of byes the receiver has forwarded, and peer_buf_alloc which is the size of the receiver's receive buffer. The sender can send no more than the credit the receiver gives to the sender: credit =...