From patchwork Wed Jul 6 07:52:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Kumar X-Patchwork-Id: 113742 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CD52A0540; Wed, 6 Jul 2022 09:58:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B6A542BC6; Wed, 6 Jul 2022 09:57:13 +0200 (CEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id E4BF742B72 for ; Wed, 6 Jul 2022 09:57:11 +0200 (CEST) Received: by mail-pj1-f51.google.com with SMTP id ju17so9387589pjb.3 for ; Wed, 06 Jul 2022 00:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vvdntech-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nXidecTL0wOP8mRXSV4Eld9fAVmkKos47j6BbXUeqUc=; b=hkW32TXfwEIq1vJdLzqOtGcdTzRIy37t/GHF8Lum086Pt4p+n8R0T2wXzKVETRTMQh QU5WdR7QWNpcoOYrJD7hpQ4iiJGa5y0l+yc3QEZIEI9y82qdZ5ac7o0jFVuQr+2yrndQ ojuGe3DR+CIy5xbz6qxia8ZXJYAeR1pgLXZptCDMV6xxViQfgUvyd268/VjQZwksnWhQ ydfok64mzuTYFJ4IOwxt3dNhCGgegFS51KeThY1KSn9Wz8pF+pDsr584hbCeDWZYFZAt gnmUfgWDxT5NhEnEI+4sjY5mLCfo0uO+ByNas90L63mW1jNUpuawO40o/gLRoosHyotI 9Tqg== 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=nXidecTL0wOP8mRXSV4Eld9fAVmkKos47j6BbXUeqUc=; b=qdTqHz6f2LNO+a4r+CBAVBpOir7MronESctjHd8zEzQ48Fhe/Dz4pkL4Z3l1HHLsxt oLLOjePVe/oN7/v3RRe7zaVY0XhMMouLL2K20wCFeydYW9xqOikR0+yRFIOt/Uzt5LrY QHutoN0rMZtWG4sNp2d2+stNVMTBEAaoeu4etOv7gm7K6UxWHgQqHOPyqXLNlfuBfUuG 79/gEePsoZSRHesqgIkWVcmtmKPpkR+CWnIzZACVgF5s5u3ftq7I/D7Q0HWtFiRHiNVs 5WpOHFHqqgoZz3urU/aX7ipD6vZ85iZ6mgNQYwsiZQ29oWfi6GGIQzc9sIwEpi9HE7RV QJWA== X-Gm-Message-State: AJIora97fVvAfl3rkDFahi5YdrwMgWuXH/bC1Ev/qir+Mup/4SmF3MBk pbqjnTnyOOCc86fQHotxRgW5v9XGBYizBYjJ X-Google-Smtp-Source: AGRyM1thdnh6qPVZFqhilu8CGhKmIT101fPGOcWGOnelo52mailTNNjmSyYanhH6cWMsqtpZrSVb4A== X-Received: by 2002:a17:90b:3909:b0:1ed:1202:32d3 with SMTP id ob9-20020a17090b390900b001ed120232d3mr49661411pjb.233.1657094230968; Wed, 06 Jul 2022 00:57:10 -0700 (PDT) Received: from 470--5GDC--BLR.blore.vvdntech.com ([106.51.39.131]) by smtp.gmail.com with ESMTPSA id r4-20020a17090a438400b001ef81574355sm7378805pjg.12.2022.07.06.00.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 00:57:10 -0700 (PDT) From: Aman Kumar To: dev@dpdk.org Cc: maxime.coquelin@redhat.com, david.marchand@redhat.com, aman.kumar@vvdntech.in Subject: [RFC PATCH 24/29] net/qdma: add Rx/Tx queue setup routine for VF devices Date: Wed, 6 Jul 2022 13:22:14 +0530 Message-Id: <20220706075219.517046-25-aman.kumar@vvdntech.in> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220706075219.517046-1-aman.kumar@vvdntech.in> References: <20220706075219.517046-1-aman.kumar@vvdntech.in> MIME-Version: 1.0 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 Rx/Tx queue initialization routine for VFs is same as that of phys function. define separate ops structure for VF devices. Signed-off-by: Aman Kumar --- drivers/net/qdma/qdma_vf_ethdev.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/qdma/qdma_vf_ethdev.c b/drivers/net/qdma/qdma_vf_ethdev.c index ca3d21b688..28d34560c1 100644 --- a/drivers/net/qdma/qdma_vf_ethdev.c +++ b/drivers/net/qdma/qdma_vf_ethdev.c @@ -94,6 +94,13 @@ static int qdma_ethdev_offline(struct rte_eth_dev *dev) return rv; } +static struct eth_dev_ops qdma_vf_eth_dev_ops = { + .rx_queue_setup = qdma_dev_rx_queue_setup, + .tx_queue_setup = qdma_dev_tx_queue_setup, + .rx_queue_release = qdma_dev_rx_queue_release, + .tx_queue_release = qdma_dev_tx_queue_release, +}; + /** * DPDK callback to register a PCI device. * @@ -129,8 +136,10 @@ static int eth_qdma_vf_dev_init(struct rte_eth_dev *dev) /* for secondary processes, we don't initialise any further as primary * has already done this work. */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + dev->dev_ops = &qdma_vf_eth_dev_ops; return 0; + } if (once) { RTE_LOG(INFO, PMD, "QDMA PMD VERSION: %s\n", QDMA_PMD_VERSION); @@ -160,6 +169,8 @@ static int eth_qdma_vf_dev_init(struct rte_eth_dev *dev) dma_priv->c2h_bypass_mode = RTE_PMD_QDMA_RX_BYPASS_NONE; dma_priv->h2c_bypass_mode = 0; + dev->dev_ops = &qdma_vf_eth_dev_ops; + dma_priv->config_bar_idx = DEFAULT_VF_CONFIG_BAR; dma_priv->bypass_bar_idx = BAR_ID_INVALID; dma_priv->user_bar_idx = BAR_ID_INVALID;