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 CF6BCA057B; Mon, 13 Apr 2020 21:44:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DBA331C112; Mon, 13 Apr 2020 21:42:20 +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 93B981BEE3 for ; Mon, 13 Apr 2020 21:42:18 +0200 (CEST) Received: by mail-pj1-f66.google.com with SMTP id ay6so2079656pjb.0 for ; Mon, 13 Apr 2020 12:42:18 -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=hamvOug2PuI3/myMVwMH+YeUJej5gWi5o+x7WeG5F3XCKsnfnLQT+akikdU0jaSP6u yliN8DLHefnWKdsQezLu0ZxKlIoYJtMU/PnNn30MqALxIQ6WSgZJRXW1kvwD5CdkwhrJ 9uvgaq3ajOwyE8l5fAIgZbCDtgh4Vv2nrjgcw= 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=SDhym/SbdjgQXlobtCZkfEDLmk1S3DayI3dH8bWGRr+xhI8jcZbH5uWDOVmFD/O13H Q/tPx/ehQPJDe6FJegBjIpLUVkUC07J6J93kIcI47cRyneYUw6H4ptLWKNbwNgnK1xcg in6GqJLIFFVN8AhWMo6kGNXXh1bvkkewvHBoJ1eahGxnBwu5LNSDHjUXTU2VxLoKFWV2 cLnIM1zdT5iey7tgxJiWzixcnSVfMPZTUYOPYllzW+Rlx3E3f/kqaDqxPvyCWGH68QkN +0qkPIvoEjb9xWx2Xr7dS6GiCQQH2ma5bYg572V4tE3d33x/1TjRNdOuiBE+0G78O2Dn SrSw== X-Gm-Message-State: AGi0PuacMj/U07xS4/1TT4s1wGtfGoKPkVxMSrxVMdVQp7kPyVofXddq UeLpYOAf9GXEFdDrgKCvN6/nz3/gPfAer8rb4h7CmZmtSybOvETatw86uxeVpdnAgIc07VjFf1r MqY/lvvFDTiXmCVwGzDgJ1/DHiS6Fc7VBBlp5BjmIPLen+TPZ9ksfh6DSLQn2Y81I/pfS X-Google-Smtp-Source: APiQypIO65vHOAsECQcoWu4CQNsvhlxbtvVgxGs+lh76ncqKi6BmRiYaEahPCzIQZf8CBT/7+AOodw== X-Received: by 2002:a17:90a:c583:: with SMTP id l3mr24459187pjt.84.1586806936936; Mon, 13 Apr 2020 12:42:16 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 9sm1381663pfn.204.2020.04.13.12.42.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2020 12:42:16 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Venkat Duvvuru Date: Tue, 14 Apr 2020 01:09:51 +0530 Message-Id: <1586806811-21736-15-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586806811-21736-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1584459511-5353-1-git-send-email-venkatkumar.duvvuru@broadcom.com> <1586806811-21736-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH v2 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