From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 01358199A9 for ; Wed, 13 Sep 2017 10:40:52 +0200 (CEST) Received: from pure.maildistiller.com (unknown [10.110.50.29]) by dispatch1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTP id 98A7320055; Wed, 13 Sep 2017 08:40:52 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us4.ppe-hosted.com (unknown [10.110.49.251]) by pure.maildistiller.com (Proofpoint Essentials ESMTP Server) with ESMTPS id C4C796004B; Wed, 13 Sep 2017 08:40:51 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us4.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id C051B80060; Wed, 13 Sep 2017 08:40:50 +0000 (UTC) Received: from [192.168.38.17] (84.52.114.114) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Wed, 13 Sep 2017 09:40:44 +0100 To: Shahaf Shuler , CC: References: From: Andrew Rybchenko Message-ID: Date: Wed, 13 Sep 2017 11:40:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Originating-IP: [84.52.114.114] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.100.1062-23326.003 X-TM-AS-Result: No--13.439700-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MDID: 1505292052-yctf8PFq3g13 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3 2/2] ethdev: introduce Tx queue offloads API 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: Wed, 13 Sep 2017 08:40:53 -0000 On 09/13/2017 09:37 AM, Shahaf Shuler wrote: > Introduce a new API to configure Tx offloads. > > In the new API, offloads are divided into per-port and per-queue > offloads. The PMD reports capability for each of them. > Offloads are enabled using the existing DEV_TX_OFFLOAD_* flags. > To enable per-port offload, the offload should be set on both device > configuration and queue configuration. To enable per-queue offload, the > offloads can be set only on queue configuration. Note about documentation of the per-queue and per-port offloads coexistence is applicable here as well. It would be really helpful to have it in the documentation. > In addition the Tx offloads will be disabled by default and be > enabled per application needs. This will much simplify PMD management of > the different offloads. > > Applications should set the ETH_TXQ_FLAGS_IGNORE flag on txq_flags > field in order to move to the new API. > > The old Tx offloads API is kept for the meanwhile, in order to enable a > smooth transition for PMDs and application to the new API. > > Signed-off-by: Shahaf Shuler > --- > doc/guides/nics/features.rst | 33 +++++++++++++++----- > lib/librte_ether/rte_ethdev.c | 64 +++++++++++++++++++++++++++++++++++++- > lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++++- > 3 files changed, 125 insertions(+), 10 deletions(-) > > diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst > index 4e68144ef..1a8af473b 100644 > --- a/doc/guides/nics/features.rst > +++ b/doc/guides/nics/features.rst [snip] > @@ -620,6 +628,15 @@ Supports packet type parsing and returns a list of supported types. > > .. _nic_features_timesync: > > +Mbuf fast free > +-------------- > + > +Supports optimization for fast release of mbufs following successful Tx. > +Requires all mbufs to come from the same mempool and has refcnt = 1. It is ambiguous here in the case of fast free configured on port level. Please, highlight that "from the same mempool" is per-queue. > + > +* **[uses] rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_MBUF_FAST_FREE``. > +* **[provides] rte_eth_dev_info**: ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_MBUF_FAST_FREE``. > + > Timesync > -------- > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index b3c10701e..85b99588f 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c [snip] > @@ -1193,6 +1242,7 @@ rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, > { > struct rte_eth_dev *dev; > struct rte_eth_dev_info dev_info; > + struct rte_eth_txconf local_conf; > void **txq; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); > @@ -1237,8 +1287,20 @@ rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, > if (tx_conf == NULL) > tx_conf = &dev_info.default_txconf; > > + /* > + * Convert between the offloads API to enable PMDs to support > + * only one of them. > + */ > + local_conf = *tx_conf; > + if (tx_conf->txq_flags & ETH_TXQ_FLAGS_IGNORE) > + rte_eth_convert_txq_offloads(tx_conf->offloads, > + &local_conf.txq_flags); Is it intended that ignore flag is lost here? It mean that failsafe slaves will treat txq_flags as the primary source of offloads configuration and do conversion from txq_flags to offloads. For example, it means that DEV_TX_OFFLOAD_QINQ_INSERT will be lost as well as many other offloads which are not covered by txq_flags. > + else > + rte_eth_convert_txq_flags(tx_conf->txq_flags, > + &local_conf.offloads); > + > return (*dev->dev_ops->tx_queue_setup)(dev, tx_queue_id, nb_tx_desc, > - socket_id, tx_conf); > + socket_id, &local_conf); > } > > void [snip]