Hi,

I'm implementing multiqueue for ODP-DPDK as well, where I'm taking a lot of your code, so finally I'm doing a bigger review of this code:

On 15/02/16 10:49, Matias Elo wrote:
@@ -309,6 +335,29 @@ static int odp_dpdk_pktio_init_local(void)
        return 0;
  }

+static int dpdk_input_queues_config(pktio_entry_t *pktio_entry,
+                                   const odp_pktin_queue_param_t *p)
+{
+       odp_pktin_mode_t mode = pktio_entry->s.param.in_mode;
+       odp_bool_t lockless;
+
+       /**
+        * Scheduler synchronizes input queue polls. Only single thread
+        * at a time polls a queue */
+       if (mode == ODP_PKTIN_MODE_SCHED ||
+           p->op_mode == ODP_PKTIO_OP_MT_UNSAFE)
+               lockless = 1;
+       else
+               lockless = 0;
+
+       if (p->hash_enable && p->num_queues > 1)
+               pktio_entry->s.pkt_dpdk.hash = p->hash_proto;

We had a discussion about this when the API was introduced. The final take for me was that this should not influence whether an actual hash is generated, only the fact that hash is used to distribute packets between queues. In DPDK you can't actually make difference between the two, so even if these conditions are not met you have to generate something for odp_packet_flow_hash().
I've simply added this else branch:

        else
                pktio_entry->s.pkt_dpdk.hash.all_bits = UINT32_MAX;



+
+       pktio_entry->s.pkt_dpdk.lockless_rx = lockless;
+
+       return 0;
+}
+
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to