From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 96EE0F11 for ; Thu, 30 Aug 2018 02:44:44 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id s13-v6so3044779pfi.7 for ; Wed, 29 Aug 2018 17:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fzD7t8lDFj02OAlhJ/j7sJ8YUFiKeugL4UnORboWHho=; b=Yz+c6qyjDtBL2nROmtfgTRXL5sevj81PHyKEgDY/NeGddK2wKhYVkrvKSPtjLaXg1u GdR3ORtOnhcGpBxLZ3Bsrft74zAgWfL4CyCjhu8kzA32qblpxSdheuVq732mHF6ggFtR aMU05rxENaWtCyMeSELVPn/AEy1vgg8OgHRH/MAEZoVVrdw/uIEOiqMDiNO4XXVHpXL2 Shyv0LWXgT6dR9rHuwECXGrpJfIHdrPwXo9meRjWGrwZIK+IMgoCN+eI0S4kauCPW0tM b8VSELEWA8y+dDokAVfA1hrZn5Z8cBW3C+y78HkuATA4qYbwtEaNf9pe3Xdlrv4maEVL 5xTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fzD7t8lDFj02OAlhJ/j7sJ8YUFiKeugL4UnORboWHho=; b=Mq2htQ+mLcCpQ8hMVpGGZhYtD6pwt3yxJlkLnkTCgbWT10rm2gisnGUqeAI+7uGkdh JUHbxBuzZwRbPSIBisbzMmAFh2rjeXpQbj+aqfOsNtlmF+bDma5/bIcdGD2xdMA/Qwyg Z9Dy1S0IX8unhMiGbL0rL0aPfiExI1A+K4JGJr9dxBzGBon8XYzRmls6j0TvRbRvQX0F dlz6StaizHjot6eYNuwaRPNN2a9INigUDDJuH8Ve45eRkHw05mEhBREDuDO/+LkMlhh0 7RvvmJrlBZUAqYMn9fUtZc7prPTZk4LEJaGtP6cR/HaO1dNcf/5WOHKwraR3QRJLvcnS qJVQ== X-Gm-Message-State: APzg51C+84xKqHrnAdwucmkYcGpZTulS/q928GDTQVrh9D2BioPR34WT hTruwNBpdmiqEt2ZPOIof2Z1Dg== X-Google-Smtp-Source: ANB0VdYwtdyXk7EoseMi7fB1pdMZWkLBxUTi3nT4pqPjByGdBt16K8YwA1DOFRmvyopRtJ1AqJUj1A== X-Received: by 2002:a63:d857:: with SMTP id k23-v6mr7620329pgj.106.1535589883660; Wed, 29 Aug 2018 17:44:43 -0700 (PDT) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id t70-v6sm6699127pgd.54.2018.08.29.17.44.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Aug 2018 17:44:43 -0700 (PDT) Date: Wed, 29 Aug 2018 17:44:36 -0700 From: Stephen Hemminger To: Sungho Hong Cc: users@dpdk.org Message-ID: <20180829174436.281677a0@xeon-e3> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-users] Proper way of notifying the application that DPDK received messages 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: , X-List-Received-Date: Thu, 30 Aug 2018 00:44:45 -0000 On Wed, 29 Aug 2018 16:56:51 -0700 Sungho Hong wrote: > Hello > > currently, I'am using dpdk by sending and receiving the packets in to the > rte-rings. I'am having difficulty of finding the proper way of to notify > the application that the DPDK received incoming messages. > > In order to check the whether the rte_ring has received the data or not, I > run a busy loop on the rte_ring. > here is the example below > > while (1) { > if (rte_ring_dequeue(rx_ring, &_msg) < 0) { > usleep(5); > } else { > recv_msg = (char *) _msg; > if (chara_debug) printf("[%d] Server merge > data::[%.24s...]__length::[%ld]\n", batched_packets, recv_msg, > strlen(recv_msg)); > collect_packets++; > if (collect_packets > MERGE_PACKETS) break; > } > } > > However, my fellow developers say that this is not a efficient way nor the > proper way of checking received messages. Busy polling should be only done > in the DPDK API and not in the application. > > Is there a way for DPDK to send a signal to the application so that the > application can only check the rte_ring only when there is a received > message?. If you notification, look into the interrupt mode.