From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E859EA0096 for ; Thu, 6 Jun 2019 05:31:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4EF2D2C6A; Thu, 6 Jun 2019 05:31:26 +0200 (CEST) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by dpdk.org (Postfix) with ESMTP id E969A2C37 for ; Thu, 6 Jun 2019 05:31:24 +0200 (CEST) Received: by mail-pg1-f172.google.com with SMTP id d30so496219pgm.7 for ; Wed, 05 Jun 2019 20:31:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=csie-io.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=tGHKxUvACuBsvKOKJ/U1ckEVqlJCPhmIq/gsoiUBMRY=; b=ZbRykbvazatxZiIyI11McqjHEaGposMSDZEzWCW87gFBFwOUs/V6jWPHYLmbpuPvC2 C1/pRNvRBBmLZPg6opvc23MJXwwYy7sfH1wMzW3mVFV/9tSqu8NRyYCBNPluF4RPltGL qkTd7H4zWI+yKihG7kVfP4EfMDOuLcOGDChaSYYL6PioJxG9nDJodTh9nkQyTPPaz6N2 TuvlKBWFKxPapP2H80k3fAEukMp4VSBQclfrPsFX48J4kj4CbvFtOpXSStLMT/IOs+QV 6WA15hNh2aTd4vcwBjoGpB0hzqitWHATSErHUax32JKF+TXkwXnz1UhqIzHd6hfynPn0 JJ5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=tGHKxUvACuBsvKOKJ/U1ckEVqlJCPhmIq/gsoiUBMRY=; b=G0GtP/cri92sHTITsX8ExVW+gmadM+7xyE99oNAihH0fWg1kKcP1jukFXHL428pAun YMe0NoUCEY3ZKqPn+blZB6UB7+rO+cqWT6+OytLGn2IJzu5ojf0Dgoax7OS/SUS7hbus bcak/Kj0LtTYHWUQVOjgWf8n9Fm7q2DbNxx6Aftf53M0C9oI58sy3F22fabizaSdteXT K484KyHZL0t6hGrqEWeR+sv+uPauBGS97ygw/T9KrLZG0qxhkq8DJvWf8UojkRAC4tPK 0fEDsk9jFjv/Y2ZOln4wzxdJVtJyTY1ceY4bEUmDBhrwzv+8PvOa2EPxbIOSLFPMx7XS FGEw== X-Gm-Message-State: APjAAAVDxrya118bFofuP3CqUGmxBFK66CWkHoBGjQfR0xOS9Bq7ZT12 7WKX2tEiiMYL7eAMM1dNgDTNyiUJsAs= X-Google-Smtp-Source: APXvYqwMzGbhTqPHaMLM07yHTlMz/67tA74E95XOoWaGdDjqEtqFrK2TrY52ciZUPRnNhR8jQYVzjg== X-Received: by 2002:a63:5024:: with SMTP id e36mr1305822pgb.220.1559791883961; Wed, 05 Jun 2019 20:31:23 -0700 (PDT) Received: from 2001-b400-e285-e3be-106f-fc3c-3214-8675.emome-ip6.hinet.net (2001-b400-e285-e3be-106f-fc3c-3214-8675.emome-ip6.hinet.net. [2001:b400:e285:e3be:106f:fc3c:3214:8675]) by smtp.gmail.com with ESMTPSA id d132sm382115pfd.61.2019.06.05.20.31.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 20:31:23 -0700 (PDT) From: Huai-En Tseng Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Message-Id: <352715A9-AE7E-42FC-BD9B-D386742AA5D7@csie.io> Date: Thu, 6 Jun 2019 11:31:17 +0800 To: users@dpdk.org X-Mailer: Apple Mail (2.3445.104.11) Subject: [dpdk-users] Is rte_ring_dequeue_burst/rte_ring_enqueue_burst just memory address copy from enqueue side to dequeue side? X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi,=20 I am curious about rte_ring_dequeue and rte_ring_enqueue. I notice in rte_ring.h, the dequeue and enqueue mechanism, DEQUEUE_PTRS = and ENQUEUE_PTRS marcos, both are just memory address assignment. At the same time, I get a strange bug in my project. Thread 1 continually enqueue 1 packet every time.=20 Thread 2 also continually dequeue dequeue packets whatever it can and = does some logic operation. However, when thread 2 does some operation taking too long time such as = printf and file io or thread 1 enqueue enqueue packet twice in very = short time interval. The packet thread 2 dequeue will be the next packet content which thread = 1 enqueue. I assume that despite thread 2 dequeue 1 packet, but it actually dequeue = the memory address. Then the cons and prod pointer do dequeue operation and thread 1 is = ready to enqueue next packet to the memory address which thread 2 just = dequeue. However, at the same time, thread 2 is using this memory address and it = is the root cause. Is my assumption correct or something I miss? If my assumption is correct, is there any method can avoid this except = using memcpy? Thanks all.=