vsock              66 drivers/vhost/vsock.c 	struct vhost_vsock *vsock;
vsock              68 drivers/vhost/vsock.c 	hash_for_each_possible_rcu(vhost_vsock_hash, vsock, hash, guest_cid) {
vsock              69 drivers/vhost/vsock.c 		u32 other_cid = vsock->guest_cid;
vsock              76 drivers/vhost/vsock.c 			return vsock;
vsock              84 drivers/vhost/vsock.c vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
vsock              87 drivers/vhost/vsock.c 	struct vhost_virtqueue *tx_vq = &vsock->vqs[VSOCK_VQ_TX];
vsock              98 drivers/vhost/vsock.c 	vhost_disable_notify(&vsock->dev, vq);
vsock             108 drivers/vhost/vsock.c 		spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             109 drivers/vhost/vsock.c 		if (list_empty(&vsock->send_pkt_list)) {
vsock             110 drivers/vhost/vsock.c 			spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             111 drivers/vhost/vsock.c 			vhost_enable_notify(&vsock->dev, vq);
vsock             115 drivers/vhost/vsock.c 		pkt = list_first_entry(&vsock->send_pkt_list,
vsock             118 drivers/vhost/vsock.c 		spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             123 drivers/vhost/vsock.c 			spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             124 drivers/vhost/vsock.c 			list_add(&pkt->list, &vsock->send_pkt_list);
vsock             125 drivers/vhost/vsock.c 			spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             130 drivers/vhost/vsock.c 			spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             131 drivers/vhost/vsock.c 			list_add(&pkt->list, &vsock->send_pkt_list);
vsock             132 drivers/vhost/vsock.c 			spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             137 drivers/vhost/vsock.c 			if (unlikely(vhost_enable_notify(&vsock->dev, vq))) {
vsock             138 drivers/vhost/vsock.c 				vhost_disable_notify(&vsock->dev, vq);
vsock             199 drivers/vhost/vsock.c 			spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             200 drivers/vhost/vsock.c 			list_add(&pkt->list, &vsock->send_pkt_list);
vsock             201 drivers/vhost/vsock.c 			spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             206 drivers/vhost/vsock.c 				val = atomic_dec_return(&vsock->queued_replies);
vsock             219 drivers/vhost/vsock.c 		vhost_signal(&vsock->dev, vq);
vsock             231 drivers/vhost/vsock.c 	struct vhost_vsock *vsock;
vsock             233 drivers/vhost/vsock.c 	vsock = container_of(work, struct vhost_vsock, send_pkt_work);
vsock             234 drivers/vhost/vsock.c 	vq = &vsock->vqs[VSOCK_VQ_RX];
vsock             236 drivers/vhost/vsock.c 	vhost_transport_do_send_pkt(vsock, vq);
vsock             242 drivers/vhost/vsock.c 	struct vhost_vsock *vsock;
vsock             248 drivers/vhost/vsock.c 	vsock = vhost_vsock_get(le64_to_cpu(pkt->hdr.dst_cid));
vsock             249 drivers/vhost/vsock.c 	if (!vsock) {
vsock             256 drivers/vhost/vsock.c 		atomic_inc(&vsock->queued_replies);
vsock             258 drivers/vhost/vsock.c 	spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             259 drivers/vhost/vsock.c 	list_add_tail(&pkt->list, &vsock->send_pkt_list);
vsock             260 drivers/vhost/vsock.c 	spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             262 drivers/vhost/vsock.c 	vhost_work_queue(&vsock->dev, &vsock->send_pkt_work);
vsock             271 drivers/vhost/vsock.c 	struct vhost_vsock *vsock;
vsock             280 drivers/vhost/vsock.c 	vsock = vhost_vsock_get(vsk->remote_addr.svm_cid);
vsock             281 drivers/vhost/vsock.c 	if (!vsock)
vsock             284 drivers/vhost/vsock.c 	spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             285 drivers/vhost/vsock.c 	list_for_each_entry_safe(pkt, n, &vsock->send_pkt_list, list) {
vsock             290 drivers/vhost/vsock.c 	spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             300 drivers/vhost/vsock.c 		struct vhost_virtqueue *tx_vq = &vsock->vqs[VSOCK_VQ_TX];
vsock             303 drivers/vhost/vsock.c 		new_cnt = atomic_sub_return(cnt, &vsock->queued_replies);
vsock             376 drivers/vhost/vsock.c static bool vhost_vsock_more_replies(struct vhost_vsock *vsock)
vsock             378 drivers/vhost/vsock.c 	struct vhost_virtqueue *vq = &vsock->vqs[VSOCK_VQ_TX];
vsock             382 drivers/vhost/vsock.c 	val = atomic_read(&vsock->queued_replies);
vsock             391 drivers/vhost/vsock.c 	struct vhost_vsock *vsock = container_of(vq->dev, struct vhost_vsock,
vsock             403 drivers/vhost/vsock.c 	vhost_disable_notify(&vsock->dev, vq);
vsock             407 drivers/vhost/vsock.c 		if (!vhost_vsock_more_replies(vsock)) {
vsock             421 drivers/vhost/vsock.c 			if (unlikely(vhost_enable_notify(&vsock->dev, vq))) {
vsock             422 drivers/vhost/vsock.c 				vhost_disable_notify(&vsock->dev, vq);
vsock             440 drivers/vhost/vsock.c 		if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid &&
vsock             455 drivers/vhost/vsock.c 		vhost_signal(&vsock->dev, vq);
vsock             465 drivers/vhost/vsock.c 	struct vhost_vsock *vsock = container_of(vq->dev, struct vhost_vsock,
vsock             468 drivers/vhost/vsock.c 	vhost_transport_do_send_pkt(vsock, vq);
vsock             471 drivers/vhost/vsock.c static int vhost_vsock_start(struct vhost_vsock *vsock)
vsock             477 drivers/vhost/vsock.c 	mutex_lock(&vsock->dev.mutex);
vsock             479 drivers/vhost/vsock.c 	ret = vhost_dev_check_owner(&vsock->dev);
vsock             483 drivers/vhost/vsock.c 	for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++) {
vsock             484 drivers/vhost/vsock.c 		vq = &vsock->vqs[i];
vsock             494 drivers/vhost/vsock.c 			vq->private_data = vsock;
vsock             506 drivers/vhost/vsock.c 	vhost_work_queue(&vsock->dev, &vsock->send_pkt_work);
vsock             508 drivers/vhost/vsock.c 	mutex_unlock(&vsock->dev.mutex);
vsock             515 drivers/vhost/vsock.c 	for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++) {
vsock             516 drivers/vhost/vsock.c 		vq = &vsock->vqs[i];
vsock             523 drivers/vhost/vsock.c 	mutex_unlock(&vsock->dev.mutex);
vsock             527 drivers/vhost/vsock.c static int vhost_vsock_stop(struct vhost_vsock *vsock)
vsock             532 drivers/vhost/vsock.c 	mutex_lock(&vsock->dev.mutex);
vsock             534 drivers/vhost/vsock.c 	ret = vhost_dev_check_owner(&vsock->dev);
vsock             538 drivers/vhost/vsock.c 	for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++) {
vsock             539 drivers/vhost/vsock.c 		struct vhost_virtqueue *vq = &vsock->vqs[i];
vsock             547 drivers/vhost/vsock.c 	mutex_unlock(&vsock->dev.mutex);
vsock             551 drivers/vhost/vsock.c static void vhost_vsock_free(struct vhost_vsock *vsock)
vsock             553 drivers/vhost/vsock.c 	kvfree(vsock);
vsock             559 drivers/vhost/vsock.c 	struct vhost_vsock *vsock;
vsock             565 drivers/vhost/vsock.c 	vsock = kvmalloc(sizeof(*vsock), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
vsock             566 drivers/vhost/vsock.c 	if (!vsock)
vsock             569 drivers/vhost/vsock.c 	vqs = kmalloc_array(ARRAY_SIZE(vsock->vqs), sizeof(*vqs), GFP_KERNEL);
vsock             575 drivers/vhost/vsock.c 	vsock->guest_cid = 0; /* no CID assigned yet */
vsock             577 drivers/vhost/vsock.c 	atomic_set(&vsock->queued_replies, 0);
vsock             579 drivers/vhost/vsock.c 	vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX];
vsock             580 drivers/vhost/vsock.c 	vqs[VSOCK_VQ_RX] = &vsock->vqs[VSOCK_VQ_RX];
vsock             581 drivers/vhost/vsock.c 	vsock->vqs[VSOCK_VQ_TX].handle_kick = vhost_vsock_handle_tx_kick;
vsock             582 drivers/vhost/vsock.c 	vsock->vqs[VSOCK_VQ_RX].handle_kick = vhost_vsock_handle_rx_kick;
vsock             584 drivers/vhost/vsock.c 	vhost_dev_init(&vsock->dev, vqs, ARRAY_SIZE(vsock->vqs),
vsock             588 drivers/vhost/vsock.c 	file->private_data = vsock;
vsock             589 drivers/vhost/vsock.c 	spin_lock_init(&vsock->send_pkt_list_lock);
vsock             590 drivers/vhost/vsock.c 	INIT_LIST_HEAD(&vsock->send_pkt_list);
vsock             591 drivers/vhost/vsock.c 	vhost_work_init(&vsock->send_pkt_work, vhost_transport_send_pkt_work);
vsock             595 drivers/vhost/vsock.c 	vhost_vsock_free(vsock);
vsock             599 drivers/vhost/vsock.c static void vhost_vsock_flush(struct vhost_vsock *vsock)
vsock             603 drivers/vhost/vsock.c 	for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++)
vsock             604 drivers/vhost/vsock.c 		if (vsock->vqs[i].handle_kick)
vsock             605 drivers/vhost/vsock.c 			vhost_poll_flush(&vsock->vqs[i].poll);
vsock             606 drivers/vhost/vsock.c 	vhost_work_flush(&vsock->dev, &vsock->send_pkt_work);
vsock             637 drivers/vhost/vsock.c 	struct vhost_vsock *vsock = file->private_data;
vsock             640 drivers/vhost/vsock.c 	if (vsock->guest_cid)
vsock             641 drivers/vhost/vsock.c 		hash_del_rcu(&vsock->hash);
vsock             651 drivers/vhost/vsock.c 	vhost_vsock_stop(vsock);
vsock             652 drivers/vhost/vsock.c 	vhost_vsock_flush(vsock);
vsock             653 drivers/vhost/vsock.c 	vhost_dev_stop(&vsock->dev);
vsock             655 drivers/vhost/vsock.c 	spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             656 drivers/vhost/vsock.c 	while (!list_empty(&vsock->send_pkt_list)) {
vsock             659 drivers/vhost/vsock.c 		pkt = list_first_entry(&vsock->send_pkt_list,
vsock             664 drivers/vhost/vsock.c 	spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             666 drivers/vhost/vsock.c 	vhost_dev_cleanup(&vsock->dev);
vsock             667 drivers/vhost/vsock.c 	kfree(vsock->dev.vqs);
vsock             668 drivers/vhost/vsock.c 	vhost_vsock_free(vsock);
vsock             672 drivers/vhost/vsock.c static int vhost_vsock_set_cid(struct vhost_vsock *vsock, u64 guest_cid)
vsock             688 drivers/vhost/vsock.c 	if (other && other != vsock) {
vsock             693 drivers/vhost/vsock.c 	if (vsock->guest_cid)
vsock             694 drivers/vhost/vsock.c 		hash_del_rcu(&vsock->hash);
vsock             696 drivers/vhost/vsock.c 	vsock->guest_cid = guest_cid;
vsock             697 drivers/vhost/vsock.c 	hash_add_rcu(vhost_vsock_hash, &vsock->hash, vsock->guest_cid);
vsock             703 drivers/vhost/vsock.c static int vhost_vsock_set_features(struct vhost_vsock *vsock, u64 features)
vsock             711 drivers/vhost/vsock.c 	mutex_lock(&vsock->dev.mutex);
vsock             713 drivers/vhost/vsock.c 	    !vhost_log_access_ok(&vsock->dev)) {
vsock             714 drivers/vhost/vsock.c 		mutex_unlock(&vsock->dev.mutex);
vsock             718 drivers/vhost/vsock.c 	for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++) {
vsock             719 drivers/vhost/vsock.c 		vq = &vsock->vqs[i];
vsock             724 drivers/vhost/vsock.c 	mutex_unlock(&vsock->dev.mutex);
vsock             731 drivers/vhost/vsock.c 	struct vhost_vsock *vsock = f->private_data;
vsock             742 drivers/vhost/vsock.c 		return vhost_vsock_set_cid(vsock, guest_cid);
vsock             747 drivers/vhost/vsock.c 			return vhost_vsock_start(vsock);
vsock             749 drivers/vhost/vsock.c 			return vhost_vsock_stop(vsock);
vsock             758 drivers/vhost/vsock.c 		return vhost_vsock_set_features(vsock, features);
vsock             760 drivers/vhost/vsock.c 		mutex_lock(&vsock->dev.mutex);
vsock             761 drivers/vhost/vsock.c 		r = vhost_dev_ioctl(&vsock->dev, ioctl, argp);
vsock             763 drivers/vhost/vsock.c 			r = vhost_vring_ioctl(&vsock->dev, ioctl, argp);
vsock             765 drivers/vhost/vsock.c 			vhost_vsock_flush(vsock);
vsock             766 drivers/vhost/vsock.c 		mutex_unlock(&vsock->dev.mutex);
vsock               3 include/trace/events/vsock_virtio_transport_common.h #define TRACE_SYSTEM vsock
vsock              73 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock;
vsock              77 net/vmw_vsock/virtio_transport.c 	vsock = rcu_dereference(the_virtio_vsock);
vsock              78 net/vmw_vsock/virtio_transport.c 	if (!vsock) {
vsock              83 net/vmw_vsock/virtio_transport.c 	ret = vsock->guest_cid;
vsock              91 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock =
vsock              95 net/vmw_vsock/virtio_transport.c 	spin_lock_bh(&vsock->loopback_list_lock);
vsock              96 net/vmw_vsock/virtio_transport.c 	list_splice_init(&vsock->loopback_list, &pkts);
vsock              97 net/vmw_vsock/virtio_transport.c 	spin_unlock_bh(&vsock->loopback_list_lock);
vsock              99 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->rx_lock);
vsock             101 net/vmw_vsock/virtio_transport.c 	if (!vsock->rx_run)
vsock             113 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->rx_lock);
vsock             116 net/vmw_vsock/virtio_transport.c static int virtio_transport_send_pkt_loopback(struct virtio_vsock *vsock,
vsock             121 net/vmw_vsock/virtio_transport.c 	spin_lock_bh(&vsock->loopback_list_lock);
vsock             122 net/vmw_vsock/virtio_transport.c 	list_add_tail(&pkt->list, &vsock->loopback_list);
vsock             123 net/vmw_vsock/virtio_transport.c 	spin_unlock_bh(&vsock->loopback_list_lock);
vsock             125 net/vmw_vsock/virtio_transport.c 	queue_work(virtio_vsock_workqueue, &vsock->loopback_work);
vsock             133 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock =
vsock             139 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->tx_lock);
vsock             141 net/vmw_vsock/virtio_transport.c 	if (!vsock->tx_run)
vsock             144 net/vmw_vsock/virtio_transport.c 	vq = vsock->vqs[VSOCK_VQ_TX];
vsock             152 net/vmw_vsock/virtio_transport.c 		spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             153 net/vmw_vsock/virtio_transport.c 		if (list_empty(&vsock->send_pkt_list)) {
vsock             154 net/vmw_vsock/virtio_transport.c 			spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             158 net/vmw_vsock/virtio_transport.c 		pkt = list_first_entry(&vsock->send_pkt_list,
vsock             161 net/vmw_vsock/virtio_transport.c 		spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             179 net/vmw_vsock/virtio_transport.c 			spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             180 net/vmw_vsock/virtio_transport.c 			list_add(&pkt->list, &vsock->send_pkt_list);
vsock             181 net/vmw_vsock/virtio_transport.c 			spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             186 net/vmw_vsock/virtio_transport.c 			struct virtqueue *rx_vq = vsock->vqs[VSOCK_VQ_RX];
vsock             189 net/vmw_vsock/virtio_transport.c 			val = atomic_dec_return(&vsock->queued_replies);
vsock             203 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->tx_lock);
vsock             206 net/vmw_vsock/virtio_transport.c 		queue_work(virtio_vsock_workqueue, &vsock->rx_work);
vsock             212 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock;
vsock             216 net/vmw_vsock/virtio_transport.c 	vsock = rcu_dereference(the_virtio_vsock);
vsock             217 net/vmw_vsock/virtio_transport.c 	if (!vsock) {
vsock             223 net/vmw_vsock/virtio_transport.c 	if (le64_to_cpu(pkt->hdr.dst_cid) == vsock->guest_cid) {
vsock             224 net/vmw_vsock/virtio_transport.c 		len = virtio_transport_send_pkt_loopback(vsock, pkt);
vsock             229 net/vmw_vsock/virtio_transport.c 		atomic_inc(&vsock->queued_replies);
vsock             231 net/vmw_vsock/virtio_transport.c 	spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             232 net/vmw_vsock/virtio_transport.c 	list_add_tail(&pkt->list, &vsock->send_pkt_list);
vsock             233 net/vmw_vsock/virtio_transport.c 	spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             235 net/vmw_vsock/virtio_transport.c 	queue_work(virtio_vsock_workqueue, &vsock->send_pkt_work);
vsock             245 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock;
vsock             251 net/vmw_vsock/virtio_transport.c 	vsock = rcu_dereference(the_virtio_vsock);
vsock             252 net/vmw_vsock/virtio_transport.c 	if (!vsock) {
vsock             257 net/vmw_vsock/virtio_transport.c 	spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             258 net/vmw_vsock/virtio_transport.c 	list_for_each_entry_safe(pkt, n, &vsock->send_pkt_list, list) {
vsock             263 net/vmw_vsock/virtio_transport.c 	spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             273 net/vmw_vsock/virtio_transport.c 		struct virtqueue *rx_vq = vsock->vqs[VSOCK_VQ_RX];
vsock             276 net/vmw_vsock/virtio_transport.c 		new_cnt = atomic_sub_return(cnt, &vsock->queued_replies);
vsock             279 net/vmw_vsock/virtio_transport.c 			queue_work(virtio_vsock_workqueue, &vsock->rx_work);
vsock             289 net/vmw_vsock/virtio_transport.c static void virtio_vsock_rx_fill(struct virtio_vsock *vsock)
vsock             297 net/vmw_vsock/virtio_transport.c 	vq = vsock->vqs[VSOCK_VQ_RX];
vsock             323 net/vmw_vsock/virtio_transport.c 		vsock->rx_buf_nr++;
vsock             325 net/vmw_vsock/virtio_transport.c 	if (vsock->rx_buf_nr > vsock->rx_buf_max_nr)
vsock             326 net/vmw_vsock/virtio_transport.c 		vsock->rx_buf_max_nr = vsock->rx_buf_nr;
vsock             332 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock =
vsock             337 net/vmw_vsock/virtio_transport.c 	vq = vsock->vqs[VSOCK_VQ_TX];
vsock             338 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->tx_lock);
vsock             340 net/vmw_vsock/virtio_transport.c 	if (!vsock->tx_run)
vsock             355 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->tx_lock);
vsock             358 net/vmw_vsock/virtio_transport.c 		queue_work(virtio_vsock_workqueue, &vsock->send_pkt_work);
vsock             362 net/vmw_vsock/virtio_transport.c static bool virtio_transport_more_replies(struct virtio_vsock *vsock)
vsock             364 net/vmw_vsock/virtio_transport.c 	struct virtqueue *vq = vsock->vqs[VSOCK_VQ_RX];
vsock             368 net/vmw_vsock/virtio_transport.c 	val = atomic_read(&vsock->queued_replies);
vsock             375 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock =
vsock             379 net/vmw_vsock/virtio_transport.c 	vq = vsock->vqs[VSOCK_VQ_RX];
vsock             381 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->rx_lock);
vsock             383 net/vmw_vsock/virtio_transport.c 	if (!vsock->rx_run)
vsock             392 net/vmw_vsock/virtio_transport.c 			if (!virtio_transport_more_replies(vsock)) {
vsock             405 net/vmw_vsock/virtio_transport.c 			vsock->rx_buf_nr--;
vsock             421 net/vmw_vsock/virtio_transport.c 	if (vsock->rx_buf_nr < vsock->rx_buf_max_nr / 2)
vsock             422 net/vmw_vsock/virtio_transport.c 		virtio_vsock_rx_fill(vsock);
vsock             423 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->rx_lock);
vsock             427 net/vmw_vsock/virtio_transport.c static int virtio_vsock_event_fill_one(struct virtio_vsock *vsock,
vsock             433 net/vmw_vsock/virtio_transport.c 	vq = vsock->vqs[VSOCK_VQ_EVENT];
vsock             441 net/vmw_vsock/virtio_transport.c static void virtio_vsock_event_fill(struct virtio_vsock *vsock)
vsock             445 net/vmw_vsock/virtio_transport.c 	for (i = 0; i < ARRAY_SIZE(vsock->event_list); i++) {
vsock             446 net/vmw_vsock/virtio_transport.c 		struct virtio_vsock_event *event = &vsock->event_list[i];
vsock             448 net/vmw_vsock/virtio_transport.c 		virtio_vsock_event_fill_one(vsock, event);
vsock             451 net/vmw_vsock/virtio_transport.c 	virtqueue_kick(vsock->vqs[VSOCK_VQ_EVENT]);
vsock             463 net/vmw_vsock/virtio_transport.c static void virtio_vsock_update_guest_cid(struct virtio_vsock *vsock)
vsock             465 net/vmw_vsock/virtio_transport.c 	struct virtio_device *vdev = vsock->vdev;
vsock             470 net/vmw_vsock/virtio_transport.c 	vsock->guest_cid = le64_to_cpu(guest_cid);
vsock             474 net/vmw_vsock/virtio_transport.c static void virtio_vsock_event_handle(struct virtio_vsock *vsock,
vsock             479 net/vmw_vsock/virtio_transport.c 		virtio_vsock_update_guest_cid(vsock);
vsock             487 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock =
vsock             491 net/vmw_vsock/virtio_transport.c 	vq = vsock->vqs[VSOCK_VQ_EVENT];
vsock             493 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->event_lock);
vsock             495 net/vmw_vsock/virtio_transport.c 	if (!vsock->event_run)
vsock             505 net/vmw_vsock/virtio_transport.c 				virtio_vsock_event_handle(vsock, event);
vsock             507 net/vmw_vsock/virtio_transport.c 			virtio_vsock_event_fill_one(vsock, event);
vsock             511 net/vmw_vsock/virtio_transport.c 	virtqueue_kick(vsock->vqs[VSOCK_VQ_EVENT]);
vsock             513 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->event_lock);
vsock             518 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock = vq->vdev->priv;
vsock             520 net/vmw_vsock/virtio_transport.c 	if (!vsock)
vsock             522 net/vmw_vsock/virtio_transport.c 	queue_work(virtio_vsock_workqueue, &vsock->event_work);
vsock             527 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock = vq->vdev->priv;
vsock             529 net/vmw_vsock/virtio_transport.c 	if (!vsock)
vsock             531 net/vmw_vsock/virtio_transport.c 	queue_work(virtio_vsock_workqueue, &vsock->tx_work);
vsock             536 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock = vq->vdev->priv;
vsock             538 net/vmw_vsock/virtio_transport.c 	if (!vsock)
vsock             540 net/vmw_vsock/virtio_transport.c 	queue_work(virtio_vsock_workqueue, &vsock->rx_work);
vsock             601 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock = NULL;
vsock             615 net/vmw_vsock/virtio_transport.c 	vsock = kzalloc(sizeof(*vsock), GFP_KERNEL);
vsock             616 net/vmw_vsock/virtio_transport.c 	if (!vsock) {
vsock             621 net/vmw_vsock/virtio_transport.c 	vsock->vdev = vdev;
vsock             623 net/vmw_vsock/virtio_transport.c 	ret = virtio_find_vqs(vsock->vdev, VSOCK_VQ_MAX,
vsock             624 net/vmw_vsock/virtio_transport.c 			      vsock->vqs, callbacks, names,
vsock             629 net/vmw_vsock/virtio_transport.c 	virtio_vsock_update_guest_cid(vsock);
vsock             631 net/vmw_vsock/virtio_transport.c 	vsock->rx_buf_nr = 0;
vsock             632 net/vmw_vsock/virtio_transport.c 	vsock->rx_buf_max_nr = 0;
vsock             633 net/vmw_vsock/virtio_transport.c 	atomic_set(&vsock->queued_replies, 0);
vsock             635 net/vmw_vsock/virtio_transport.c 	mutex_init(&vsock->tx_lock);
vsock             636 net/vmw_vsock/virtio_transport.c 	mutex_init(&vsock->rx_lock);
vsock             637 net/vmw_vsock/virtio_transport.c 	mutex_init(&vsock->event_lock);
vsock             638 net/vmw_vsock/virtio_transport.c 	spin_lock_init(&vsock->send_pkt_list_lock);
vsock             639 net/vmw_vsock/virtio_transport.c 	INIT_LIST_HEAD(&vsock->send_pkt_list);
vsock             640 net/vmw_vsock/virtio_transport.c 	spin_lock_init(&vsock->loopback_list_lock);
vsock             641 net/vmw_vsock/virtio_transport.c 	INIT_LIST_HEAD(&vsock->loopback_list);
vsock             642 net/vmw_vsock/virtio_transport.c 	INIT_WORK(&vsock->rx_work, virtio_transport_rx_work);
vsock             643 net/vmw_vsock/virtio_transport.c 	INIT_WORK(&vsock->tx_work, virtio_transport_tx_work);
vsock             644 net/vmw_vsock/virtio_transport.c 	INIT_WORK(&vsock->event_work, virtio_transport_event_work);
vsock             645 net/vmw_vsock/virtio_transport.c 	INIT_WORK(&vsock->send_pkt_work, virtio_transport_send_pkt_work);
vsock             646 net/vmw_vsock/virtio_transport.c 	INIT_WORK(&vsock->loopback_work, virtio_transport_loopback_work);
vsock             648 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->tx_lock);
vsock             649 net/vmw_vsock/virtio_transport.c 	vsock->tx_run = true;
vsock             650 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->tx_lock);
vsock             652 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->rx_lock);
vsock             653 net/vmw_vsock/virtio_transport.c 	virtio_vsock_rx_fill(vsock);
vsock             654 net/vmw_vsock/virtio_transport.c 	vsock->rx_run = true;
vsock             655 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->rx_lock);
vsock             657 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->event_lock);
vsock             658 net/vmw_vsock/virtio_transport.c 	virtio_vsock_event_fill(vsock);
vsock             659 net/vmw_vsock/virtio_transport.c 	vsock->event_run = true;
vsock             660 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->event_lock);
vsock             662 net/vmw_vsock/virtio_transport.c 	vdev->priv = vsock;
vsock             663 net/vmw_vsock/virtio_transport.c 	rcu_assign_pointer(the_virtio_vsock, vsock);
vsock             669 net/vmw_vsock/virtio_transport.c 	kfree(vsock);
vsock             676 net/vmw_vsock/virtio_transport.c 	struct virtio_vsock *vsock = vdev->priv;
vsock             691 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->rx_lock);
vsock             692 net/vmw_vsock/virtio_transport.c 	vsock->rx_run = false;
vsock             693 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->rx_lock);
vsock             695 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->tx_lock);
vsock             696 net/vmw_vsock/virtio_transport.c 	vsock->tx_run = false;
vsock             697 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->tx_lock);
vsock             699 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->event_lock);
vsock             700 net/vmw_vsock/virtio_transport.c 	vsock->event_run = false;
vsock             701 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->event_lock);
vsock             708 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->rx_lock);
vsock             709 net/vmw_vsock/virtio_transport.c 	while ((pkt = virtqueue_detach_unused_buf(vsock->vqs[VSOCK_VQ_RX])))
vsock             711 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->rx_lock);
vsock             713 net/vmw_vsock/virtio_transport.c 	mutex_lock(&vsock->tx_lock);
vsock             714 net/vmw_vsock/virtio_transport.c 	while ((pkt = virtqueue_detach_unused_buf(vsock->vqs[VSOCK_VQ_TX])))
vsock             716 net/vmw_vsock/virtio_transport.c 	mutex_unlock(&vsock->tx_lock);
vsock             718 net/vmw_vsock/virtio_transport.c 	spin_lock_bh(&vsock->send_pkt_list_lock);
vsock             719 net/vmw_vsock/virtio_transport.c 	while (!list_empty(&vsock->send_pkt_list)) {
vsock             720 net/vmw_vsock/virtio_transport.c 		pkt = list_first_entry(&vsock->send_pkt_list,
vsock             725 net/vmw_vsock/virtio_transport.c 	spin_unlock_bh(&vsock->send_pkt_list_lock);
vsock             727 net/vmw_vsock/virtio_transport.c 	spin_lock_bh(&vsock->loopback_list_lock);
vsock             728 net/vmw_vsock/virtio_transport.c 	while (!list_empty(&vsock->loopback_list)) {
vsock             729 net/vmw_vsock/virtio_transport.c 		pkt = list_first_entry(&vsock->loopback_list,
vsock             734 net/vmw_vsock/virtio_transport.c 	spin_unlock_bh(&vsock->loopback_list_lock);
vsock             742 net/vmw_vsock/virtio_transport.c 	flush_work(&vsock->loopback_work);
vsock             743 net/vmw_vsock/virtio_transport.c 	flush_work(&vsock->rx_work);
vsock             744 net/vmw_vsock/virtio_transport.c 	flush_work(&vsock->tx_work);
vsock             745 net/vmw_vsock/virtio_transport.c 	flush_work(&vsock->event_work);
vsock             746 net/vmw_vsock/virtio_transport.c 	flush_work(&vsock->send_pkt_work);
vsock             750 net/vmw_vsock/virtio_transport.c 	kfree(vsock);
vsock             523 net/vmw_vsock/vmci_transport.c static bool vmci_transport_is_trusted(struct vsock_sock *vsock, u32 peer_cid)
vsock             525 net/vmw_vsock/vmci_transport.c 	return vsock->trusted ||
vsock             526 net/vmw_vsock/vmci_transport.c 	       vmci_is_context_owner(peer_cid, vsock->owner->uid);
vsock             533 net/vmw_vsock/vmci_transport.c static bool vmci_transport_allow_dgram(struct vsock_sock *vsock, u32 peer_cid)
vsock             538 net/vmw_vsock/vmci_transport.c 	if (vsock->cached_peer != peer_cid) {
vsock             539 net/vmw_vsock/vmci_transport.c 		vsock->cached_peer = peer_cid;
vsock             540 net/vmw_vsock/vmci_transport.c 		if (!vmci_transport_is_trusted(vsock, peer_cid) &&
vsock             543 net/vmw_vsock/vmci_transport.c 			vsock->cached_peer_allow_dgram = false;
vsock             545 net/vmw_vsock/vmci_transport.c 			vsock->cached_peer_allow_dgram = true;
vsock             549 net/vmw_vsock/vmci_transport.c 	return vsock->cached_peer_allow_dgram;