aboutsummaryrefslogtreecommitdiff
path: root/samples/server.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2022-05-27 19:06:31 +0100
committerGitHub <noreply@github.com>2022-05-27 19:06:31 +0100
commit188cd00c520855615331d35c087a22215767b8fb (patch)
tree8bda987bcdeb1c8cf0751dbe190a28aef2609272 /samples/server.c
parent538d6063c9f8d395e1d38285ddfe405c3fcd7619 (diff)
downloadlibvfio-user-188cd00c520855615331d35c087a22215767b8fb.zip
libvfio-user-188cd00c520855615331d35c087a22215767b8fb.tar.gz
libvfio-user-188cd00c520855615331d35c087a22215767b8fb.tar.bz2
re-work SGL API (#675)
Harmonize and rename the vfu_*sg() APIs to better reflect their functionality: in our case, there is no mapping happening as part of these calls, they are merely housekeeping for range splitting, dirty tracking, and so on. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples/server.c')
-rw-r--r--samples/server.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/samples/server.c b/samples/server.c
index 1bd7710..e994ac1 100644
--- a/samples/server.c
+++ b/samples/server.c
@@ -204,9 +204,9 @@ static void do_dma_io(vfu_ctx_t *vfu_ctx, struct server_data *server_data)
assert(vfu_ctx != NULL);
- ret = vfu_addr_to_sg(vfu_ctx,
- (vfu_dma_addr_t)server_data->regions[0].iova.iov_base,
- count, sg, 1, PROT_WRITE);
+ ret = vfu_addr_to_sgl(vfu_ctx,
+ (vfu_dma_addr_t)server_data->regions[0].iova.iov_base,
+ count, sg, 1, PROT_WRITE);
if (ret < 0) {
err(EXIT_FAILURE, "failed to map %p-%p",
server_data->regions[0].iova.iov_base,
@@ -217,17 +217,17 @@ static void do_dma_io(vfu_ctx_t *vfu_ctx, struct server_data *server_data)
crc1 = rte_hash_crc(buf, count, 0);
vfu_log(vfu_ctx, LOG_DEBUG, "%s: WRITE addr %p count %d", __func__,
server_data->regions[0].iova.iov_base, count);
- ret = vfu_dma_write(vfu_ctx, sg, buf);
+ ret = vfu_sgl_write(vfu_ctx, sg, 1, buf);
if (ret < 0) {
- err(EXIT_FAILURE, "vfu_dma_write failed");
+ err(EXIT_FAILURE, "vfu_sgl_write failed");
}
memset(buf, 0, count);
vfu_log(vfu_ctx, LOG_DEBUG, "%s: READ addr %p count %d", __func__,
server_data->regions[0].iova.iov_base, count);
- ret = vfu_dma_read(vfu_ctx, sg, buf);
+ ret = vfu_sgl_read(vfu_ctx, sg, 1, buf);
if (ret < 0) {
- err(EXIT_FAILURE, "vfu_dma_read failed");
+ err(EXIT_FAILURE, "vfu_sgl_read failed");
}
crc2 = rte_hash_crc(buf, count, 0);