examples/l2fwd-event: fix build on RHEL 7.6
authorDavid Marchand <david.marchand@redhat.com>
Fri, 8 Nov 2019 10:04:42 +0000 (11:04 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 8 Nov 2019 15:40:29 +0000 (16:40 +0100)
CC l2fwd_event_generic.o
.../l2fwd_event_generic.c: In function
  ‘l2fwd_rx_tx_adapter_setup_generic’:
.../l2fwd_event_generic.c:203:3: error: missing initializer for field
  ‘impl_opaque’ of ‘struct <anonymous>’
  [-Werror=missing-field-initializers]
   }
   ^
In file included from .../l2fwd_event_generic.c:10:0:
.../include/rte_eventdev.h:1057:12: note: ‘impl_opaque’ declared here
    uint8_t impl_opaque;
            ^

  CC l2fwd_event_internal_port.o
.../l2fwd_event_internal_port.c: In function
  ‘l2fwd_rx_tx_adapter_setup_internal_port’:
.../l2fwd_event_internal_port.c:201:3: error: missing initializer for
  field ‘impl_opaque’ of ‘struct <anonymous>’
  [-Werror=missing-field-initializers]
   }
   ^
In file included from .../l2fwd_event_internal_port.c:10:0:
.../include/rte_eventdev.h:1057:12: note: ‘impl_opaque’ declared here
    uint8_t impl_opaque;
            ^

Fixes: 50f05aa6ed9a ("examples/l2fwd-event: setup Rx/Tx adapter")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
examples/l2fwd-event/l2fwd_event_generic.c
examples/l2fwd-event/l2fwd_event_internal_port.c

index f996081..b7e467c 100644 (file)
@@ -195,13 +195,7 @@ static void
 l2fwd_rx_tx_adapter_setup_generic(struct l2fwd_resources *rsrc)
 {
        struct l2fwd_event_resources *evt_rsrc = rsrc->evt_rsrc;
-       struct rte_event_eth_rx_adapter_queue_conf eth_q_conf = {
-               .rx_queue_flags = 0,
-               .ev = {
-                       .queue_id = 0,
-                       .priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-               }
-       };
+       struct rte_event_eth_rx_adapter_queue_conf eth_q_conf;
        uint8_t event_d_id = evt_rsrc->event_d_id;
        uint8_t rx_adptr_id = 0;
        uint8_t tx_adptr_id = 0;
@@ -210,6 +204,9 @@ l2fwd_rx_tx_adapter_setup_generic(struct l2fwd_resources *rsrc)
        uint32_t service_id;
        int32_t ret, i = 0;
 
+       memset(&eth_q_conf, 0, sizeof(eth_q_conf));
+       eth_q_conf.ev.priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
+
        /* Rx adapter setup */
        evt_rsrc->rx_adptr.nb_rx_adptr = 1;
        evt_rsrc->rx_adptr.rx_adptr = (uint8_t *)malloc(sizeof(uint8_t) *
index bed9475..b382763 100644 (file)
@@ -193,13 +193,7 @@ static void
 l2fwd_rx_tx_adapter_setup_internal_port(struct l2fwd_resources *rsrc)
 {
        struct l2fwd_event_resources *evt_rsrc = rsrc->evt_rsrc;
-       struct rte_event_eth_rx_adapter_queue_conf eth_q_conf = {
-               .rx_queue_flags = 0,
-               .ev = {
-                       .queue_id = 0,
-                       .priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-               }
-       };
+       struct rte_event_eth_rx_adapter_queue_conf eth_q_conf;
        uint8_t event_d_id = evt_rsrc->event_d_id;
        uint16_t adapter_id = 0;
        uint16_t nb_adapter = 0;
@@ -207,6 +201,9 @@ l2fwd_rx_tx_adapter_setup_internal_port(struct l2fwd_resources *rsrc)
        uint8_t q_id = 0;
        int ret;
 
+       memset(&eth_q_conf, 0, sizeof(eth_q_conf));
+       eth_q_conf.ev.priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
+
        RTE_ETH_FOREACH_DEV(port_id) {
                if ((rsrc->enabled_port_mask & (1 << port_id)) == 0)
                        continue;