From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0BC042490 for ; Thu, 26 Jan 2023 12:09:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4222640A79; Thu, 26 Jan 2023 12:09:01 +0100 (CET) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by mails.dpdk.org (Postfix) with ESMTP id 6C9D240697 for ; Thu, 26 Jan 2023 12:08:59 +0100 (CET) Received: by mail-qk1-f180.google.com with SMTP id s19so658855qkg.7 for ; Thu, 26 Jan 2023 03:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1BNSZRJGENSkFHHEKTKqYoYaM7S/FNcWxeeaiaVg52I=; b=eZ1JO7H7xegn3rP9ns0Hr2hqbm3Az90EgR8qQHsNoRheN154yXpeBGJbXrU1HOKjTw llzfZAMcr1BhP+2SrxQoBr8iIEHHWywheqrgtHCz5U8bRJe1EFvYKGqRUo0/ExP8WXM6 784oXlHIb/NLYYRyoqsG+VZl/vkSrbdyJ7dhuqPWftlDqCTbs5kwVqRD9KJuUvlLQnq9 tQ+U+xrCmidS/TxiCSxmHFjgCTvGDu3eeQKwavVjjbo4TJYyn8Kr7mT+aQYYhkdWckSA Xq9gJERGumKSe40bh4ZP+/5ZcHqtbTuNkcQUTvSW+LxoFnvL1sJu+GesG/cqj3nTySp0 V8xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1BNSZRJGENSkFHHEKTKqYoYaM7S/FNcWxeeaiaVg52I=; b=OeI9C9f5urYwyHaku6s7gKAYFpVG+oIWp1zOgsV1b86HKvJ8U7B8bQFcYrASX+SoFh JHlzAD7kjMoRht2S6poWfdZQTPXalzS0bjfwhQwyT599lKwI0s/703EVi2gnx6PIvZOd dAa/olkER5q0wbo3jD3jzJ/Zs5bf2NPo2vzs+5kl80H7oE1mTa7Y5jn/MCGsj1xkn3vH qTo7M+gXtDLIieYTUPQj4qUls73g2azhUUkTuN0/qBINqlpPWApTojh9RNC01Dm1pBNb 1/yZooWd5xoamTo1HhWylTHFGiw75Gx1ncXRb1XoIyquV/qHaFrANpRvZXZuS7Wn6Sc6 0SZQ== X-Gm-Message-State: AFqh2kodTY21j0+RaXnZEc6RvVJ+Q5IdQycusFqAZo2fizaJVO0rtbQ/ wY5i7V3pVODD8YSAngDYSJN58mYrXWTK8nAWq5E= X-Google-Smtp-Source: AMrXdXuQQlfDcCEjWUoExHdu9+/Naapfkmd+ujnZqssSNZlDcYP5CvZv80OAcDQBQ+vx41Zz7Vv0R5AJSxhCazjEZSc= X-Received: by 2002:a05:620a:ce8:b0:706:4a61:3778 with SMTP id c8-20020a05620a0ce800b007064a613778mr1226253qkj.297.1674731338694; Thu, 26 Jan 2023 03:08:58 -0800 (PST) MIME-Version: 1.0 References: <945211674729151@mail.yandex.ru> In-Reply-To: <945211674729151@mail.yandex.ru> From: Pavel Vazharov Date: Thu, 26 Jan 2023 13:08:47 +0200 Message-ID: Subject: Re: Sending/Enqueue a from different threads to single queue --- how to ? To: "Ruslan R. Laishev" Cc: "users@dpdk.org" Content-Type: multipart/alternative; boundary="0000000000008983cc05f328c60c" X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --0000000000008983cc05f328c60c Content-Type: text/plain; charset="UTF-8" On Thu, Jan 26, 2023 at 12:46 PM Ruslan R. Laishev wrote: > Hello! > > Continue studying DPDK ... > > I have a some nano-task : I'm need to send a packet/mbuf to queue of a > device from separate worker . > > Several workers (every worker run on own lcore) send/receive packets > to/from queues of devices > worker #0 ------- port0/que0 > - port1/que0 > - portN/que0 > worker #1 ------- port0/que1 > - port1/que1 > - portN/que1 > ... > worker #N ------- port0/queN > - port1/queN > - portN/queN > > There is a yet another thread which want to send mbuf/packet to queue #0 > (just for example) to every device > Hi, I don't think you can inject packets into the device queues. However, you can achieve the same, sending mbufs between the worker threads, using the provided ring functionality of DPDK - http://doc.dpdk.org/guides/prog_guide/ring_lib.html. The worker threads will need to try to dequeue regularly for the shared ring(s). Regards. --0000000000008983cc05f328c60c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Thu, Jan 26, 2023 at 12:46 PM Ruslan R= . Laishev <zator@yandex.ru> wr= ote:
Hello!
=C2= =A0
Continu= e studying DPDK ...
=C2=A0
I have a some nano-task : I'm need to = send a packet/mbuf to queue of a device from separate worker .
=
=C2=A0
Several workers (every worker run on own lcore) send/receive packets to/fr= om queues of devices
worker #0 ------- port0/que0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - port1/que0=
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 - portN/que0
worker #1 ------- port0/que1 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - port1/que1
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - portN/que1
...
worker #N ------- port0/queN =C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - port1/queN
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 - portN/queN

There is = a yet another thread which want to send mbuf/packet to queue #0 (just for e= xample) to every device

<= div>
Hi,

I don't think you can inject packet= s into the device queues.

However, you can achieve the s= ame, sending mbufs between the worker threads, using the provided ring func= tionality of DPDK - http://doc.dpdk.org/guides/prog_guide/ring_lib.html.
The worker threads will need to try to dequeue regularly for the shared ri= ng(s).

Regards.
--0000000000008983cc05f328c60c--