patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/4] net/mvpp2: fix build with gcc 10
       [not found] <20200520135830.1178242-1-thomas@monjalon.net>
@ 2020-05-20 13:58 ` Thomas Monjalon
  2020-05-20 14:05   ` [dpdk-stable] [EXT] " Liron Himi
  2020-05-20 13:58 ` [dpdk-stable] [PATCH 2/4] examples/vm_power: fix build with -fno-common Thomas Monjalon
  2020-05-20 13:58 ` [dpdk-stable] [PATCH 3/4] examples/vm_power: drop Unix path limit redefinition Thomas Monjalon
  2 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2020-05-20 13:58 UTC (permalink / raw)
  To: dev
  Cc: david.marchand, stable, Liron Himi, Natalie Samsonov, Tomasz Duszynski

GCC 10 is detecting the enum mismatch when assigning UDP variables
with MUSDK constants for TCP.

Fixes: 7235341d7517 ("net/mrvl: support classifier")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mvpp2/mrvl_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_flow.c b/drivers/net/mvpp2/mrvl_flow.c
index 381b54e291..ea43255284 100644
--- a/drivers/net/mvpp2/mrvl_flow.c
+++ b/drivers/net/mvpp2/mrvl_flow.c
@@ -2511,14 +2511,14 @@ mrvl_create_cls_table(struct rte_eth_dev *dev, struct rte_flow *first_flow)
 
 	if (first_flow->pattern & F_UDP_SPORT) {
 		key->proto_field[key->num_fields].proto = MV_NET_PROTO_UDP;
-		key->proto_field[key->num_fields].field.tcp = MV_NET_TCP_F_SP;
+		key->proto_field[key->num_fields].field.udp = MV_NET_UDP_F_SP;
 		key->key_size += 2;
 		key->num_fields += 1;
 	}
 
 	if (first_flow->pattern & F_UDP_DPORT) {
 		key->proto_field[key->num_fields].proto = MV_NET_PROTO_UDP;
-		key->proto_field[key->num_fields].field.udp = MV_NET_TCP_F_DP;
+		key->proto_field[key->num_fields].field.udp = MV_NET_UDP_F_DP;
 		key->key_size += 2;
 		key->num_fields += 1;
 	}
-- 
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH 2/4] examples/vm_power: fix build with -fno-common
       [not found] <20200520135830.1178242-1-thomas@monjalon.net>
  2020-05-20 13:58 ` [dpdk-stable] [PATCH 1/4] net/mvpp2: fix build with gcc 10 Thomas Monjalon
@ 2020-05-20 13:58 ` Thomas Monjalon
  2020-05-20 13:58 ` [dpdk-stable] [PATCH 3/4] examples/vm_power: drop Unix path limit redefinition Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2020-05-20 13:58 UTC (permalink / raw)
  To: dev
  Cc: david.marchand, stable, David Hunt, Nemanja Marjanovic,
	Rory Sexton, Santosh Shukla, Konstantin Ananyev

The variables of the same name are merged together
if compiled with -fcommon. It used to be the default.
This default behaviour allows to declare a variable in a header file and
share the variable in every .o binaries thanks to merge at link-time.

If compiling with -fno-common (default in GCC 10), the variable must be
shared as extern to avoid multiple re-definitions.

Fixes: dff22404aaad ("examples/vm_power_mgr: add VCPU to PCPU mapping")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 examples/vm_power_manager/channel_manager.c | 2 ++
 examples/vm_power_manager/channel_manager.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index 4ac21f02c1..4d13697208 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -35,6 +35,8 @@
 
 #define RTE_LOGTYPE_CHANNEL_MANAGER RTE_LOGTYPE_USER1
 
+struct libvirt_vm_info lvm_info[MAX_CLIENTS];
+
 /* Global pointer to libvirt connection */
 static virConnectPtr global_vir_conn_ptr;
 
diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h
index 8284be0a18..a2a2f2bba0 100644
--- a/examples/vm_power_manager/channel_manager.h
+++ b/examples/vm_power_manager/channel_manager.h
@@ -41,7 +41,7 @@ struct libvirt_vm_info {
 	uint8_t num_cpus;
 };
 
-struct libvirt_vm_info lvm_info[MAX_CLIENTS];
+extern struct libvirt_vm_info lvm_info[MAX_CLIENTS];
 /* Communication Channel Status */
 enum channel_status { CHANNEL_MGR_CHANNEL_DISCONNECTED = 0,
 	CHANNEL_MGR_CHANNEL_CONNECTED,
-- 
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH 3/4] examples/vm_power: drop Unix path limit redefinition
       [not found] <20200520135830.1178242-1-thomas@monjalon.net>
  2020-05-20 13:58 ` [dpdk-stable] [PATCH 1/4] net/mvpp2: fix build with gcc 10 Thomas Monjalon
  2020-05-20 13:58 ` [dpdk-stable] [PATCH 2/4] examples/vm_power: fix build with -fno-common Thomas Monjalon
@ 2020-05-20 13:58 ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2020-05-20 13:58 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, stable, David Hunt, Bruce Richardson

The Unix socket path may be as long as UNIX_PATH_MAX.
This constant is supposed to be defined in sys/un.h.
On Linux, it appears to be in linux/un.h.

This constant was re-defined locally, based on a variable declaration.
It is breaking compilation with -fno-common (default in GCC 10)
We could avoid the variable declaration by using NULL struct,
but it looks simpler not redefining this system constant.

As the power library and its examples are restricted to Linux only,
the Linux header file is directly included.

Fixes: 0d74597c1b4f ("examples/vm_power: fix max length of unix socket path")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 examples/vm_power_manager/channel_manager.c | 1 -
 examples/vm_power_manager/channel_manager.h | 7 +------
 examples/vm_power_manager/power_manager.c   | 1 -
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index 4d13697208..74a2a677e8 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -4,7 +4,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/un.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <inttypes.h>
diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h
index a2a2f2bba0..e55376fcdb 100644
--- a/examples/vm_power_manager/channel_manager.h
+++ b/examples/vm_power_manager/channel_manager.h
@@ -10,7 +10,7 @@ extern "C" {
 #endif
 
 #include <linux/limits.h>
-#include <sys/un.h>
+#include <linux/un.h>
 #include <rte_atomic.h>
 #include <stdbool.h>
 
@@ -26,11 +26,6 @@ extern "C" {
 /* FIFO file name template */
 #define CHANNEL_MGR_FIFO_PATTERN_NAME   "fifo"
 
-#ifndef UNIX_PATH_MAX
-struct sockaddr_un _sockaddr_un;
-#define UNIX_PATH_MAX sizeof(_sockaddr_un.sun_path)
-#endif
-
 #define MAX_CLIENTS 64
 #define MAX_VCPUS 20
 
diff --git a/examples/vm_power_manager/power_manager.c b/examples/vm_power_manager/power_manager.c
index 7b4f4b3c4d..cd51d4741f 100644
--- a/examples/vm_power_manager/power_manager.c
+++ b/examples/vm_power_manager/power_manager.c
@@ -6,7 +6,6 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <inttypes.h>
-#include <sys/un.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <dirent.h>
-- 
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [EXT] [PATCH 1/4] net/mvpp2: fix build with gcc 10
  2020-05-20 13:58 ` [dpdk-stable] [PATCH 1/4] net/mvpp2: fix build with gcc 10 Thomas Monjalon
