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 7B31EA0350; Thu, 25 Jun 2020 11:06:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF4581B94F; Thu, 25 Jun 2020 11:06:38 +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 3327C1B75C for ; Thu, 25 Jun 2020 11:06:37 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.61]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id A79E660067; Thu, 25 Jun 2020 09:06:36 +0000 (UTC) Received: from us4-mdac16-53.ut7.mdlocal (unknown [10.7.66.24]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id A5A208009E; Thu, 25 Jun 2020 09:06:36 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.66.38]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 142BE80056; Thu, 25 Jun 2020 09:06:36 +0000 (UTC) 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 661B9800069; Thu, 25 Jun 2020 09:06:31 +0000 (UTC) Received: from [192.168.38.17] (10.17.10.39) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 25 Jun 2020 10:06:23 +0100 To: Ferruh Yigit , Chengchang Tang , CC: , , Olivier MATZ , Matan Azrad , Jerin Jacob , Shy Shyman , Qi Zhang , Konstantin Ananyev References: <1592894934-57856-1-git-send-email-tangchengchang@huawei.com> <566d8162-7550-6812-bf62-e0fb55e8e500@solarflare.com> <4650f0a7-64cf-831d-631c-243ea510fd38@intel.com> From: Andrew Rybchenko Autocrypt: addr=arybchenko@solarflare.com; keydata= mQINBF2681gBEACbdTxu8eLL3UX2oAelsnK9GkeaJeUYSOHPJQpV7RL/iaIskqTwBRnhjXt7 j9UEwGA+omnOmqQMpeQTb/F9Ma2dYE+Hw4/t/1KVjxr3ehFaASvwR4fWJfO4e2l/Rk4rG6Yi 5r6CWU2y8su2654Fr8KFc+cMGOAgKoZTZHZsRy5lHpMlemeF+VZkv8L5sYJWPnsypgqlCG3h v6lbtfZs+QqYbFH6bqoZwBAl5irmxywGR7ZJr1GLUZZ1lfdazSY8r6Vz0/Ip/KVxGu2uxo81 QCsAj0ZsQtwji9Sds/prTiPrIjx8Fc/tfbnAuVuPcnPbczwCJACzQr4q26XATL3kVuZhSBWh 4XfO/EAUuEq5AemUG5DDTM87g7Lp4eT9gMZB6P+rJwWPNWTiV3L7Cn+fO+l9mTPnOqdzBgDe OaulKiNSft1o0DY4bGzOmM2ad2cZt0jfnbMPMTE9zsr6+RFa+M8Ct20o6U1MUE4vP6veErMK of4kZ8PdoMM+Sq1hxMPNtlcVBSP9xMmdSZPlfDYI5VWosOceEcz7XZdjBJKdwKuz70V7eac4 ITSxgNFCTbeJ03zL2MR5s0IvD9ghISAwZ6ieCjU5UATn5+63qpD0nVNLsAdb/UpfvQcKAmvj 0fKlxu/PMVkjBa7/4cfNogYOhWDKUO+1pMaFwvb6/XTo6uMpfQARAQABtCxBbmRyZXcgUnli Y2hlbmtvIDxhcnliY2hlbmtvQHNvbGFyZmxhcmUuY29tPokCVAQTAQoAPhYhBP6NPgcKRj/Y X0yXQahue0sAy4m+BQJduvNYAhsDBQkB4TOABQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAAAoJ EKhue0sAy4m+t3gP/j1MNc63CEozZo1IZ2UpVPAVWTYbLdPjIRdFqhlwvZYIgG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POYBbWXeb9ptDjGCAThNxSz0WAXkmcjAFE8gdE6 Znk9 Message-ID: Date: Thu, 25 Jun 2020 12:06:18 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.17.10.39] 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.1020-25502.003 X-TM-AS-Result: No-17.949800-8.000000-10 X-TMASE-MatchedRID: 8HTFlOrbAtE4Q7K/HmUF5/ZvT2zYoYOwC/ExpXrHizz8epMj3qRIPqip 18v0DWYVvVCweWSksq3uIo0t1j+25uUw4uPt/HT2oc4lULAlxkOnCSKz4gA7F+ZAlRR6AIJ7hoB NKnOJHc1VnrH5OV13se74hCpKBA1e9Ra4eWA6vhv/Te3t5cJMGyIk3dpe5X+hC/U4++8MvOxcC5 5EXJzOeZlXm0CzFZqMoFxBp2LP3lJNL+GuN+4VJB3EEAbn+GRb4cLBHAw1BRblhO+RZsN0Zo8YF BHnSbTTG7dg7lzTm96BY4Gm5+vHoSVqUEpZwWsG4h8r8l3l4ebfIfhOVHn3r99RlPzeVuQQyC1M vYqDoSrdmguFM+DecJUoRRRj/+6KJEwKOzcE80W8coKUcaOOvaUYIgxuvuD+AqmSGaN08VAnui+ WQ9elLbb5LjvKXrt3BbvjaWfKx99LN0omgI25HxMXUu1hb2VrL1eX+z9B1Qy9riHHO5UXuA9aES ljuMCwc7HQMVzrcjKazVlU/s/H0YRtLIGcOmPgg75YT2hz4LDoo+IFfa0jSBv2iroWthDc6NimM 1YROmbCgr+zbo49CYv9sGOtq3aSo1i8JmYfZD/lCjTeYR3AAVoR8WAKiZ2PYy6fApvL8BcgpGmJ AKdhm4O3BXjLL03Fi7++rb9m4mBjK7Sf3R/S7WXaK3KHx/xpAf1C358hdK+5RTcaZKGrid3UUMD GwMwTx6ivsYzchJQkWifxWp+o47QlCn8RT0gFUeavKZUnS5CtfY6YPaw3YcK0HkBcZFjbnotvz7 pzyDUXOvyK8b+ulEy7B4qBllcBBmjPEm4v5DOeAiCmPx4NwLTrdaH1ZWqC1B0Hk1Q1KyLUZxEAl FPo846HM5rqDwqtbXFUFG1EGTVVXhKcXJAfE/bE8vgbyM9pFi/y7BI0JooFc5WJW+KPeg== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--17.949800-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1020-25502.003 X-MDID: 1593075996-mbi2wSbM2VNd Subject: Re: [dpdk-dev] [RFC] ethdev: add a field for rte_eth_rxq_info 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 6/24/20 9:32 PM, Ferruh Yigit wrote: > On 6/24/2020 9:52 AM, Ferruh Yigit wrote: >> On 6/24/2020 4:48 AM, Chengchang Tang wrote: >>> >>> On 2020/6/23 17:30, Andrew Rybchenko wrote: >>>> On 6/23/20 9:48 AM, Chengchang Tang wrote: >>>>> In common practice, PMD configure the rx_buf_size according to the data >>>>> room size of the object in mempool. But in fact the final value is related >>>>> to the specifications of hw, and its values will affect the number of >>>>> fragments in recieving pkts. >>>>> >>>>> At present, we seem to have no way to espose relevant information to upper >>>>> layer users. >>>>> >>>>> Add a field named rx_bufsize in rte_eth_rxq_info to indicate the buffer >>>>> size used in recieving pkts for hw. >>>>> >>>> >>>> I'm OK with the change in general. >>>> I'm unsure which name to use: 'rx_buf_size' or 'rx_bursize', >>>> since I found both 'min_rx_buf_size' and 'min_rx_bufsize' in >>>> ethdev. >>>> >>>> I think it is important to update PMDs which provides the >>>> information to fill the field in. >>> >>> My plan is to divide the subsequent series into two patches, >>> one to modify rte_eth_rxq_info, and one to add our hns3 PMD >>> implementation of rxq_info_get. Should i update all the PMDs >>> that provide this information and test programs such as >>> testpmd at the same time? >> >> Hi Chengchang, Andrew, >> >> No objection to the change, but it should be crystal clear what is added. These >> are for PMD developers to implement and when it is not clear we end up having >> different implementations and inconsistencies. >> >> There is already some confusion for the Rx packet size etc.. my concern is >> adding more to it, here all we have is "size of RX buffer." comment, I think we >> need more. > > cc'ed a few more people. > > Back to this favorite topic, how to configure/limit the packet size. > > Can you please help to have a common/correct understanding? I tried to clarify > as much as I got it, any comment welcome. (I know it is long, please bare with me) > > > The related config options I can see, > 1) rte_eth_conf->rxmode->max_rx_pkt_len > 2) rte_eth_dev_info->max_rx_pktlen > 3) DEV_RX_OFFLOAD_JUMBO_FRAME > 4) rte_eth_dev->data->mtu > 5) DEV_RX_OFFLOAD_SCATTER > 6) dev->data->scattered_rx > 7) rte_eth_dev_info->min_mtu, rte_eth_dev_info->max_mtu > > 'mtu' (4): Both for Tx and Rx. The network layer payload length. Default value > 'RTE_ETHER_MTU'. > > 'max_rx_pkt_len' (1): Only for Rx, maximum Rx frame length configured by > application. > > 'max_rx_pktlen' (2): Device reported value on what maximum Rx frame length it > can receive. Application shouldn't set Rx frame length more than this value. > > 'DEV_RX_OFFLOAD_JUMBO_FRAME' (3): Device Jumbo Frame capability. > When not enabled the Rx frame length is 'MTU' + overhead > When enabled Rx frame length is 'max_rx_pkt_len' > > 'DEV_RX_OFFLOAD_SCATTER' (5): Capability to scatter packet to multiple > descriptor by device and driver converting this to chained mbuf. > > 'dev->data->scattered_rx' (6): The current status of driver scattered Rx, in > device data mostly for PMD internal usage. > > 'rte_eth_dev_info->min_mtu' & 'rte_eth_dev_info->max_mtu' (7): minimum and > maximum MTU values device supported. > 'max_mtu' == 'max_rx_pkt_len' - L2_OVERHEAD. > > > I can see two different limits, > a) The Rx frame length limit that device can receive from wire. Any packet > larger than this size will be dropped by device in an early stage. > b) The Rx buffer length limit that received packets are written to. Device > shouldn't DMA larger than reserved buffer size. > > If device supports scattered Rx to multiple descriptors, it can be possible to > configure (a) > (b). > Otherwise configuration have to be (b) >= (a). > > For example if the mbuf size is 2Kb and the device can receive up to 9000 bytes. > Options are: > - If device supports it, large packet will be scattered on multiple mbufs > - or need to configure device Rx frame length to 2K (mbuf size) > - or need to allocate mbuf big enough to get largest possible packet (9000) > > > > Issues I see: > ------------- > > i) Although the code clearly says 'max_rx_pkt_len' is only valid when jumbo > frames enabled, some drivers are taking it account always. Ack, that's not good. > ii) Some drivers enable 'scattered_rx' & 'jumbo frame' implicitly, without > having 'DEV_RX_OFFLOAD_JUMBO_FRAME' or 'DEV_RX_OFFLOAD_SCATTER' requested by > application. Ack that it is a problem especially for scatter. > iii) Having both 'mtu' & 'max_rx_pkt_len' are confusing, although they are not > exactly same thing they are related. Difference is MTU applies for Tx too, and > L2 network layer overhead is not included. > 'MTU' can be more interested by upper layers, 'max_rx_pkt_len' is more driver > level information. And driver should know how to convert one to another. Agree > iv) 'max_rx_pkt_len' provided as part of 'rte_eth_dev_configure()' and there is > no API to update it later. > 'mtu' is not part of 'rte_eth_dev_configure()', it can only be updated later > with specific API. > But driver have to keep these two values consistent. Agree > v) 'max_rx_pktlen' & 'max_mtu' reports from driver are redundant information. > Again they are not same thing, but correlated. Agree > > Suggested changes: > ----------------- > > Overall unify 'max_rx_pkt_len' & 'mtu' as much as possible, at first step: > > i) Make 'max_rx_pkt_len' independent from 'DEV_RX_OFFLOAD_JUMBO_FRAME', so > 'max_rx_pkt_len' value will be always valid, jumbo frame enabled or not. It will make handling of the max_rx_pkt_len mandatory in all network PMDs. > > ii) in '.dev_configure' convert 'max_rx_pkt_len' value to 'mtu' value, this will > be only point 'max_rx_pkt_len' is used, after that point PMD will always use > 'mtu' value. I'm not sure that it is a right direction. Above you say that 'max_rx_pkt_len' is more driver level and I agree with it. I guess most drivers operate it finally (i.e. configure underlying HW in terms of max_rx_pkt_len, not MTU). So, converted from max_rx_pkt_len to MTU on ethdev level and covered back from MTU to max_rx_pkt_len in drivers. > Even don't reflect 'rte_eth_dev_set_mtu()' changes to 'max_rx_pkt_len' anymore. Not sure that I get it. max_rx_pkt_len is used on dev_configure only. Is it reported on get somewhere? > > iii) Don't make 'max_rx_pkt_len' a mandatory config option, let it be '0' by > application, in that case 'rte_eth_dev_configure()' will set > "'max_rx_pkt_len' = RTE_ETHER_MAX_LEN" if 'DEV_RX_OFFLOAD_JUMBO_FRAME' disabled > "'max_rx_pkt_len' = 9000 if 'DEV_RX_OFFLOAD_JUMBO_FRAME' enabled Why 9000? IMHO, if max_rx_pkt_len is 0, just use value derived from MTU. > > iv) Allow implicit update of 'DEV_RX_OFFLOAD_JUMBO_FRAME' on MTU set, since > setting a large MTU implies the jumbo frame request. And there is no harm to > application. Yes and I'd deprecate DEV_RX_OFFLOAD_JUMBO_FRAME. > > v) Do NOT allow implicit update of 'DEV_RX_OFFLOAD_SCATTER' on MTU set (when Rx > frame length > Rx buffer length), since application may not be capable of > parsing chained mbufs. Instead fails the MTU set in that case. > [This can break some applications, relying on this implicit set.] Yes, definitely. > > > Any comments? > > > > Additional details: > ------------------- > > Behavior of some drivers: > > What igb & ixgbe does > - Set Rx frame limit (a) using 'max_rx_pkt_len' (1) > - Set Rx buffer limit (b) using mbuf data size > - Enable Scattered Rx (5 & 6) if the Rx frame limit (a) bigger than Rx buffer > limit (b) (even user not requested for it) > > What i40e does same as above, only differences > - Return error if jumbo frame enabled and 'max_rx_pkt_len' < RTE_ETHER_MAX_LEN > > sfc: > - Set Rx frame limit (a) > - using 'max_rx_pkt_len' (1) when jumbo frame enabled > - using 'mtu' when jumbo frame not enabled. > - Set Rx buffer limit (b) using mbuf data size > - If Rx frame limit (a) bigger than Rx buffer limit (b), and user not requested > 'DEV_RX_OFFLOAD_SCATTER', return error. Ack > > octeontx2: > - Set Rx frame limit (a) using 'max_rx_pkt_len' (1). Implicitly enable jumbo > frame based on 'max_rx_pkt_len'. > - I can't able find how Rx buffer limit (b) set > - Enable Scattered Rx (5) if the Rx frame limit (a) bigger than Rx buffer limit > (b) (even user not requested for it). 'dev->data->scattered_rx' not set at all. > > >> Adding a PMD implementation and testpmd updates helps to clarify the >> intention/usage, so I suggest sending them as a single patch with this one. >> >> Updating all PMDs is a bigger ask and sometimes too hard because of lack of >> knowledge on the internals of other PMDs, although this is causing feature gaps >> time to time, we are not mandating this to developers, so please update as many >> PMD as you can, that you are confident, rest should be done by their maintainers. >> >>>> >>>>> Signed-off-by: Chengchang Tang >>>> >>>> Acked-by: Andrew Rybchenko >>>> >>>>> --- >>>>> lib/librte_ethdev/rte_ethdev.h | 1 + >>>>> 1 file changed, 1 insertion(+) >>>>> >>>>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h >>>>> index 0f6d053..82b7e98 100644 >>>>> --- a/lib/librte_ethdev/rte_ethdev.h >>>>> +++ b/lib/librte_ethdev/rte_ethdev.h >>>>> @@ -1306,6 +1306,7 @@ struct rte_eth_rxq_info { >>>>> struct rte_eth_rxconf conf; /**< queue config parameters. */ >>>>> uint8_t scattered_rx; /**< scattered packets RX supported. */ >>>>> uint16_t nb_desc; /**< configured number of RXDs. */ >>>>> + uint16_t rx_bufsize; /**< size of RX buffer. */ >>>>> } __rte_cache_min_aligned; >>>>> >>>>> /**