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 DBE3845AD6; Mon, 7 Oct 2024 17:04:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60FB8427E2; Mon, 7 Oct 2024 17:04:37 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id AEA46427DB for ; Mon, 7 Oct 2024 17:04:36 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497EgVWU028589; Mon, 7 Oct 2024 08:04:36 -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=Y hZ64+z2W2yIUDl/mbpOm5cAuLMCT5YvRzcH73AAVXI=; b=FxFQ54XZ6EQXz0kuj 1AfBvdVNN4GUYKIsj2zgLymUke83lmXOC/fNikYCIFIwDvIXMcHrgRgnZPf9aD35 BtwtGBhtQkemxSYn2DPKzmRbCxnSLiE+NT1l04wi23xOQkaO/amBQTLPiOeBVbRp 5lbwmCscDMMpCcD5OrX3WlJ/uzAyNdF49gFyAwwqxM6i5h9Uly9Co4SaD1msGtGY N0Zhtfj2wjA/3fnQpFHRfqni9TmqwqX0tRZpj+N026NUn7+tsHvMOGXKuyRcMLJG ER/1tJCPj7Y195B9LNnpYyta1J+rwFBT5oYGhnf4xY1EBH2EG+9wbMmT384sbRGu 4xXfQ== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 4234yg3nmu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 07 Oct 2024 08:04:35 -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:35 -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:35 -0700 Received: from localhost.localdomain (unknown [10.28.36.14]) by maili.marvell.com (Postfix) with ESMTP id 958613F705B; Mon, 7 Oct 2024 08:04:33 -0700 (PDT) From: To: Maxime Coquelin , Chenbo Xia CC: , Satha Rao Subject: [PATCH 4/5] net/virtio: implement update link state API Date: Mon, 7 Oct 2024 20:34:02 +0530 Message-ID: <20241007150403.1680983-4-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: oUKVsF_6tXzQWYdfDEeZ5e8aaBGwbFGH X-Proofpoint-ORIG-GUID: oUKVsF_6tXzQWYdfDEeZ5e8aaBGwbFGH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_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 introduces the vhost_vdpa_update_link_state API to manage the link state updates. Signed-off-by: Satha Rao --- drivers/net/virtio/virtio_user/vhost_vdpa.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c b/drivers/net/virtio/virtio_user/vhost_vdpa.c index 5c610664b6..e8aea54000 100644 --- a/drivers/net/virtio/virtio_user/vhost_vdpa.c +++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c @@ -619,9 +619,17 @@ vhost_vdpa_get_backend_features(uint64_t *features) } static int -vhost_vdpa_update_link_state(struct virtio_user_dev *dev __rte_unused) +vhost_vdpa_update_link_state(struct virtio_user_dev *dev) { - /* Nothing to update (for now?) */ + uint16_t status; + int rc, offset; + + offset = offsetof(struct virtio_net_config, status); + rc = vhost_vdpa_get_config(dev, (uint8_t *)&status, offset, sizeof(status)); + if (rc) + return rc; + dev->net_status = status & VIRTIO_NET_S_LINK_UP; + return 0; } -- 2.25.1