On 12/01/2014 07:48 PM, Taras Kondratiuk wrote:
On 11/27/2014 11:38 AM, Stuart Haslam wrote:
In ODP_PACKET_SOCKET_MMSG or ODP_PACKET_SOCKET_BASIC modes, when the
same interface is opened multiple times an attempt is made to use a
single socket descriptor for all instances. There are a few issues with
the implementation though;

  - a desciptor value of 0 is used to indicate an unused entry, but
    this is a valid value for a socket descriptor
  - the first call to odp_pktio_close() will close the socket leaving
    any other instances with a stale descriptor
  - descriptors are never removed from the raw_sockets list, so the
    sequence open->close->open for a single interface results in a
    stale descriptor

Reviewed-by: Taras Kondratiuk <taras.kondrat...@linaro.org>

Wouldn't it be simpler to add refcounting at pktio level and just return the same handle to all threads on odp_pktio_open()?
What is the advantage of having separate pktio handles in each thread?
Any pktio parameters that can be configured differently per thread?

That might be part which we are missing. Opening several pktio devices for same name should be avoided or behavior should be documented. For linux-generic there is packet mmap feature where you open several sockets and kernel does flow hashing and packets distribution to that sockets. And with just raw sockets that does not work because each socket will get a duplicate copy of packet. But linux-generic has to follow SoC requirements and might be right solution is just abort() on pktio_open() for already opened pktio device.

But anyway I'm applying this patch due to it fixes current bug.

Maxim.


_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to