From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10099C433E7 for ; Wed, 14 Oct 2020 18:57:42 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 38ECF2223F for ; Wed, 14 Oct 2020 18:57:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hw1sSoea" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38ECF2223F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5024C1DA79; Wed, 14 Oct 2020 20:57:39 +0200 (CEST) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id A94FA1DA79 for ; Wed, 14 Oct 2020 20:57:37 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id k25so325096ioh.7 for ; Wed, 14 Oct 2020 11:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iuh7Yqqyq1Uu/ro/tJTGyQfbxQl8jTYXYaINAd9RwtA=; b=Hw1sSoeaswNUTr1IeCbloHsdGaXxELhJ50XmLfqkLoRZQ1YlQBAJQ2+DET1UX67BvU OoQHkRa8vhV3DFCA9FDKPSVsx7iSrav3hzuKveCiBtAh4UDHrGYsQnAlUJclZ/tkV9VJ zgtcNQ7Hy1OTTyKX9LA5vvXu1o1KwuAGXEKKivJ4d0Vxxao9OX/JBVQ/o4loPqgf6lHs jxdGPgON8RIBUAWHiKLN5/LBgyuQay+z6UDPoBMSkkbwNa5yILkICUc2G/rXXz3l+D5U ygW0iYEaJjjBVJDr0gIX0HmrHvl77493iIcKqdWBPRhwTwISdv/OcupeiZcjYJlF/h0b QuDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iuh7Yqqyq1Uu/ro/tJTGyQfbxQl8jTYXYaINAd9RwtA=; b=dafX3RgpDS8mkswDXeVBEam667AAfXoZVV9E9z23z2iwo+pmpqedbCd0HOtTIlQkVe GIahvDkKVcq3rNAsSwcGenyb3eUpakQADNyZy86XKw0rISmWn1EBqaou9zPQU+nb5iOo nuJqiaig5nf3QhACknO+yr3c9ilg+EDfp1zIFBPpne4HL1UUPha0oA92U8/pk9yQUU79 eKGyI0nR1mYL5dVXAXTiRVeq9fB5RotLq9jGD5ed6offYTCtum1wcYQQWNnl9jodlh8U BETLNblYLvKlOXZOP3bqsQk/aZrHpnuStePu3ZVvp1eHz0Kk7tMOJ6p0aDH6yXBY+BxY hsZw== X-Gm-Message-State: AOAM532R6NGpzJXClXxBS2ZL7sXMIyngK/7LJU03RVdXL2FE6agsawvx +1x7Z8H3OLOWa92APecYTN4Kuv0SaKGPWJzBgNw= X-Google-Smtp-Source: ABdhPJyXCyaXh4d10mtDLhHObqDHKC+sdm+lPBc3v0mg4hIUOugFoVFO4jhYDuEcd2QY2hgynKLdY7KQ5OYJMLMJBxU= X-Received: by 2002:a6b:5019:: with SMTP id e25mr643050iob.123.1602701856059; Wed, 14 Oct 2020 11:57:36 -0700 (PDT) MIME-Version: 1.0 References: <1602699122-15737-1-git-send-email-viacheslavo@nvidia.com> <1602699122-15737-2-git-send-email-viacheslavo@nvidia.com> In-Reply-To: <1602699122-15737-2-git-send-email-viacheslavo@nvidia.com> From: Jerin Jacob Date: Thu, 15 Oct 2020 00:27:19 +0530 Message-ID: To: Viacheslav Ovsiienko Cc: dpdk-dev , Thomas Monjalon , Stephen Hemminger , Ferruh Yigit , Olivier Matz , Maxime Coquelin , David Marchand , Andrew Rybchenko Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v6 1/6] ethdev: introduce Rx buffer split 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 Wed, Oct 14, 2020 at 11:42 PM Viacheslav Ovsiienko wrote: > > The DPDK datapath in the transmit direction is very flexible. > An application can build the multi-segment packet and manages > almost all data aspects - the memory pools where segments > are allocated from, the segment lengths, the memory attributes > like external buffers, registered for DMA, etc. > > In the receiving direction, the datapath is much less flexible, > an application can only specify the memory pool to configure the > receiving queue and nothing more. In order to extend receiving > datapath capabilities it is proposed to add the way to provide > extended information how to split the packets being received. > > The following structure is introduced to specify the Rx packet > segment: > > struct rte_eth_rxseg { > struct rte_mempool *mp; /* memory pools to allocate segment from */ > uint16_t length; /* segment maximal data length, > configures "split point" */ > uint16_t offset; /* data offset from beginning > of mbuf data buffer */ > uint32_t reserved; /* reserved field */ > }; > > The segment descriptions are added to the rte_eth_rxconf structure: > rx_seg - pointer the array of segment descriptions, each element > describes the memory pool, maximal data length, initial > data offset from the beginning of data buffer in mbuf. > This array allows to specify the different settings for > each segment in individual fashion. > rx_nseg - number of elements in the array > > If the extended segment descriptions is provided with these new > fields the mp parameter of the rte_eth_rx_queue_setup must be > specified as NULL to avoid ambiguity. > > There are two options to specifiy Rx buffer configuration: > - mp is not NULL, rx_conf.rx_seg is NULL, rx_conf.rx_nseg is zero, > it is compatible configuraion, follows existing implementation, > provides single pool and no description for segment sizes > and offsets. > - mp is NULL, rx_conf.rx_seg is not NULL, rx_conf.rx_nseg is not > zero, it provides the extended configuration, individually for > each segment. > > The new offload flag RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT in device > capabilities is introduced to present the way for PMD to report to > application about supporting Rx packet split to configurable > segments. Prior invoking the rte_eth_rx_queue_setup() routine > application should check RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT flag. > > If the Rx queue is configured with new settings the packets being > received will be split into multiple segments pushed to the mbufs > with specified attributes. The PMD will split the received packets > into multiple segments according to the specification in the > description array: > > - the first network buffer will be allocated from the memory pool, > specified in the first segment description element, the second > network buffer - from the pool in the second segment description > element and so on. If there is no enough elements to describe > the buffer for entire packet of maximal length the pool from the > last valid element will be used to allocate the buffers from for the > rest of segments > > - the offsets from the segment description elements will provide > the data offset from the buffer beginning except the first mbuf - > for this one the offset is added to the RTE_PKTMBUF_HEADROOM to get > actual offset from the buffer beginning. If there is no enough > elements to describe the buffer for entire packet of maximal length > the offsets for the rest of segment will be supposed to be zero. > > - the data length being received to each segment is limited by the > length specified in the segment description element. The data > receiving starts with filling up the first mbuf data buffer, if the > specified maximal segment length is reached and there are data > remaining (packet is longer than buffer in the first mbuf) the > following data will be pushed to the next segment up to its own > maximal length. If the first two segments is not enough to store > all the packet remaining data the next (third) segment will > be engaged and so on. If the length in the segment description > element is zero the actual buffer size will be deduced from > the appropriate memory pool properties. If there is no enough > elements to describe the buffer for entire packet of maximal > length the buffer size will be deduced from the pool of the last > valid element for the remaining segments. > > For example, let's suppose we configured the Rx queue with the > following segments: > seg0 - pool0, len0=14B, off0=2 > seg1 - pool1, len1=20B, off1=128B > seg2 - pool2, len2=20B, off2=0B > seg3 - pool3, len3=512B, off3=0B Sorry for chime in late. This API lookout looks good to me. But, I am wondering how the application can know the capability or "limits" of struct rte_eth_rxseg structure for the specific PMD. The other descriptor limit, it's being exposed with struct rte_eth_dev_info::rx_desc_lim; If PMD can support a specific pattern rather than returning the blanket error, the application should know the limit. IMO, it is better to add struct rte_eth_rxseg *rxsegs; unint16_t nb_max_rxsegs in rte_eth_dev_info structure to express the capablity. Where the en and offset can define the max offset. Thoughts?