| 2555 | } |
| 2556 | |
| 2557 | static int |
| 2558 | vhost_user_get_config(struct virtio_net **pdev, |
| 2559 | struct vhu_msg_context *ctx, |
| 2560 | int main_fd __rte_unused) |
| 2561 | { |
| 2562 | struct virtio_net *dev = *pdev; |
| 2563 | struct rte_vdpa_device *vdpa_dev = dev->vdpa_dev; |
| 2564 | int ret = 0; |
| 2565 | |
| 2566 | if (validate_msg_fds(dev, ctx, 0) != 0) |
| 2567 | return RTE_VHOST_MSG_RESULT_ERR; |
| 2568 | |
| 2569 | if (!vdpa_dev) { |
| 2570 | VHOST_LOG_CONFIG(dev->ifname, ERR, "is not vDPA device!\n"); |
| 2571 | return RTE_VHOST_MSG_RESULT_ERR; |
| 2572 | } |
| 2573 | |
| 2574 | if (vdpa_dev->ops->get_config) { |
| 2575 | ret = vdpa_dev->ops->get_config(dev->vid, |
| 2576 | ctx->msg.payload.cfg.region, |
| 2577 | ctx->msg.payload.cfg.size); |
| 2578 | if (ret != 0) { |
| 2579 | ctx->msg.size = 0; |
| 2580 | VHOST_LOG_CONFIG(dev->ifname, ERR, "get_config() return error!\n"); |
| 2581 | } |
| 2582 | } else { |
| 2583 | VHOST_LOG_CONFIG(dev->ifname, ERR, "get_config() not supported!\n"); |
| 2584 | } |
| 2585 | |
| 2586 | return RTE_VHOST_MSG_RESULT_REPLY; |
| 2587 | } |
| 2588 | |
| 2589 | static int |
| 2590 | vhost_user_set_config(struct virtio_net **pdev, |
nothing calls this directly
no test coverage detected