MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vhost_user_get_config

Function vhost_user_get_config

dpdk/lib/vhost/vhost_user.c:2557–2587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2555}
2556
2557static int
2558vhost_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
2589static int
2590vhost_user_set_config(struct virtio_net **pdev,

Callers

nothing calls this directly

Calls 1

validate_msg_fdsFunction · 0.85

Tested by

no test coverage detected