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 DA856A0563; Wed, 15 Apr 2020 10:23:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3138B1D5AB; Wed, 15 Apr 2020 10:20:04 +0200 (CEST) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id B37F31D59A for ; Wed, 15 Apr 2020 10:20:00 +0200 (CEST) Received: by mail-pj1-f66.google.com with SMTP id b7so6471896pju.0 for ; Wed, 15 Apr 2020 01:20:00 -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=BzgmPlpNtTmiJHpX6lmNoNBy64s5q9mJJ2kYp5st+4Q=; b=BnQl0yivPrSqHr36wgbObqN+Bp/z8jVv9MdgEeCHWZqTSIpQnhs4Te/NkKIGmJhzb4 KBmT/S//yslJ5x2r9hw+m2XF6Mi07tvLMRA/KGNChIhOT8LI49bOKnxDzUDRHL4XuPgA qrU4+BpSwTHCcY3hGG4uicZVw4IkBQ5XTQMHc= 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=BzgmPlpNtTmiJHpX6lmNoNBy64s5q9mJJ2kYp5st+4Q=; b=WBMzwvxoL4VkvbI2w6xjYMWNayxYUaMHk6dEaM0TW3uGiAnWCQb6NiwvPbBwgtneZB w1+DM6qBppkGedStaJRnNdyATSvvZZZbQTVutQPsm4B09uY3OHn7uBt8g8n0QeZp93xf Ht1uAs+BEGkRIksAs4AYJRVtWKhoValUXGXPCZWESRkTUV6B7KMrYlrg/NLaKAmOxsvl 3YkQBLTNa4MPIIxDeO5sBqIBB6BLYdONgipJStgFtpvXzyxZvH/yi1ERNloC3n7wawXU WbFS2cbWfv0EkSLNFybLpgkcCcI4tsHoSN2WqhDWNEykIED/nAmL4onb9RL5CX6PLlBA CoIQ== X-Gm-Message-State: AGi0PuZZEi3dooNbAQ6QORy+CotQzr+V4s8EGWPrSjJGj21fHJt8yr3t UqiJ/9ttmuIol/RFEZOUk6wbEKiLFidJiP8XlmBYEjegQ/5YUp7qdHR2aT+Tl79APldo/57M6bn jefvqYC/Dg37MvpHHHyi+YoHLFMOWHq1QhanH249k7rCQEFgOXOvUxGwEV/oTTGl3zz75 X-Google-Smtp-Source: APiQypKap6TRh8XZ4aUoIzfcI2tuJg1CAilnW8QGrKjINlTq0loYxxAXszii7n5YDmmulwgLd4R4YQ== X-Received: by 2002:a17:902:aa88:: with SMTP id d8mr3761267plr.201.1586938799492; Wed, 15 Apr 2020 01:19:59 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id fy21sm3819019pjb.25.2020.04.15.01.19.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2020 01:19:58 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Venkat Duvvuru Date: Wed, 15 Apr 2020 13:48:51 +0530 Message-Id: <1586938751-32808-15-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586938751-32808-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1586852011-37536-1-git-send-email-venkatkumar.duvvuru@broadcom.com> <1586938751-32808-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH v4 14/34] 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 2ed56f4..c4507f7 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -727,6 +727,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