From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id 6C7702BF2 for ; Tue, 29 Mar 2016 18:54:04 +0200 (CEST) Received: by mail-pf0-f170.google.com with SMTP id 4so19114680pfd.0 for ; Tue, 29 Mar 2016 09:54:04 -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=0/ac5O6tMK+FEP/4zZPLvkb441H0MJcC1yqCTKbYOFo=; b=Gyk+CTcgxGu0LeI5UAgS62u8efPcX6sEd0lwwcBzno+pQ7/DKnpjbSptyQNDZkevll fcBPHhT0sVTWvlLvJULPzS3HepLve5dPF2GwykYIPkOiTi1cS5seQ4qpVsFf0MjCkvsv 8BMM1NGPSN8ffkpcpngtcPJmtIMBWzBHXPVdTsYbgL27SRozga+XFc9ghcOHVGOGDsKl xHKSy4Z01peYLf2E5qiBWDhaEnyOL2SUY15lg/ad+DdJmkbd/On5Uxut+xsvM1PeJEPj PWA+Gtf4EDfwy9cEqxIhi9BSP6QdsCHRdrhCiQWQ8xuIciBwH1wALgT4Qd5THORdzpjc g5DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0/ac5O6tMK+FEP/4zZPLvkb441H0MJcC1yqCTKbYOFo=; b=D1rdY7kj2a42Of/zIsQoXeYw8Utml1J3gbSDOqIdLdB0Pfot+8l/t8u33EG29o319G j7opEO7ruBojd6rLmAYKiM5rJ3Wir/bNQE0DLZ4mSoI9KNJxFcUEBy7TkbPCPLTXVY/5 iGpuU2fvugEfk+XmdUCYWVBASIkG88n66Ho89MqekJ0G/FIqdgde4Qwz84DTV2YOLQvW x5HiztAz8/uwyp+tglRyVy72mnaClRTcPQ2XSCLOb8K+zeC3zVZ6EDdhl2BFSYDpdMTn MRSRo3/GpAopTE0SpYisrHfn/I1Y/0dvQ6lkp2M83m6db6HtO0NH5cKJkKEl1KWaBS58 q+4Q== X-Gm-Message-State: AD7BkJJPreM1VB8Ptc/aYRVopCejBE4/XsCccnuO+rQ6dry3AZAdQUg8CgfHPCYIsyDacg== X-Received: by 10.98.89.209 with SMTP id k78mr5132085pfj.56.1459270443742; Tue, 29 Mar 2016 09:54:03 -0700 (PDT) Received: from xeon-e3 (static-50-53-65-230.bvtn.or.frontiernet.net. [50.53.65.230]) by smtp.gmail.com with ESMTPSA id r5sm44544091pap.7.2016.03.29.09.54.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Mar 2016 09:54:03 -0700 (PDT) Date: Tue, 29 Mar 2016 09:54:18 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: Mohammad El-Shabani , dev@dpdk.org Message-ID: <20160329095418.5a0edd4e@xeon-e3> In-Reply-To: <20160329093119.GC17800@bricha3-MOBL3> References: <20160329093119.GC17800@bricha3-MOBL3> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] librte_pmd_ixgbe implementation of ixgbe_dev_rx_queue_count X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 16:54:04 -0000 On Tue, 29 Mar 2016 10:31:19 +0100 Bruce Richardson wrote: > On Mon, Mar 28, 2016 at 06:45:26PM -0700, Mohammad El-Shabani wrote: > > Hi, > > Looking into why it hurts performance, I see that ixgbe_dev_rx_queue_count > > is implemented a scan of elements of rx descriptors, which is very > > expensive. I am wondering why its implemented the way it is. Could it not > > just read the head location from the driver? > > > > Thanks! > > Mohammad El-Shabani > > It's likely that reading the head location from the driver will be even slower > than scanning the descriptor rings in memory. Access to PCI is very much slower > than accessing memory - especially since on platforms with DDIO, many memory > accesses will actually be cache reads. > > That being said, I haven't actually written a test to prove this out, so feel > free to try out the head pointer read method instead and see if it improves > things. The results may vary depending on how far ahead needs to be scanned, > but certainly for the empty ring case, the descriptor scan method will be far > faster than a head read. > > Regards, > /Bruce Also the most common use case is "is there any more packets ready before I go to sleep on epoll", and the descriptor done API tells more than is needed.