* [dpdk-dev] net/nfb: check rxmac array size
@ 2020-03-30 13:53 Jakub Neruda
2020-04-01 6:38 ` Jakub Neruda
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Neruda @ 2020-03-30 13:53 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
The driver wrongly assumed the presence of at least one rxmac in every firmware
and accessed to non-existing unit
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
Acked-by: Jakub Neruda <neruda@netcope.com>
diff --git a/drivers/net/nfb/nfb_rxmode.c b/drivers/net/nfb/nfb_rxmode.c
index 3327c8272..2d0b613d2 100644
--- a/drivers/net/nfb/nfb_rxmode.c
+++ b/drivers/net/nfb/nfb_rxmode.c
@@ -54,7 +54,8 @@ nfb_eth_promiscuous_get(struct rte_eth_dev *dev)
struct nc_rxmac_status status;
status.mac_filter = RXMAC_MAC_FILTER_PROMISCUOUS;
- nc_rxmac_read_status(internals->rxmac[0], &status);
+ if (internals->max_rxmac > 0)
+ nc_rxmac_read_status(internals->rxmac[0], &status);
return (status.mac_filter == RXMAC_MAC_FILTER_PROMISCUOUS);
}
@@ -102,7 +103,9 @@ nfb_eth_allmulticast_get(struct rte_eth_dev *dev)
struct nc_rxmac_status status;
status.mac_filter = RXMAC_MAC_FILTER_PROMISCUOUS;
- nc_rxmac_read_status(internals->rxmac[0], &status);
+
+ if (internals->max_rxmac > 0)
+ nc_rxmac_read_status(internals->rxmac[0], &status);
return (status.mac_filter == RXMAC_MAC_FILTER_TABLE_BCAST_MCAST);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-dev] net/nfb: check rxmac array size
2020-03-30 13:53 [dpdk-dev] net/nfb: check rxmac array size Jakub Neruda
@ 2020-04-01 6:38 ` Jakub Neruda
2020-04-01 17:48 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Neruda @ 2020-04-01 6:38 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
The driver wrongly assumed the presence of at least one rxmac in every
firmware and accessed to non-existing unit
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
Acked-by: Jakub Neruda <neruda@netcope.com>
diff --git a/drivers/net/nfb/nfb_rxmode.c b/drivers/net/nfb/nfb_rxmode.c
index 3327c8272..2d0b613d2 100644
--- a/drivers/net/nfb/nfb_rxmode.c
+++ b/drivers/net/nfb/nfb_rxmode.c
@@ -54,7 +54,8 @@ nfb_eth_promiscuous_get(struct rte_eth_dev *dev)
struct nc_rxmac_status status;
status.mac_filter = RXMAC_MAC_FILTER_PROMISCUOUS;
- nc_rxmac_read_status(internals->rxmac[0], &status);
+ if (internals->max_rxmac > 0)
+ nc_rxmac_read_status(internals->rxmac[0], &status);
return (status.mac_filter == RXMAC_MAC_FILTER_PROMISCUOUS);
}
@@ -102,7 +103,9 @@ nfb_eth_allmulticast_get(struct rte_eth_dev *dev)
struct nc_rxmac_status status;
status.mac_filter = RXMAC_MAC_FILTER_PROMISCUOUS;
- nc_rxmac_read_status(internals->rxmac[0], &status);
+
+ if (internals->max_rxmac > 0)
+ nc_rxmac_read_status(internals->rxmac[0], &status);
return (status.mac_filter == RXMAC_MAC_FILTER_TABLE_BCAST_MCAST);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] net/nfb: check rxmac array size
2020-04-01 6:38 ` Jakub Neruda
@ 2020-04-01 17:48 ` Ferruh Yigit
0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2020-04-01 17:48 UTC (permalink / raw)
To: Jakub Neruda, dev; +Cc: Martin Spinler
On 4/1/2020 7:38 AM, Jakub Neruda wrote:
> From: Martin Spinler <spinler@cesnet.cz>
>
> The driver wrongly assumed the presence of at least one rxmac in every
> firmware and accessed to non-existing unit
>
> Signed-off-by: Martin Spinler <spinler@cesnet.cz>
> Acked-by: Jakub Neruda <neruda@netcope.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-01 17:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30 13:53 [dpdk-dev] net/nfb: check rxmac array size Jakub Neruda
2020-04-01 6:38 ` Jakub Neruda
2020-04-01 17:48 ` Ferruh Yigit
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).