From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com
Subject: [dpdk-dev] [PATCH 1/5] net/bnxt: fix to avoid unnecessary memory allocation
Date: Thu, 9 Jul 2020 15:08:28 +0530 [thread overview]
Message-ID: <20200709093832.7616-2-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20200709093832.7616-1-kalesh-anakkur.purayil@broadcom.com>
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
VFs are not privileged to issue HWRM_PORT_LED_QCFG/CFG.
There is no need to allocate "bp->leds" memory.
Fixes: 205b74295282 ("net/bnxt: fix allocation of LED config info")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index d228223..65094a3 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -194,6 +194,9 @@ static void bnxt_free_link_info(struct bnxt *bp)
static void bnxt_free_leds_info(struct bnxt *bp)
{
+ if (BNXT_VF(bp))
+ return;
+
rte_free(bp->leds);
bp->leds = NULL;
}
@@ -263,6 +266,9 @@ static int bnxt_alloc_link_info(struct bnxt *bp)
static int bnxt_alloc_leds_info(struct bnxt *bp)
{
+ if (BNXT_VF(bp))
+ return 0;
+
bp->leds = rte_zmalloc("bnxt_leds",
BNXT_MAX_LED * sizeof(struct bnxt_led_info),
0);
--
2.10.1
next prev parent reply other threads:[~2020-07-09 9:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-09 9:38 [dpdk-dev] [PATCH 0/5] bnxt bug fixes Kalesh A P
2020-07-09 9:38 ` Kalesh A P [this message]
2020-07-09 9:38 ` [dpdk-dev] [PATCH 2/5] net/bnxt: remove unused enum declaration Kalesh A P
2020-07-09 9:38 ` [dpdk-dev] [PATCH 3/5] net/bnxt: fix to not send unnecessary hwrm command Kalesh A P
2020-07-09 9:38 ` [dpdk-dev] [PATCH 4/5] net/bnxt: fix to set flow error when filter create fails Kalesh A P
2020-07-09 9:38 ` [dpdk-dev] [PATCH 5/5] net/bnxt: fix to free filters when flow " Kalesh A P
2020-07-10 14:05 ` [dpdk-dev] [PATCH 0/5] bnxt bug fixes Ajit Khaparde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200709093832.7616-2-kalesh-anakkur.purayil@broadcom.com \
--to=kalesh-anakkur.purayil@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).