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 B66C0A0C46; Mon, 27 Sep 2021 17:01:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 367A5411AB; Mon, 27 Sep 2021 16:58:39 +0200 (CEST) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 613A7410DA for ; Mon, 27 Sep 2021 15:43:21 +0200 (CEST) Received: by mail-pj1-f44.google.com with SMTP id u1-20020a17090ae00100b0019ec31d3ba2so4238196pjy.1 for ; Mon, 27 Sep 2021 06:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oneconvergence.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Imf48FjimLm0M8J8OyFai005M0N3mInOi98nlSOlYW0=; b=UIST+WDZEpv2dtfg7zntA1lMctXdhXhw8MOc0sPljjXO9/jsN9gDzI6ZvOaEsnmjgg TX3KnaFW7Mr3ZDCquXbpzfK2162ZUbQG9oR2kOTckPeB6qUS1bfJzYo6d4Iupy3uO7gA pAHpPCrWnkjT1165NteZ1d7d7iT0El/d2em3g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Imf48FjimLm0M8J8OyFai005M0N3mInOi98nlSOlYW0=; b=jopYzsGLhRbRaK5jg+XlOaBDgFZa/kDGZlyPEOTXT138kCs/fg35W07HL0eX1tQpnA upOMRqjxP2/ayvX2K6tehEanEQHLBXLU9VrjAwMgfW5g5BiLbwcSIEX6uGuZL8dkynh+ eSAThfOJ1kli4C5r/QcV6CGBqH4wlEHwj6q0tEcYnIun7QxQrK42GdX0CStY8eR7nQU+ bfL29jZQSAborR5DVM1t8fr36i8pumbhg52jYWqYZbM6yyzZqTVvNC+wFv6rdFN1pVdU lrjeFfziCZQNakMSplHCSVQWa76R/Mcw4SuvYsIF7hMWbpVU6OxXVEpnTkKiyJ6RGBZ6 JtOg== X-Gm-Message-State: AOAM530sFK3gpKjYANCXP7k/a8htDE/sh5vUyUTASshCsnfZCDjGwyqA uFvydR+ZdOYP5W149OxIFOtJkQ== X-Google-Smtp-Source: ABdhPJw1r+TEG/EQ/FqoMbOqyb/Q9JfDAS+FvFiOSwGuzhf+1ETFogMTqI+SLRffn96JE+FlMyVJQw== X-Received: by 2002:a17:902:904b:b0:13d:c33b:294f with SMTP id w11-20020a170902904b00b0013dc33b294fmr22526551plz.35.1632750200637; Mon, 27 Sep 2021 06:43:20 -0700 (PDT) Received: from srikanth-ThinkPad-T450.domain.name ([223.178.22.200]) by smtp.gmail.com with ESMTPSA id b3sm16960665pfo.23.2021.09.27.06.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 06:43:20 -0700 (PDT) From: Srikanth Kaka To: Stephen Hemminger , Long Li Cc: dev@dpdk.org, Vag Singh , Anand Thulasiram , Srikanth Kaka Date: Mon, 27 Sep 2021 19:12:28 +0530 Message-Id: <20210927134231.11177-9-srikanth.k@oneconvergence.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210927134231.11177-1-srikanth.k@oneconvergence.com> References: <20210927134231.11177-1-srikanth.k@oneconvergence.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 27 Sep 2021 16:58:07 +0200 Subject: [dpdk-dev] [PATCH 08/11] net/netvsc: moving event monitoring support 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 Sender: "dev" Event monitoring is not yet supported on FreeBSD, hence moving it the OS specific files Signed-off-by: Srikanth Kaka Signed-off-by: Vag Singh Signed-off-by: Anand Thulasiram --- drivers/net/netvsc/freebsd/hn_os.c | 14 ++++++++++++++ drivers/net/netvsc/hn_ethdev.c | 7 +++---- drivers/net/netvsc/hn_os.h | 6 ++++++ drivers/net/netvsc/linux/hn_os.c | 19 +++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 drivers/net/netvsc/freebsd/hn_os.c create mode 100644 drivers/net/netvsc/hn_os.h create mode 100644 drivers/net/netvsc/linux/hn_os.c diff --git a/drivers/net/netvsc/freebsd/hn_os.c b/drivers/net/netvsc/freebsd/hn_os.c new file mode 100644 index 0000000000..3bd67e06c8 --- /dev/null +++ b/drivers/net/netvsc/freebsd/hn_os.c @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2021 Microsoft Corporation + */ + +#include + +#include "hn_logs.h" +#include "hn_os.h" + +int eth_hn_os_dev_event(void) +{ + PMD_DRV_LOG(DEBUG, "rte_dev_event_monitor_start not supported on FreeBSD"); + return 0; +} diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 6f9053c4d5..61d7d3daeb 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -39,6 +39,7 @@ #include "hn_rndis.h" #include "hn_nvs.h" #include "ndis.h" +#include "hn_os.h" #define HN_TX_OFFLOAD_CAPS (DEV_TX_OFFLOAD_IPV4_CKSUM | \ DEV_TX_OFFLOAD_TCP_CKSUM | \ @@ -1244,11 +1245,9 @@ static int eth_hn_probe(struct rte_vmbus_driver *drv __rte_unused, PMD_INIT_FUNC_TRACE(); - ret = rte_dev_event_monitor_start(); - if (ret) { - PMD_DRV_LOG(ERR, "Failed to start device event monitoring"); + ret = eth_hn_os_dev_event(); + if (ret) return ret; - } eth_dev = eth_dev_vmbus_allocate(dev, sizeof(struct hn_data)); if (!eth_dev) diff --git a/drivers/net/netvsc/hn_os.h b/drivers/net/netvsc/hn_os.h new file mode 100644 index 0000000000..618c53cdcd --- /dev/null +++ b/drivers/net/netvsc/hn_os.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2009-2021 Microsoft Corp. + * All rights reserved. + */ + +int eth_hn_os_dev_event(void); diff --git a/drivers/net/netvsc/linux/hn_os.c b/drivers/net/netvsc/linux/hn_os.c new file mode 100644 index 0000000000..862dc190c1 --- /dev/null +++ b/drivers/net/netvsc/linux/hn_os.c @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2021 Microsoft Corporation + */ + +#include + +#include "hn_logs.h" +#include "hn_os.h" + +int eth_hn_os_dev_event(void) +{ + int ret; + + ret = rte_dev_event_monitor_start(); + if (ret) + PMD_DRV_LOG(ERR, "Failed to start device event monitoring"); + + return ret; +} -- 2.30.2