From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ECDE9A046B for ; Sun, 18 Aug 2019 09:00:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA2F53253; Sun, 18 Aug 2019 09:00:53 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 4513DB62 for ; Sun, 18 Aug 2019 09:00:52 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 5CB1F940060; Sun, 18 Aug 2019 07:00:50 +0000 (UTC) Received: from [192.168.1.11] (85.187.13.152) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 18 Aug 2019 08:00:41 +0100 To: Shahaf Shuler , "pbhagavatula@marvell.com" , "jerinj@marvell.com" , "ferruh.yigit@intel.com" , John McNamara , Marko Kovacevic , Thomas Monjalon CC: "dev@dpdk.org" References: <20190816055511.2322-1-pbhagavatula@marvell.com> <20190816055511.2322-3-pbhagavatula@marvell.com> <672afa31-6f88-9099-f4c7-e85a24959c0e@solarflare.com> From: Andrew Rybchenko Message-ID: <1a33f43e-6449-dffe-a6c9-c3d5c7118dae@solarflare.com> Date: Sun, 18 Aug 2019 10:00:36 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [85.187.13.152] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24854.003 X-TM-AS-Result: No-13.680200-8.000000-10 X-TMASE-MatchedRID: 8HTFlOrbAtEeimh1YYHcKPZvT2zYoYOwC/ExpXrHizxd964B0EJ1lZWi xnDxF7NQtqy4fGtVdQqTH1CW/Tkdqh8owvkAm18tcI7vRACwF0K/m13BpxkSeg/vnJWZIdGAedR sVpejKZ7ryo1a1MQSchBhU+7MZrgdwUGgKARXgvJtawJSSsDgSUh41hM/w6ZMXcSFH45s4599nO EBemPwvJ+anR9/uMyCiGKa3TfEZg0vTkJbUZogmkUzvZoSFxuNq3MsQB4M7MJpsnGGIgWMmb2/x r1t+ygm5jr+I6ik279DHZlXFFHvOuGnzSgGiXQrMpVOsYwN78OcqlCdrhyhQLCXtJ14sCJ3Zy5j iLHg+gp6OnKJXvwgWoK2BS2ryBmctd6WKkPGDhbyKt/vA0HdKFdEEmf6TRVBy5JfHvVu9ItnQIw ChQz9X2y4JvYWVSLwkZqsCMICU7iJQG6LDBdLy7dHEv7sR/OwIiTd2l7lf6Fi0lpUl7/AsZTexr QOJQRH9KnDKQ2NNd9kDgD9MSPAkQx5TL3qCTgETZKSbhF0MoG3xwqfnvnKHiV97fUpveX/+RCvQ dTJtobseKpXW2sBorFoL8xCnnbhAkm8KmXEA+bG693ff8j9ZIZS+fz1TDIS2+Avsq/zL0GksVVD 6rDnVI2jEPfbMTQWz5TKpvS51fb9kbyhKg6JlGLiVenyedyjaeMaKzvXUpkC/nuPl5P0FnIozGa 69omdrdoLblq9S5rom8v9cDlCRiVVqpNDZY1cT7O/YHJhINAfqkfNzTRFSjbpMgyAfh26PO2TWM qktw1Y/ZBkmqlGOr2S3LTX7qk/5UcZtwNsCrqDGx/OQ1GV8tp/U3XwL5kCF70JBot7Y8/3FLeZX NZS4DjAdLIal4R6PorIN8jbAb118/2WaCwx2dvVPtqAshvIyCLtsaoOTvVGVphPGsJDKw== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--13.680200-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24854.003 X-MDID: 1566111651-sJ-bAW-m5oS5 Subject: Re: [dpdk-dev] [PATCH 2/7] ethdev: add mbuf RSS update as a offload 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 8/18/19 9:18 AM, Shahaf Shuler wrote: > Sunday, August 18, 2019 8:39 AM, Andrew Rybchenko: >> ; Thomas Monjalon >> Cc: dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH 2/7] ethdev: add mbuf RSS update as a >> offload >> >> On 8/18/19 7:52 AM, Shahaf Shuler wrote: >>> Friday, August 16, 2019 10:48 AM, Andrew Rybchenko: >>>> Subject: Re: [dpdk-dev] [PATCH 2/7] ethdev: add mbuf RSS update as a >>>> offload >>>> >>>> On 8/16/19 8:55 AM, pbhagavatula@marvell.com wrote: >>>>> From: Pavan Nikhilesh >>>>> >>>>> Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be >> used >>>> to >>>>> enable/disable PMDs write to `rte_mbuf::hash::rss`. >>>> It should be highlighted that presence of the RSS hash is indicated >>>> by PKT_RX_RSS_HASH flag in mbuf anyway. Now applications have a way >>>> to check that RSS hash delivery is supported and should enable the >>>> offload if RSS hash is used. PMD may still provide the hash even if >>>> the offload is not enabled. >>> I don't understand how PMDs should act w/ this addition when considering >> the API breakage to application. >> >> There is a deprecation notice for it. >> I mentioned in my review notes for one of patches in the series that the >> change should be highlighted in release notes. >> Yes, it is absolutely required if these patches are accepted. >> >>> Currently application don't set this flag, and expect to get the RSS hash >> result on mbuf. >>> If PMDs will not set the RSS hash result when flag is not present then >> applications might break. >>> If they will always set, then there is no meaning for it. >>> >>> as I understand the motivation to save few cycles on the PMD receive path, >> if we want to include it we should treat it as API breakage and documents it >> on the release notes. >>> My option is that some offload should just be usable (OOB) by the fact user >> enabled them (e.g. RSS). no need to complicate the user by checking and set >> this field. >> >> What I don't understand is why some offloads should just work but another >> requires action to enable it. Just because it is the current state of things - I >> don't think it is a good motivation. Sorry. > Not because it is the current state of things, because it makes user experience much simpler. If so, it would be simpler to have no controls at all and always have everything possible. > You enabled RSS -> you get full RSS behavior You enable distribution across many queues here. RSS hash availability is a side effect here. > You set a flow rule w/ mark -> you get full flow mark behavior > You set checksum -> you get full csum behavior. > >> I think more applications use checksum offloads than RSS hash, but it is still >> required to enable it. It looks like no single DPDK example uses RSS hash. So, >> I guess it not widely used by applications as well. > Well there is at least one called ovs-dpdk, that use the RSS result as the key to access the EMC. > I know of few more, not upstream, ones. > >> Anyway these 2 patches for flow action and RSS hash make all Rx offloads >> consistent - if you need something, enable it. > But the user enabled it - > It enabled RSS by setting ETH_MQ_RX_RSS, why does it need to enable another flag? Answered above. If you need distribution it does not mean that you need RSS hash information. There are really many examples when you don't really need it. > Same for flow mark. > >> And the question is not to save few cycles in the PMD receive path. >> It makes is possible to not deliver both from NIC to host. >> 8 bytes (4 RSS hash and 4 flow mark) are more than 10% for the smallest >> packets. > There is always the line between how much tight control we want to provide to user (to save cycles/ to save PCI BW) and how much it will be simple for the user to work on top. > My opinion is that we need to have some basics. Many thanks, your arguments make sense. I vote for consistency and more fine grained control which allows more optimizations and allow to squeeze more performance from HW and SW. So, my line is a bit lower.  I don't think that these two patches make user control over-complicated. >>>>> Signed-off-by: Pavan Nikhilesh >>>> Reviewed-by: Andrew Rybchenko >>>> >>>> with above and one note below fixed. >>>> >>>>> --- >>>>> doc/guides/nics/features.rst | 2 ++ >>>>> lib/librte_ethdev/rte_ethdev.h | 1 + >>>>> 2 files changed, 3 insertions(+) >>>>> >>>>> diff --git a/doc/guides/nics/features.rst >>>>> b/doc/guides/nics/features.rst index d4d55f721..f79b69b38 100644 >>>>> --- a/doc/guides/nics/features.rst >>>>> +++ b/doc/guides/nics/features.rst >>>>> @@ -274,6 +274,7 @@ Supports RSS hashing on RX. >>>>> >>>>> * **[uses] user config**: ``dev_conf.rxmode.mq_mode`` = >>>> ``ETH_MQ_RX_RSS_FLAG``. >>>>> * **[uses] user config**: ``dev_conf.rx_adv_conf.rss_conf``. >>>>> +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: >>>> ``offloads:DEV_RX_OFFLOAD_RSS_HASH``. >>>>> * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``. >>>>> * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, >> ``mbuf.rss``. >>>>> @@ -286,6 +287,7 @@ Inner RSS >>>>> Supports RX RSS hashing on Inner headers. >>>>> >>>>> * **[uses] rte_flow_action_rss**: ``level``. >>>>> +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: >>>> ``offloads:DEV_RX_OFFLOAD_RSS_HASH``. >>>>> * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, >> ``mbuf.rss``. >>>>> >>>>> diff --git a/lib/librte_ethdev/rte_ethdev.h >>>>> b/lib/librte_ethdev/rte_ethdev.h index f97f0a6e5..889486a11 100644 >>>>> --- a/lib/librte_ethdev/rte_ethdev.h >>>>> +++ b/lib/librte_ethdev/rte_ethdev.h >>>>> @@ -1013,6 +1013,7 @@ struct rte_eth_conf { >>>>> #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 >>>>> #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 >>>>> #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 >>>>> +#define DEV_RX_OFFLOAD_RSS_HASH 0x00080000 >>>> Should be added to rte_rx_offload_names in >>>> lib/librte_ethdev/rte_ethdev.c.