Skip to contentSkip to conversation

net/tap: fix icc build

PATCH In review Ferruh Yigit 2 participants 3 messages Mar 12, 2018 – Apr 24, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/tap: fix icc build

build error:
.../dpdk/drivers/net/tap/rte_eth_tap.c(598):
error #279: controlling expression is constant

	RTE_ASSERT(!"unsupported request type: must not happen");

Although RTE_ASSERT helps debugging this issue when assert enabled, constant expression in assert means this path can be taken during runtime and there is no protection against it when assert is disabled.

Adding error log and error return back, replacing RTE_ASSERT.

Fixes 7748a4b44196 ("net/tap: add debug messages")
---
 drivers/net/tap/rte_eth_tap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/tap/rte_eth_tap.c +3 -1
index f09db0ea9..4bf2d9618 100644
@@ -593,7 +593,9 @@ tap_ioctl(struct pmd_internals *pmd, unsigned long request,
 	case SIOCSIFMTU:
 		break;
 	default:
-		RTE_ASSERT(!"unsupported request type: must not happen");
+		RTE_LOG(WARNING, PMD, "%s: ioctl() called with wrong arg\n",
+			pmd->name);
+		return -EINVAL;
 	}
 	if (ioctl(pmd->ioctl_sock, request, ifr) < 0)
 		goto error;
Signature · 1 line
2.13.6
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines

-----Original Message-----
From: stable [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Monday, March 12, 2018 7:32 PM
To: Pascal Mazon <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; [email protected]
Subject: [dpdk-stable] [PATCH] net/tap: fix icc build

build error:
.../dpdk/drivers/net/tap/rte_eth_tap.c(598):
error #279: controlling expression is constant

	RTE_ASSERT(!"unsupported request type: must not happen");

Although RTE_ASSERT helps debugging this issue when assert enabled, constant expression in assert means this path can be taken during runtime and there is no protection against it when assert is disabled.

Quoted 6 lines

Adding error log and error return back, replacing RTE_ASSERT.

Fixes 7748a4b44196 ("net/tap: add debug messages")
author Applied
#2 lore raw
Quoted 18 lines · Pablo
Quoted 18 lines

-----Original Message-----
From: stable [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Monday, March 12, 2018 7:32 PM
To: Pascal Mazon <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; [email protected]
Subject: [dpdk-stable] [PATCH] net/tap: fix icc build

build error:
.../dpdk/drivers/net/tap/rte_eth_tap.c(598):
error #279: controlling expression is constant

	RTE_ASSERT(!"unsupported request type: must not happen");

Although RTE_ASSERT helps debugging this issue when assert enabled, constant expression in assert means this path can be taken during runtime and there is no protection against it when assert is disabled.

Quoted 8 lines
Quoted 6 lines

Adding error log and error return back, replacing RTE_ASSERT.

Fixes 7748a4b44196 ("net/tap: add debug messages")

Applied to dpdk-next-net/master, thanks.