From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5ADE045AD6; Mon, 7 Oct 2024 17:04:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F4EA427D0; Mon, 7 Oct 2024 17:04:35 +0200 (CEST) Received: from mx0a-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id CFE72427BF for ; Mon, 7 Oct 2024 17:04:32 +0200 (CEST) Received: from pps.filterd (m0431384.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497CfSDK016990; Mon, 7 Oct 2024 08:04:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=H jc0wWCcONHnWxAfWlpf9+PmMGvOKnaKRo6pwNMiuNY=; b=ktG5QXsV5fzkXIFj4 axoxx/zZGw2Wo3lCURK3/XQMxuEClKPm/oMbw+axN5rrGnMIPyeFmr+7iDXAfvS+ A73axpMjdAdGuSDNYwIj9/3fB7qDJ1S2JDd6B/2ul/bxjCJXQYClVOUrEJ5J4kyA Z4CTNAQ0WtkEtn4C009+ciIYp1xWSbiFxTf4/6QMPzToibflgeBX+d24mRc6OJ09 7xM07RKi+82NcLWqD/ObfK7Zy/CNyaT4H7TOE6YttEBk1T6v/lBZMA11+OZQ+NKo 48Fl9KuG6C590ntADOu/40mx9b85pvvBGb7xZCCj7YkcpuLAoQeBVQ0wzlTwSB/j iDHvg== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 424d34rkb0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 07 Oct 2024 08:04:31 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 7 Oct 2024 08:04:30 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 7 Oct 2024 08:04:30 -0700 Received: from localhost.localdomain (unknown [10.28.36.14]) by maili.marvell.com (Postfix) with ESMTP id DEE855E686A; Mon, 7 Oct 2024 08:04:28 -0700 (PDT) From: To: Maxime Coquelin , Chenbo Xia CC: , Satha Rao Subject: [PATCH 3/5] net/virtio: add set config callback Date: Mon, 7 Oct 2024 20:34:01 +0530 Message-ID: <20241007150403.1680983-3-skoteshwar@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241007150403.1680983-1-skoteshwar@marvell.com> References: <20241007150403.1680983-1-skoteshwar@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: W34ebjU_znYTPZhcbFY7nCRdcEL1XZO5 X-Proofpoint-ORIG-GUID: W34ebjU_znYTPZhcbFY7nCRdcEL1XZO5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Satha Rao This patch enables the set config callback handler. Signed-off-by: Satha Rao --- drivers/net/virtio/virtio_user/vhost.h | 1 + drivers/net/virtio/virtio_user/vhost_vdpa.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h index eee3a4bc47..45ae56e3b5 100644 --- a/drivers/net/virtio/virtio_user/vhost.h +++ b/drivers/net/virtio/virtio_user/vhost.h @@ -92,6 +92,7 @@ struct virtio_user_backend_ops { int (*get_intr_fd)(struct virtio_user_dev *dev); int (*map_notification_area)(struct virtio_user_dev *dev); int (*unmap_notification_area)(struct virtio_user_dev *dev); + int (*set_config_call)(struct virtio_user_dev *dev, int fd); }; extern struct virtio_user_backend_ops virtio_ops_user; diff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c b/drivers/net/virtio/virtio_user/vhost_vdpa.c index bc3e2a9af5..5c610664b6 100644 --- a/drivers/net/virtio/virtio_user/vhost_vdpa.c +++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c @@ -48,6 +48,7 @@ struct vhost_vdpa_data { #define VHOST_VDPA_SET_VRING_ENABLE _IOW(VHOST_VIRTIO, 0x75, struct vhost_vring_state) #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64) #define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64) +#define VHOST_SET_CONFIG_CALL _IOW(VHOST_VIRTIO, 0x77, int) /* no alignment requirement */ struct vhost_iotlb_msg { @@ -509,6 +510,14 @@ vhost_vdpa_set_config(struct virtio_user_dev *dev, const uint8_t *data, uint32_t return ret; } +static int +vhost_vdpa_set_config_call(struct virtio_user_dev *dev, int fd) +{ + struct vhost_vdpa_data *data = dev->backend_data; + + return vhost_vdpa_ioctl(data->vhostfd, VHOST_SET_CONFIG_CALL, &fd); +} + /** * Set up environment to talk with a vhost vdpa backend. * @@ -706,6 +715,7 @@ struct virtio_user_backend_ops virtio_ops_vdpa = { .set_status = vhost_vdpa_set_status, .get_config = vhost_vdpa_get_config, .set_config = vhost_vdpa_set_config, + .set_config_call = vhost_vdpa_set_config_call, .cvq_enable = vhost_vdpa_cvq_enable, .enable_qp = vhost_vdpa_enable_queue_pair, .dma_map = vhost_vdpa_dma_map_batch, -- 2.25.1