From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1F5085F1D for ; Mon, 12 Mar 2018 20:05:32 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Mar 2018 12:05:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,462,1515484800"; d="scan'208";a="207542952" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.62]) ([10.237.221.62]) by orsmga005.jf.intel.com with ESMTP; 12 Mar 2018 12:05:30 -0700 To: Shahaf Shuler , Mordechay Haimovsky , "pascal.mazon@6wind.com" Cc: "dev@dpdk.org" References: <1515601248-39458-2-git-send-email-motih@mellanox.com> <1516197874-133169-1-git-send-email-motih@mellanox.com> <1516197874-133169-2-git-send-email-motih@mellanox.com> <95d434f5-438a-19a7-1227-18c1230201c0@intel.com> <8973efd1-ec77-2e51-0516-634ab878bb1c@intel.com> From: Ferruh Yigit Message-ID: <54a887f7-5d2c-4200-de87-1a96a68df0cd@intel.com> Date: Mon, 12 Mar 2018 19:05:29 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH V5 2/2] net/tap: use new Rx 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: Mon, 12 Mar 2018 19:05:33 -0000 On 3/12/2018 5:58 PM, Shahaf Shuler wrote: > Monday, March 12, 2018 7:00 PM, Ferruh Yigit: >> There are some devices supports queue level offloads and there are some >> devices supports port level offloads. >> >> Values queue offload = 0x0 and port offload = 0x1000, for the device that >> support queue level offloads may mean disabling all offloads for that specific >> queue and this is valid value. For the device that support port level offloads >> this is an error. > > device which don't support port level offloads should not be configured with port offloads. > Well implemented PMDs will fail the configuration with port offload = 0x1000. For this particular error in tap: Rx queue offloads = 0x0, requested port offloads = 0x1000, supported offloads = 0x300e Since supported offloads reported, and requested is subset of it I think port level offloads are OK, problem is in queue level offloads. > >> >> What about using "rx/tx_queue_offload_capa" field to help application to >> detect if device supports queue level or port level offloads? > > Yes. this is their purpose. > >> >> If device reports 0x0 "rx_queue_offload_capa", application will know device >> doesn't support queue level offloads and PMD just ignore all provided queue >> offloads. >> >> If device reports a "rx_queue_offload_capa" other than 0x0, app will know >> that device _supports_ queue offloads and will set offloads according and >> PMD will verify and apply queue specific offloads according. >> >> For above tap specific case, is tap PMD supports queue specific offloads? > > Am not sure. Moty? > >> >> And there should be some restrictions on offloading values: >> 1- requested port offloads should be subset of supported port offloads >> 2- supported queue offloads should be subset of supported port offloads >> 3- requested queue offloads should be subset of supported queue offloads > > This is correct. > >> >> And since these information is part of dev_info, these can be managed in the >> ethdev layer, instead of checked in each PMD (as done in tap). >> >> >> According above, would you mind walk-trough how application can set >> offloads: >> >> A) New application that implements new offloading APIs: >> - Get dev_info >> - Configure Rx/Tx offloads based on rx_offload_capa / tx_offload_capa >> - If rx_queue_offload_capa / tx_queue_offload_capa is other than 0, setup >> RxQ / TxQ offloads based on these values. >> - If rx_queue_offload_capa / tx_queue_offload_capa is 0, queue level >> offlaods are not supported by this device, ignore offloads during RxQ / TxQ >> setup. > > With the current API it is not correct. queue offloads should be at least the port offloads. If the application wants to enable more queue specific offloads it can as long as those are supported. So above statement 2 is wrong? Just to confirm, a queue can not disable an offload configured for port but can enable more offloads? > The following pseudo code demonstrate above: > > Dev_configure(port, port_offloads) > Rx_queue_offloads = port_offloads > If (rx_queue_offload_capa != 0) > Rx_queue_offloads |= rx_queue_offload_capa Again to confirm, a device that supports port level offloads free to ignore TxQ / RxQ offload values, right? So why we need "Rx_queue_offloads = port_offloads", will following be true? Dev_configure(port, port_offloads) If (rx_queue_offload_capa != 0) Rx_queue_offloads = port_offloads | rx_queue_offload_capa > >> >> All look OK here. >> >> >> B) Old application with old offloading API >> - Get dev_info, which provides only rx_offload_capa, tx_offload_capa and >> txq_flags >> - set rte_eth_rxmode->bitfield_values ==> ethdev will convert them to port >> level Rx offloads. >> - port level offloads are empty!! >> - ethdev will set queue level Rx offloads to be same as port level Rx offloads. >> - ethdev will set txq_flags values for Tx offloads to queue level Tx offloads. >> >> Things should work well for PMDs with old offloading API. >> >> For the PMDs that support new offloading API, port level Tx offload values >> are missing and Queue level and Port level Tx offloads mismatch. Am I >> missing something here, if not how can we solve this issue in PMDs? > > Those PMDs (new PMD for old application) can use the ETH_TXQ_FLAGS_IGNORE which must be set for application which uses the new API.. > see snipped code from mlx5 PMD: > > [1] > /* > * Don't verify port offloads for application which > * use the old API. > */ > if (!!(conf->txq_flags & ETH_TXQ_FLAGS_IGNORE) && > !priv_is_tx_queue_offloads_allowed(priv, conf->offloads)) { > ret = ENOTSUP; > ERROR("%p: Tx queue offloads 0x%" PRIx64 " don't match port " > "offloads 0x%" PRIx64 " or supported offloads 0x%" PRIx64, > (void *)dev, conf->offloads, > dev->data->dev_conf.txmode.offloads, > mlx5_priv_get_tx_port_offloads(priv)); > goto out; > } What this code does is: "if new offload API is used and queue offload is not valid, return error", this is completely different than what I say. My concern is how new PMD will handle old application because of missing port level Tx offloads. I guess each time PMD needs to use a Tx offload, it needs to check ETH_TXQ_FLAGS_IGNORE. If IGNORE is set PMD will use txmode->offloads, if not it will use txq->offloads. Do you think this solves the issue? > > > > > >> >> >>> >>>> >>>> I believe other way around makes sense, to be able to set queue offload >> param, device should announce that offloading as supported. Queue is >> subset of the device, why you ignore device offload param to set queue >> offload param? >>>> >>>> What makes sense to me: >>>> "queue offload" is subset of "device offload" is subset of "device >> supported offload" >>> >>> >>> >>> >>> [1] >>> >> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdpd >> k >>> >> .org%2Fdoc%2Fguides%2Fprog_guide%2Fpoll_mode_drv.html&data=02%7C >> 01%7Cs >>> >> hahafs%40mellanox.com%7C2fc3763767f041846bdd08d5883aa76a%7Ca65297 >> 1c7d2 >>> >> e4d9ba6a4d149256f461b%7C0%7C0%7C636564707857610335&sdata=Uavzne >> YAsXf2M >>> SdJWSp6i1fvRmCRyx6pWwLuzUCqOLA%3D&reserved=0 >>> >>> >>>> >>>> <...> >