git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/bnxt: fix allocation of LED config info
[dpdk.git]
/
drivers
/
net
/
bnxt
/
bnxt_ethdev.c
diff --git
a/drivers/net/bnxt/bnxt_ethdev.c
b/drivers/net/bnxt/bnxt_ethdev.c
index
dab291c
..
3bd30df
100644
(file)
--- a/
drivers/net/bnxt/bnxt_ethdev.c
+++ b/
drivers/net/bnxt/bnxt_ethdev.c
@@
-191,6
+191,12
@@
static uint16_t bnxt_rss_hash_tbl_size(const struct bnxt *bp)
return bnxt_rss_ctxts(bp) * BNXT_RSS_ENTRIES_PER_CTX_THOR;
}
return bnxt_rss_ctxts(bp) * BNXT_RSS_ENTRIES_PER_CTX_THOR;
}
+static void bnxt_free_leds_info(struct bnxt *bp)
+{
+ rte_free(bp->leds);
+ bp->leds = NULL;
+}
+
static void bnxt_free_mem(struct bnxt *bp, bool reconfig)
{
bnxt_free_filter_mem(bp);
static void bnxt_free_mem(struct bnxt *bp, bool reconfig)
{
bnxt_free_filter_mem(bp);
@@
-213,6
+219,17
@@
static void bnxt_free_mem(struct bnxt *bp, bool reconfig)
bp->grp_info = NULL;
}
bp->grp_info = NULL;
}
+static int bnxt_alloc_leds_info(struct bnxt *bp)
+{
+ bp->leds = rte_zmalloc("bnxt_leds",
+ BNXT_MAX_LED * sizeof(struct bnxt_led_info),
+ 0);
+ if (bp->leds == NULL)
+ return -ENOMEM;
+
+ return 0;
+}
+
static int bnxt_alloc_mem(struct bnxt *bp, bool reconfig)
{
int rc;
static int bnxt_alloc_mem(struct bnxt *bp, bool reconfig)
{
int rc;
@@
-693,6
+710,8
@@
static uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
speed_capa |= ETH_LINK_SPEED_50G;
if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB)
speed_capa |= ETH_LINK_SPEED_100G;
speed_capa |= ETH_LINK_SPEED_50G;
if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB)
speed_capa |= ETH_LINK_SPEED_100G;
+ if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_200GB)
+ speed_capa |= ETH_LINK_SPEED_200G;
if (bp->link_info.auto_mode == HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE)
speed_capa |= ETH_LINK_SPEED_FIXED;
if (bp->link_info.auto_mode == HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE)
speed_capa |= ETH_LINK_SPEED_FIXED;
@@
-1214,6
+1233,8
@@
static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
bnxt_uninit_resources(bp, false);
bnxt_uninit_resources(bp, false);
+ bnxt_free_leds_info(bp);
+
eth_dev->dev_ops = NULL;
eth_dev->rx_pkt_burst = NULL;
eth_dev->tx_pkt_burst = NULL;
eth_dev->dev_ops = NULL;
eth_dev->rx_pkt_burst = NULL;
eth_dev->tx_pkt_burst = NULL;
@@
-2404,10
+2425,11
@@
bnxt_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
uint8_t fw_major = (bp->fw_ver >> 24) & 0xff;
uint8_t fw_minor = (bp->fw_ver >> 16) & 0xff;
uint8_t fw_updt = (bp->fw_ver >> 8) & 0xff;
uint8_t fw_major = (bp->fw_ver >> 24) & 0xff;
uint8_t fw_minor = (bp->fw_ver >> 16) & 0xff;
uint8_t fw_updt = (bp->fw_ver >> 8) & 0xff;
+ uint8_t fw_rsvd = bp->fw_ver & 0xff;
int ret;
int ret;
- ret = snprintf(fw_version, fw_size, "%d.%d.%d",
- fw_major, fw_minor, fw_updt);
+ ret = snprintf(fw_version, fw_size, "%d.%d.%d
.%d
",
+ fw_major, fw_minor, fw_updt
, fw_rsvd
);
ret += 1; /* add the size of '\0' */
if (fw_size < (uint32_t)ret)
ret += 1; /* add the size of '\0' */
if (fw_size < (uint32_t)ret)
@@
-5356,6
+5378,10
@@
bnxt_dev_init(struct rte_eth_dev *eth_dev)
"Failed to allocate hwrm resource rc: %x\n", rc);
goto error_free;
}
"Failed to allocate hwrm resource rc: %x\n", rc);
goto error_free;
}
+ rc = bnxt_alloc_leds_info(bp);
+ if (rc)
+ goto error_free;
+
rc = bnxt_init_resources(bp, false);
if (rc)
goto error_free;
rc = bnxt_init_resources(bp, false);
if (rc)
goto error_free;