From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 40CAF1B34E for ; Mon, 13 Nov 2017 11:39:40 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id z3so14153365wme.5 for ; Mon, 13 Nov 2017 02:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=8nRnDL2YvA4YI9uXUsRPZMeiLw6kRR2ZrfIZPjQxQbg=; b=wF3A4jG/bCM9q1PuDcQVYuk2m9MGbeKaikvUdZyHD8Yg8Hp5ZC1CG7e/KYgY3tZIxN N3inFtEIK/Qulh9nOcy9S4ZWuakCvTpCg9uNFnh9aLEwZfkbS+69mA7MjuZqoH0dXhk1 6ReEDhVHZRfekOO6lXPK6NqOjHznnaXG2LjM71eAcq8fevRvY96L0OsFbNIhxnR+1fsI F9g9zwDyJDSxO9W+gpeQipjKNMOLUNu8VQ+ZTIilzpSuv/mgYSNnpNeOPOwZRoHODE36 AVbNYCjCUo+80M+2SygnDeGbfYOIKwjUY3mHvm9NrwXv14dyd4/5iFQ0GVRpT9rHJKCp 8wng== 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:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=8nRnDL2YvA4YI9uXUsRPZMeiLw6kRR2ZrfIZPjQxQbg=; b=V+ZsBSwWfVLx7d9hIGyYzCTe06LxxG7OBM0M6JlEaf05+VT/9q+xRqcO64obPTUaFS nqu+ZNRF+x3c31gxqV5wzNQo/ZAVit1aiG5pUeTbI+0qb+mnMskpYcGxbXapx1TOtfia rtcpuaPhS1o/Fj0JY6yl1/K6HaV6WuXyGMR0EVTasQPI3OUxtJ2uXqBNQz5/WxO+1k64 8SWHzwFzANvNFKzq2FIRy5gd3JWR83EY3rfjbZjmVY4ImYCJXqO5mls0fPXcA234yk/b e4AprgHHL13KXgD8WEwwGNLoGmj6xFKbIg31/Q/uD5Uun0SxqfScoNfzXvkSoTk/u1c9 WIGg== X-Gm-Message-State: AJaThX7AC6nM5PhuMN3yF+8Moz4hm6MJVekrm8OOuZQ/JN6YGxat74Iz pnouiXidLuGc405AIVrvqmyMDlGM X-Google-Smtp-Source: AGs4zMY/qtF5mzKig36UDJ30HrMFHUsUSLhUcSIBtGRs4mcwFz9dGNsaAkAh2Xa7tpeujvjt45BE4A== X-Received: by 10.80.152.16 with SMTP id g16mr12017972edb.28.1510569579755; Mon, 13 Nov 2017 02:39:39 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id b36sm14047136edd.67.2017.11.13.02.39.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2017 02:39:38 -0800 (PST) Date: Mon, 13 Nov 2017 11:39:27 +0100 From: Adrien Mazarguil To: Ilya Matveychikov Cc: dev@dpdk.org Message-ID: <20171113103927.GP24849@6wind.com> References: <2259E047-80C0-40AC-AAF4-F21617605508@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2259E047-80C0-40AC-AAF4-F21617605508@gmail.com> Subject: Re: [dpdk-dev] A question about (poor) rte_ethdev internal rx/tx callbacks design X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2017 10:39:40 -0000 On Sat, Nov 11, 2017 at 09:18:45PM +0400, Ilya Matveychikov wrote: > Folks, > > Are you serious with it: > > typedef uint16_t (*eth_rx_burst_t)(void *rxq, > struct rte_mbuf **rx_pkts, > uint16_t nb_pkts); > typedef uint16_t (*eth_tx_burst_t)(void *txq, > struct rte_mbuf **tx_pkts, > uint16_t nb_pkts); > > I’m not surprised that every PMD stores port_id in every and each queue as having just the queue as an argument doesn’t allow to get the device. So the question is - why not to use something like: > > typedef uint16_t (*eth_rx_burst_t)(void *dev, uint16_t queue_id, > struct rte_mbuf **rx_pkts, > uint16_t nb_pkts); > typedef uint16_t (*eth_tx_burst_t)(void *dev, uint16_t queue_id, > struct rte_mbuf **tx_pkts, > uint16_t nb_pkts); I assume it's since the rte_eth_[rt]x_burst() wrappers already pay the price for that indirection, doing it twice would be redundant. Basically the cost of storing a back-pointer to dev or a queue index in each Rx/Tx queue structure is minor compared to saving a couple of CPU cycles wherever we can. I'm not saying its the only solution nor the right approach, it's only one possible explanation for this API. -- Adrien Mazarguil 6WIND