@ 2020-05-20 14:05   ` Liron Himi
  0 siblings, 0 replies; 4+ messages in thread
From: Liron Himi @ 2020-05-20 14:05 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: david.marchand, stable, Natalie Samsonov, Tomasz Duszynski, Liron Himi

Acked-by: Liron Himi <lironh@marvell.com>

Regards,
Liron

-----Original Message-----
From: Thomas Monjalon <thomas@monjalon.net> 
Sent: Wednesday, 20 May 2020 16:58
To: dev@dpdk.org
Cc: david.marchand@redhat.com; stable@dpdk.org; Liron Himi <lironh@marvell.com>; Natalie Samsonov <nsamsono@marvell.com>; Tomasz Duszynski <tdu@semihalf.com>
Subject: [EXT] [PATCH 1/4] net/mvpp2: fix build with gcc 10

External Email

----------------------------------------------------------------------
GCC 10 is detecting the enum mismatch when assigning UDP variables with MUSDK constants for TCP.

Fixes: 7235341d7517 ("net/mrvl: support classifier")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mvpp2/mrvl_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_flow.c b/drivers/net/mvpp2/mrvl_flow.c index 381b54e291..ea43255284 100644
--- a/drivers/net/mvpp2/mrvl_flow.c
+++ b/drivers/net/mvpp2/mrvl_flow.c
@@ -2511,14 +2511,14 @@ mrvl_create_cls_table(struct rte_eth_dev *dev, struct rte_flow *first_flow)
 
 	if (first_flow->pattern & F_UDP_SPORT) {
 		key->proto_field[key->num_fields].proto = MV_NET_PROTO_UDP;
-		key->proto_field[key->num_fields].field.tcp = MV_NET_TCP_F_SP;
+		key->proto_field[key->num_fields].field.udp = MV_NET_UDP_F_SP;
 		key->key_size += 2;
 		key->num_fields += 1;
 	}
 
 	if (first_flow->pattern & F_UDP_DPORT) {
 		key->proto_field[key->num_fields].proto = MV_NET_PROTO_UDP;
-		key->proto_field[key->num_fields].field.udp = MV_NET_TCP_F_DP;
+		key->proto_field[key->num_fields].field.udp = MV_NET_UDP_F_DP;
 		key->key_size += 2;
 		key->num_fields += 1;
 	}
--
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-20 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200520135830.1178242-1-thomas@monjalon.net>
2020-05-20 13:58 ` [dpdk-stable] [PATCH 1/4] net/mvpp2: fix build with gcc 10 Thomas Monjalon
2020-05-20 14:05   ` [dpdk-stable] [EXT] " Liron Himi
2020-05-20 13:58 ` [dpdk-stable] [PATCH 2/4] examples/vm_power: fix build with -fno-common Thomas Monjalon
2020-05-20 13:58 ` [dpdk-stable] [PATCH 3/4] examples/vm_power: drop Unix path limit redefinition Thomas Monjalon

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).