From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id A1350B4D9 for ; Fri, 13 Feb 2015 17:33:43 +0100 (CET) Received: by mail-wg0-f45.google.com with SMTP id k14so14693453wgh.4 for ; Fri, 13 Feb 2015 08:33:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=lW6BSOb1cWZANpQrDnCAaRTwtmWKnMro8Xv32mP8LYU=; b=O0qT4ao/WlEdpQ975/EmBVUPIL13fvmlR4tbxw8BSpIrV++1N1gjibAEBGB66givda GLtZNsQ0ZsscR/s7xXIt85Xvq5gMG/7bAjQBuq08n20ytP5ICZuGJWgOXPsFfok6CcO8 CB2G4maHc2BAW5jC6lHzsXdgns/BYXkvT588qD8L2kXEaHLAOWZSRApLJWQNa/NHtgZY A9yLPihvBk5DuBSgNUrJN176lbht8rX6qrw9ZNwVdX+SboL84VXJo+2hclgRCnSh00ot KmRxIcyx9Zpa5Q3UsTKf0rU7vNtCB2gKr7FSsEGpBw4nkn8CXim2oijC3ZnJb9SAeC6R 31xg== X-Gm-Message-State: ALoCoQnC7WVhgDma8tkpdTKLTcJcVSQ6DY1uvME6RzpUq87H4/lBdZHYzQsnHkw9pMFwL9byDZ+P X-Received: by 10.194.24.103 with SMTP id t7mr19744414wjf.15.1423845223465; Fri, 13 Feb 2015 08:33:43 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id n3sm10704782wja.36.2015.02.13.08.33.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 08:33:42 -0800 (PST) From: Thomas Monjalon To: John McNamara , bruce.richardson@intel.com Date: Fri, 13 Feb 2015 17:33:12 +0100 Message-ID: <1455252.yJnfHs6f2Q@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <1423841989-9090-3-git-send-email-john.mcnamara@intel.com> References: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> <1423841989-9090-1-git-send-email-john.mcnamara@intel.com> <1423841989-9090-3-git-send-email-john.mcnamara@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 2/4] ethdev: Add in data rxtx callback support 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: Fri, 13 Feb 2015 16:33:43 -0000 2015-02-13 15:39, John McNamara: > From: Richardson, Bruce > > Add in support for inline processing of packets inside the RX or > TX call. For an RX callback, what happens is that we get a set of > packets from the NIC and then pass them to a callback function, if > configured, to allow additional processing to be done on them, e.g. > filling in more mbuf fields, before passing back to the application. > On TX, the packets are similarly post-processed before being handed > to the NIC for transmission. > > Signed-off-by: Bruce Richardson [...] > @@ -2390,7 +2445,17 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, > struct rte_eth_dev *dev; > > dev = &rte_eth_devices[port_id]; > - return (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], rx_pkts, nb_pkts); > + nb_pkts = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], rx_pkts, > + nb_pkts); > + struct rte_eth_rxtx_callback *cb = dev->rx_cbs[queue_id]; > + if (unlikely(cb != NULL)) { > + do { > + nb_pkts = cb->fn(port_id, queue_id, rx_pkts, nb_pkts, > + cb->param); > + cb = cb->next; > + } while (cb != NULL); > + } > + return nb_pkts; > } > #endif > > @@ -2517,6 +2582,14 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, > struct rte_eth_dev *dev; > > dev = &rte_eth_devices[port_id]; > + struct rte_eth_rxtx_callback *cb = dev->tx_cbs[queue_id]; > + if (unlikely(cb != NULL)) { > + do { > + nb_pkts = cb->fn(port_id, queue_id, tx_pkts, nb_pkts, > + cb->param); > + cb = cb->next; > + } while (cb != NULL); > + } > return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts); > } > #endif We all know how much the performance of these functions are important. So I wonder if we could reduce the impact of this change. I don't like the build options but maybe it should be discussed.