| 2455 | } |
| 2456 | |
| 2457 | static int |
| 2458 | vhost_user_set_req_fd(struct virtio_net **pdev, |
| 2459 | struct vhu_msg_context *ctx, |
| 2460 | int main_fd __rte_unused) |
| 2461 | { |
| 2462 | struct virtio_net *dev = *pdev; |
| 2463 | int fd = ctx->fds[0]; |
| 2464 | |
| 2465 | if (validate_msg_fds(dev, ctx, 1) != 0) |
| 2466 | return RTE_VHOST_MSG_RESULT_ERR; |
| 2467 | |
| 2468 | if (fd < 0) { |
| 2469 | VHOST_LOG_CONFIG(dev->ifname, ERR, |
| 2470 | "invalid file descriptor for backend channel (%d)\n", fd); |
| 2471 | return RTE_VHOST_MSG_RESULT_ERR; |
| 2472 | } |
| 2473 | |
| 2474 | if (dev->backend_req_fd >= 0) |
| 2475 | close(dev->backend_req_fd); |
| 2476 | |
| 2477 | dev->backend_req_fd = fd; |
| 2478 | |
| 2479 | return RTE_VHOST_MSG_RESULT_OK; |
| 2480 | } |
| 2481 | |
| 2482 | static int |
| 2483 | is_vring_iotlb_split(struct vhost_virtqueue *vq, struct vhost_iotlb_msg *imsg) |
nothing calls this directly
no test coverage detected