* [dpdk-dev] [PATCH] net/sfc: fix build when assert enabled
@ 2021-10-13 15:20 Ferruh Yigit
2021-10-13 16:32 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
2021-10-13 16:35 ` [dpdk-dev] [PATCH] " Andrew Rybchenko
0 siblings, 2 replies; 5+ messages in thread
From: Ferruh Yigit @ 2021-10-13 15:20 UTC (permalink / raw)
To: Andrew Rybchenko, Igor Romanov, Andy Moreton, Ivan Malov
Cc: Ferruh Yigit, dev, Raslan Darawsheh
When 'RTE_ENABLE_ASSERT' is enabled (meson -Dc_args=-DRTE_ENABLE_ASSERT)
build fails:
../drivers/net/sfc/sfc_repr.c: In function ‘sfc_repr_start’:
../drivers/net/sfc/sfc_repr.c:251:20:
warning: implicit declaration of function ‘sfc_repr_lock_is_locked’;
did you mean ‘rte_spinlock_is_locked’?
[-Wimplicit-function-declaration]
251 | SFC_ASSERT(sfc_repr_lock_is_locked(sr));
| ^~~~~~~~~~~~~~~~~~~~~~~
Fixes: c85675423f01 ("net/sfc: implement port representor start and stop")
Reported-by: Raslan Darawsheh <rasland@nvidia.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: igor.romanov@oktetlabs.ru
The patch that cause the build error is still in next-net, if the patch
is good it can be squashed into the relevant patch in next-net.
---
drivers/net/sfc/sfc_repr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c
index 6ec83873abd1..02131ce3675d 100644
--- a/drivers/net/sfc/sfc_repr.c
+++ b/drivers/net/sfc/sfc_repr.c
@@ -248,7 +248,9 @@ sfc_repr_start(struct rte_eth_dev *dev)
sfcr_info(sr, "entry");
+#ifdef RTE_LIBRTE_SFC_EFX_DEBUG
SFC_ASSERT(sfc_repr_lock_is_locked(sr));
+#endif
switch (sr->state) {
case SFC_ETHDEV_CONFIGURED:
@@ -319,7 +321,9 @@ sfc_repr_stop(struct rte_eth_dev *dev)
sfcr_info(sr, "entry");
+#ifdef RTE_LIBRTE_SFC_EFX_DEBUG
SFC_ASSERT(sfc_repr_lock_is_locked(sr));
+#endif
switch (sr->state) {
case SFC_ETHDEV_STARTED:
@@ -477,7 +481,9 @@ sfc_repr_configure(struct sfc_repr *sr, uint16_t nb_rx_queues,
sfcr_info(sr, "entry");
+#ifdef RTE_LIBRTE_SFC_EFX_DEBUG
SFC_ASSERT(sfc_repr_lock_is_locked(sr));
+#endif
ret = sfc_repr_check_conf(sr, nb_rx_queues, conf);
if (ret != 0)
@@ -786,7 +792,9 @@ sfc_repr_tx_queue_release(struct rte_eth_dev *dev, uint16_t tx_queue_id)
static void
sfc_repr_close(struct sfc_repr *sr)
{
+#ifdef RTE_LIBRTE_SFC_EFX_DEBUG
SFC_ASSERT(sfc_repr_lock_is_locked(sr));
+#endif
SFC_ASSERT(sr->state == SFC_ETHDEV_CONFIGURED);
sr->state = SFC_ETHDEV_CLOSING;
--
2.31.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v2] net/sfc: fix build when assert enabled
2021-10-13 15:20 [dpdk-dev] [PATCH] net/sfc: fix build when assert enabled Ferruh Yigit
@ 2021-10-13 16:32 ` Andrew Rybchenko
2021-10-13 17:16 ` Ferruh Yigit
2021-10-13 16:35 ` [dpdk-dev] [PATCH] " Andrew Rybchenko
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Rybchenko @ 2021-10-13 16:32 UTC (permalink / raw)
To: dev; +Cc: Raslan Darawsheh
When 'RTE_ENABLE_ASSERT' is enabled (meson -Dc_args=-DRTE_ENABLE_ASSERT)
build fails:
../drivers/net/sfc/sfc_repr.c: In function ‘sfc_repr_start’:
../drivers/net/sfc/sfc_repr.c:251:20:
warning: implicit declaration of function ‘sfc_repr_lock_is_locked’;
did you mean ‘rte_spinlock_is_locked’?
[-Wimplicit-function-declaration]
251 | SFC_ASSERT(sfc_repr_lock_is_locked(sr));
| ^~~~~~~~~~~~~~~~~~~~~~~
Fixes: c85675423f01 ("net/sfc: implement port representor start and stop")
Reported-by: Raslan Darawsheh <rasland@nvidia.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
drivers/net/sfc/sfc_repr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c
index 6ec83873ab..2500b14cb0 100644
--- a/drivers/net/sfc/sfc_repr.c
+++ b/drivers/net/sfc/sfc_repr.c
@@ -116,7 +116,7 @@ sfc_repr_lock_init(struct sfc_repr *sr)
rte_spinlock_init(&sr->lock);
}
-#ifdef RTE_LIBRTE_SFC_EFX_DEBUG
+#if defined(RTE_LIBRTE_SFC_EFX_DEBUG) || defined(RTE_ENABLE_ASSERT)
static inline int
sfc_repr_lock_is_locked(struct sfc_repr *sr)
--
2.30.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/sfc: fix build when assert enabled
2021-10-13 16:32 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
@ 2021-10-13 17:16 ` Ferruh Yigit
0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2021-10-13 17:16 UTC (permalink / raw)
To: Andrew Rybchenko, dev; +Cc: Raslan Darawsheh
On 10/13/2021 5:32 PM, Andrew Rybchenko wrote:
> When 'RTE_ENABLE_ASSERT' is enabled (meson -Dc_args=-DRTE_ENABLE_ASSERT)
> build fails:
> ../drivers/net/sfc/sfc_repr.c: In function ‘sfc_repr_start’:
> ../drivers/net/sfc/sfc_repr.c:251:20:
> warning: implicit declaration of function ‘sfc_repr_lock_is_locked’;
> did you mean ‘rte_spinlock_is_locked’?
> [-Wimplicit-function-declaration]
> 251 | SFC_ASSERT(sfc_repr_lock_is_locked(sr));
> | ^~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: c85675423f01 ("net/sfc: implement port representor start and stop")
>
> Reported-by: Raslan Darawsheh <rasland@nvidia.com>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Squashed into relevant commit [1] in next-net, thanks.
[1]
net/sfc: add port representors infrastructure
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] net/sfc: fix build when assert enabled
2021-10-13 15:20 [dpdk-dev] [PATCH] net/sfc: fix build when assert enabled Ferruh Yigit
2021-10-13 16:32 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
@ 2021-10-13 16:35 ` Andrew Rybchenko
2021-10-13 16:50 ` Ferruh Yigit
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Rybchenko @ 2021-10-13 16:35 UTC (permalink / raw)
To: Ferruh Yigit, Igor Romanov, Andy Moreton, Ivan Malov
Cc: dev, Raslan Darawsheh
On 10/13/21 6:20 PM, Ferruh Yigit wrote:
> When 'RTE_ENABLE_ASSERT' is enabled (meson -Dc_args=-DRTE_ENABLE_ASSERT)
> build fails:
> ../drivers/net/sfc/sfc_repr.c: In function ‘sfc_repr_start’:
> ../drivers/net/sfc/sfc_repr.c:251:20:
> warning: implicit declaration of function ‘sfc_repr_lock_is_locked’;
> did you mean ‘rte_spinlock_is_locked’?
> [-Wimplicit-function-declaration]
> 251 | SFC_ASSERT(sfc_repr_lock_is_locked(sr));
> | ^~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: c85675423f01 ("net/sfc: implement port representor start and stop")
>
> Reported-by: Raslan Darawsheh <rasland@nvidia.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
I'm sorry for the breakage. I've sent v2 which avoid usage of
conditional compilation in function body. I'd prefer to fix
the problem this way. Yes, it is a bit less straight-forward,
but still preferable.
Andrew.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] net/sfc: fix build when assert enabled
2021-10-13 16:35 ` [dpdk-dev] [PATCH] " Andrew Rybchenko
@ 2021-10-13 16:50 ` Ferruh Yigit
0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2021-10-13 16:50 UTC (permalink / raw)
To: Andrew Rybchenko, Igor Romanov, Andy Moreton, Ivan Malov
Cc: dev, Raslan Darawsheh
On 10/13/2021 5:35 PM, Andrew Rybchenko wrote:
> On 10/13/21 6:20 PM, Ferruh Yigit wrote:
>> When 'RTE_ENABLE_ASSERT' is enabled (meson -Dc_args=-DRTE_ENABLE_ASSERT)
>> build fails:
>> ../drivers/net/sfc/sfc_repr.c: In function ‘sfc_repr_start’:
>> ../drivers/net/sfc/sfc_repr.c:251:20:
>> warning: implicit declaration of function ‘sfc_repr_lock_is_locked’;
>> did you mean ‘rte_spinlock_is_locked’?
>> [-Wimplicit-function-declaration]
>> 251 | SFC_ASSERT(sfc_repr_lock_is_locked(sr));
>> | ^~~~~~~~~~~~~~~~~~~~~~~
>>
>> Fixes: c85675423f01 ("net/sfc: implement port representor start and stop")
>>
>> Reported-by: Raslan Darawsheh <rasland@nvidia.com>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>
> I'm sorry for the breakage. I've sent v2 which avoid usage of
> conditional compilation in function body. I'd prefer to fix
> the problem this way. Yes, it is a bit less straight-forward,
> but still preferable.
>
ack, agreed that v2 looks better, I will test and squash it.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-10-13 17:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 15:20 [dpdk-dev] [PATCH] net/sfc: fix build when assert enabled Ferruh Yigit
2021-10-13 16:32 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
2021-10-13 17:16 ` Ferruh Yigit
2021-10-13 16:35 ` [dpdk-dev] [PATCH] " Andrew Rybchenko
2021-10-13 16:50 ` 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).