From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CFFDA0565; Tue, 17 Mar 2020 16:42:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC74C1C123; Tue, 17 Mar 2020 16:39:31 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 3EDF71C11A for ; Tue, 17 Mar 2020 16:39:29 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id s1so4558291wrv.5 for ; Tue, 17 Mar 2020 08:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xm4c8qpZqmZRb0VAU4z8zgptOlEdl+TD08JbcF2tymM=; b=JKJISLStFNZeB6If1dKcFVmNDI6/Kt44Z+pk2fpOPWfUmTGtoyHkgBifwVDILRSzXy CtO58kFBOpdoiI6A3yaQrxkjQgUEDtKESwh28CISfz7Tj1bhqi9oPmRW6jOSS7zXUTWY 0NnymoNeduz1nZqCVA6dkvFNK4Mh3Rr824zEs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Xm4c8qpZqmZRb0VAU4z8zgptOlEdl+TD08JbcF2tymM=; b=AnaZ5ZlfyZEHtDjmhqpAwPtiBgBhWVVBOoGHkx6w0UgZRGnR5TFNHM9Pht/mlN8ki3 +FSBHlUUtMnMnNn5tkHuL76LAYDrNM7Td8eJOV4wfy6OhKNLuHoQtnIvrKua7HKbusBJ 6qPIKhhag24uwSYCppaXm0Gdkd3E/PuH/dhG6eZ0jTkVAlXaU5Z5fgqOa5JCvC67fOcx a/689qUD0rcxyx2FQ+CKoTd5O3+5uju/jhRsOtaxEVuE0egxy5qfPSEX5Fv6nf/a7u2C mSuC+YFRZSaK4/svPejFGIqk39Ea7IrmPF1hAwPDHTsXfGTvqV/7TAgmwFs8mMn30gUE 8ozA== X-Gm-Message-State: ANhLgQ2mH7DhlXb377503psnrV9ZWDIoUi69HWTlx99zyiMso1491DEi FD7QsxwtXrWw494xWZ+qvI4rdz+nN0VlkMiNnshO9TWA336N+EpaTueqQ8e2MGFNdNAmuKys9sv ffEW5BxRCfixThACKxRMHuo3eLscXa1xcWOlxghgGW2nzcqZR+lv0x3xGI9rvDzmPMEsq X-Google-Smtp-Source: ADFU+vt+fRNmESAsyhipsp2iKMr6Bw/PG+bwfYi+8n6VRHCxXsDBBmGybFfUqsnX8//6ee8SRuuNWQ== X-Received: by 2002:a5d:4484:: with SMTP id j4mr7167758wrq.153.1584459568667; Tue, 17 Mar 2020 08:39:28 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id q4sm5052142wro.56.2020.03.17.08.39.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Mar 2020 08:39:28 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Venkat Duvvuru Date: Tue, 17 Mar 2020 21:08:12 +0530 Message-Id: <1584459511-5353-15-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584459511-5353-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1584459511-5353-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH 14/33] net/bnxt: fetch vnic info from DPDK port X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" VNIC is needed for the driver to program the action record for rx flows. VNIC determines what receive rings to use to place the received packets. This patch introduces a routine that will convert a given dpdk port to VNIC. Signed-off-by: Venkat Duvvuru Reviewed-by: Lance Richardson Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_ethdev.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index dd3cde7..fbf6340 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -732,6 +732,7 @@ extern int bnxt_logtype_driver; #define PMD_DRV_LOG(level, fmt, args...) \ PMD_DRV_LOG_RAW(level, fmt, ## args) +uint16_t bnxt_get_vnic_id(uint16_t port); uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif); #endif diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index f3cc745..57ed90f 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -4708,6 +4708,21 @@ bnxt_get_svif(uint16_t port_id, bool func_svif) return func_svif ? bp->func_svif : bp->port_svif; } +uint16_t +bnxt_get_vnic_id(uint16_t port) +{ + struct rte_eth_dev *eth_dev; + struct bnxt_vnic_info *vnic; + struct bnxt *bp; + + eth_dev = &rte_eth_devices[port]; + bp = eth_dev->data->dev_private; + + vnic = BNXT_GET_DEFAULT_VNIC(bp); + + return vnic->fw_vnic_id; +} + static int bnxt_init_fw(struct bnxt *bp) { uint16_t mtu; -- 2.7.4