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 5942DA0507 for ; Mon, 4 Apr 2022 15:40:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 298424281A; Mon, 4 Apr 2022 15:40:59 +0200 (CEST) Received: from g-mx1.graph-inc.ir (unknown [5.160.75.124]) by mails.dpdk.org (Postfix) with ESMTP id A187D4068C for ; Mon, 4 Apr 2022 15:40:56 +0200 (CEST) From: Mohammad Malihi Aqdam To: "users@dpdk.org" CC: Mojtaba Tarihi Subject: How to ensure packets of a flow will be distributed in order by rte_distributor Thread-Topic: How to ensure packets of a flow will be distributed in order by rte_distributor Thread-Index: AQHYSCgA2hLuQ/E3R0OuA7qaxxjIaw== Date: Mon, 4 Apr 2022 13:32:15 +0000 Message-ID: <21b7b6d44218408cb080641f16e02400@graph-inc.ir> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: multipart/alternative; boundary="_000_21b7b6d44218408cb080641f16e02400graphincir_" MIME-Version: 1.0 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 --_000_21b7b6d44218408cb080641f16e02400graphincir_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable we are working on an application which uses rte_distributor to distribute p= ackets based on 5 tuple extracted from packets. Each flow associates with a= n object (e.g connection) which will be used by worker logical cores. The p= ackets of the flow must be processed in order and no connection instance mu= st be accessed by two or more workers at the same time. The underlying data structure as a flow manager is of type std::unordeted_m= ap (key is the hash value obtained from nic rss offl= oad based on 5 tuple). To ensure that a connection instance will not be accessed by two worker cor= es, each connection class has a member named ref_cnt. Before processing the= packets of a specific connection, the ref_cnt member value increases and a= fter the completion the member decreases (using rte_atomic16_inc(&connectio= n->ref_cnt) and rte_atomic16_dec(&connection->ref_cnt)). So the value of th= e ref_cnt before processing of each packet must be zero (i.e the connection= is not is use). But according to test results at some iterations the value= of ref_cnt is 1 which determines that the related instance has been distri= buted to another worker core. According to Packet Distributor Library documentation (https://doc.dpdk.org= /guides/prog_guide/packet_distrib_lib.html) No packet ordering guarantees a= re made about packets which do not share a common packet tag and it seems t= hat the ordering will be preserved for packets of a particular flow (with t= he same tag) but the test results shows that the packets of a flow may be d= istributed to two distinct workers. I want to know, if the distributor decides to distribute the packets of a f= low while the older related packets still are under process in a worker, wh= ether the distributor waits until the processing of older packets finishes = or it distribute the new packets to another worker. Thanks for considering my request --_000_21b7b6d44218408cb080641f16e02400graphincir_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

we are working on an application which uses rte_distributor to distrib= ute packets based on 5 tuple extracted from packets. Each flow associates w= ith an object (e.g connection) which will be used by worker logical cores.&= nbsp;The packets of the flow must be processed in order and no connection instance must be accessed by two or m= ore workers at the same time.
The underlying data structure as a flow manager is of type std::unorde= ted_map<unsigned, connection*> (key is the hash value obtained from n= ic rss offload based on 5 tuple).
To ensure that a connection instance will not be accessed by two worke= r cores, each connection class has a member named ref_cnt. Before processin= g the packets of a specific connection, the ref_cnt member value increases = and after the completion the member decreases (using rte_atomic16_inc(&connection->ref_cnt) and rte_ato= mic16_dec(&connection->ref_cnt)). So the value of the ref_cnt before= processing of each packet must be zero (i.e the connection is not is use).= But according to test results at some iterations the value of ref_cnt is 1 which determines that the related instance has b= een distributed to another worker core.
According to Packet Distributor Library documentation (https://d= oc.dpdk.org/guides/prog_guide/packet_distrib_lib.html) No packet ordering g= uarantees are made about packets which do not share a common packet tag= and it seems that the ordering will be preserved for packets of a particular flow (with the same tag) but= the test results shows that the packets of a flow may be distributed to tw= o distinct workers.
I want to know, if the distributor decides to distribute the packets o= f a flow while the older related packets still are under process in a worke= r, whether the distributor waits until the processing of older packets= finishes or it distribute the new packets to another worker.

Thanks for considering my request

--_000_21b7b6d44218408cb080641f16e02400graphincir_--