diff mbox

[ovs-dev] netdev-dpdk: assume dpdkr peer can be multi-producer/consumer

Message ID 1447712687-9467-1-git-send-email-mauricio.vasquezbernal@studenti.polito.it
State Accepted
Headers show

Commit Message

Mauricio Vásquez Nov. 16, 2015, 10:24 p.m. UTC
Although netdev does explicit locking, it is only valid from the ovs 
perspective, then only the ring ends used by ovs should be declared as
single producer/consumer.
The other ends that are used by the application should be declared as
multiple producer/consumer that is the most general case.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
---
 lib/netdev-dpdk.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Flavio Leitner Nov. 16, 2015, 10:43 p.m. UTC | #1
On Mon, Nov 16, 2015 at 11:24:47PM +0100, Mauricio Vasquez B wrote:
> Although netdev does explicit locking, it is only valid from the ovs 
> perspective, then only the ring ends used by ovs should be declared as
> single producer/consumer.
> The other ends that are used by the application should be declared as
> multiple producer/consumer that is the most general case.
> 
> Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
> ---

Thank you for following up with a fixed patch.  One small thing, please
put a version to your patches, so that people can refer easily to it.
Since the patch version is dropped during merge, you don't need to
worry about this one.

Acked-by: Flavio Leitner <fbl@sysclose.org>
Daniele Di Proietto Nov. 19, 2015, 9:35 p.m. UTC | #2
Thanks for the patch Mauricio and thanks for the reviews Ben, Kevin and
Flavio.

Pushed to master

On 16/11/2015 14:24, "Mauricio Vasquez B"
<mauricio.vasquezbernal@studenti.polito.it> wrote:

>Although netdev does explicit locking, it is only valid from the ovs
>perspective, then only the ring ends used by ovs should be declared as
>single producer/consumer.
>The other ends that are used by the application should be declared as
>multiple producer/consumer that is the most general case.
>
>Signed-off-by: Mauricio Vasquez B
><mauricio.vasquezbernal@studenti.polito.it>
>---
> lib/netdev-dpdk.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
>index 4658416..e3a0771 100644
>--- a/lib/netdev-dpdk.c
>+++ b/lib/netdev-dpdk.c
>@@ -1931,9 +1931,9 @@ dpdk_ring_create(const char dev_name[], unsigned
>int port_no,
>         return -err;
>     }
> 
>-    /* Create single consumer/producer rings, netdev does explicit
>locking. */
>+    /* Create single producer tx ring, netdev does explicit locking. */
>     ivshmem->cring_tx = rte_ring_create(ring_name, DPDK_RING_SIZE,
>SOCKET0,
>-                                        RING_F_SP_ENQ | RING_F_SC_DEQ);
>+                                        RING_F_SP_ENQ);
>     if (ivshmem->cring_tx == NULL) {
>         rte_free(ivshmem);
>         return ENOMEM;
>@@ -1944,9 +1944,9 @@ dpdk_ring_create(const char dev_name[], unsigned
>int port_no,
>         return -err;
>     }
> 
>-    /* Create single consumer/producer rings, netdev does explicit
>locking. */
>+    /* Create single consumer rx ring, netdev does explicit locking. */
>     ivshmem->cring_rx = rte_ring_create(ring_name, DPDK_RING_SIZE,
>SOCKET0,
>-                                        RING_F_SP_ENQ | RING_F_SC_DEQ);
>+                                        RING_F_SC_DEQ);
>     if (ivshmem->cring_rx == NULL) {
>         rte_free(ivshmem);
>         return ENOMEM;
>-- 
>1.9.1
>
>_______________________________________________
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Sm
>B5nZacmXNq0gKCC1s_Cw5yUNjxgD4v5kJqZ2uWLlE&m=gYYdJwLdGDiCdhjtN91R4-aLaosUOX
>LPKhkA6lfV6oo&s=iOkKPzjurb5bOnumGOq9_Kb02bJL3U1YLoS_0e8Fg_s&e=
diff mbox

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 4658416..e3a0771 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1931,9 +1931,9 @@  dpdk_ring_create(const char dev_name[], unsigned int port_no,
         return -err;
     }
 
-    /* Create single consumer/producer rings, netdev does explicit locking. */
+    /* Create single producer tx ring, netdev does explicit locking. */
     ivshmem->cring_tx = rte_ring_create(ring_name, DPDK_RING_SIZE, SOCKET0,
-                                        RING_F_SP_ENQ | RING_F_SC_DEQ);
+                                        RING_F_SP_ENQ);
     if (ivshmem->cring_tx == NULL) {
         rte_free(ivshmem);
         return ENOMEM;
@@ -1944,9 +1944,9 @@  dpdk_ring_create(const char dev_name[], unsigned int port_no,
         return -err;
     }
 
-    /* Create single consumer/producer rings, netdev does explicit locking. */
+    /* Create single consumer rx ring, netdev does explicit locking. */
     ivshmem->cring_rx = rte_ring_create(ring_name, DPDK_RING_SIZE, SOCKET0,
-                                        RING_F_SP_ENQ | RING_F_SC_DEQ);
+                                        RING_F_SC_DEQ);
     if (ivshmem->cring_rx == NULL) {
         rte_free(ivshmem);
         return ENOMEM;