From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by dpdk.org (Postfix) with ESMTP id 35185E5D for ; Mon, 18 Dec 2017 17:00:26 +0100 (CET) Received: by mail-lf0-f65.google.com with SMTP id m20so5222856lfi.6 for ; Mon, 18 Dec 2017 08:00:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=f8Qv2oHom860SrTBfTqTjjmBMoV6XcfpRr/lwM5Vqq0=; b=qwlew+UkTRnUu+09jdTQ4PXJbwT9o8bS131/1f0wWFu4dPyYZfb2zFKJY2BOt9zcKo Dikr4RXDpoZ/NgQo0i0dCPEMdGXzu9Te7EJ//2DfADLkTo7av3R5zba5Lk5NE29mf/Kj M4fqjAj6mUodz47i4A27DWF93XDLsKvaER2nhqbwBcNTSJAEgt8qJ56dESJtEU/kWJTN w1dByuM4KVMoo94laO/tytTsaUQz4I9VIwESHsNp8k+y6M/YR/OBoTme3CwXMzN0WQXR xbZR2ko66F0b5Xv2+rzhaU5es24kMbg2HKXazHDSIQVJXQ6kVoCKbtjFIc/ovz3tYYwK q/SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=f8Qv2oHom860SrTBfTqTjjmBMoV6XcfpRr/lwM5Vqq0=; b=tRc2ssXzUKx03ErWzo+5oHtknDMYv4fdGNqPAzVdZ/KWfrHADCMdETlEtD3G20f7O+ 52OEgHXPSsBGqHX+H2xVc7nJCK98vE70Q9Jswnk9BdvALr5dXzfSKa9jnvEW7B9snymE AXJrVjp9jhLTbW4l9fsuzei7QSWuUV2WTuolf1gMSlgI1r4dG0ls3NiexCmc+edhyGTh W3vKHZb3fdpFOk9G9w7oG7gO/iyF6ivt9ourTHn3RyOCwWxTX2KbrPAnjkIU3eEtMTa5 xzYlSQAadhem6/iuW7MyKqJsPChwpyP3/jjudn+1adWTJENwpfu0eg0GmpbxJ/5G2xRC d5IQ== X-Gm-Message-State: AKGB3mJVTuANASNTKHvbf/OuHcHdmYOqXffM0wTjsqmpxhDIE1cRpI5W tuG7eKqbaEo6O7xA05P4gT5A7w== X-Google-Smtp-Source: ACJfBouQ7RV1H4P/T6sDYXPzSI9/NUDYHB+RW2KLS9vYk5La+G8Cfi64N3wS+s9rIPoWq/w59F5/DA== X-Received: by 10.46.101.141 with SMTP id e13mr169660ljf.127.1513612825716; Mon, 18 Dec 2017 08:00:25 -0800 (PST) Received: from [10.0.0.58] (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id t16sm2691530lje.81.2017.12.18.08.00.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 08:00:25 -0800 (PST) From: Maciej Czekaj X-Google-Original-From: Maciej Czekaj To: Shahaf Shuler , dev@dpdk.org, konstantin.ananyev@intel.com, radu.nicolau@intel.com, arybchenko@solarflare.com References: <20171123121419.144132-1-shahafs@mellanox.com> Message-ID: Date: Mon, 18 Dec 2017 17:00:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mailman-Approved-At: Tue, 19 Dec 2017 15:39:47 +0100 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2 05/39] examples/l3fwd: move to ethdev 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, 18 Dec 2017 16:00:26 -0000 -- Oryginal message -- > Ethdev offloads API has changed since: > > commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") > commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") > > This commit support the new API. > > Signed-off-by: Shahaf Shuler > --- > examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++---------- > 1 file changed, 30 insertions(+), 10 deletions(-) > > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c > index 6229568..3bdf4d5 100644 > --- a/examples/l3fwd/main.c > +++ b/examples/l3fwd/main.c > @@ -149,11 +149,9 @@ struct lcore_params { > .mq_mode = ETH_MQ_RX_RSS, > .max_rx_pkt_len = ETHER_MAX_LEN, > .split_hdr_size = 0, > - .header_split = 0, /**< Header Split disabled */ > - .hw_ip_checksum = 1, /**< IP checksum offload enabled */ > - .hw_vlan_filter = 0, /**< VLAN filtering disabled */ > - .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ > - .hw_strip_crc = 1, /**< CRC stripped by hardware */ > + .ignore_offload_bitfield = 1, > + .offloads = (DEV_RX_OFFLOAD_CRC_STRIP | > + DEV_RX_OFFLOAD_CHECKSUM), > }, > .rx_adv_conf = { > .rss_conf = { > @@ -163,6 +161,7 @@ struct lcore_params { > }, > .txmode = { > .mq_mode = ETH_MQ_TX_NONE, > + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, > }, > }; > > @@ -612,7 +611,8 @@ enum { > }; > > printf("%s\n", str8); > - port_conf.rxmode.jumbo_frame = 1; > + port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; > + port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS; > > /* > * if no max-pkt-len set, use the default > @@ -908,6 +908,22 @@ enum { > n_tx_queue = MAX_TX_QUEUE_PER_PORT; > printf("Creating queues: nb_rxq=%d nb_txq=%u... ", > nb_rx_queue, (unsigned)n_tx_queue ); > + > + rte_eth_dev_info_get(portid, &dev_info); > + if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) != > + port_conf.rxmode.offloads) { > + printf("Some Rx offloads are not supported " > + "by port %d: requested 0x%lx supported 0x%lx\n", > + portid, port_conf.rxmode.offloads, > + dev_info.rx_offload_capa); > + } > + if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) != > + port_conf.txmode.offloads) { > + printf("Some Tx offloads are not supported " > + "by port %d: requested 0x%lx supported 0x%lx\n", > + portid, port_conf.txmode.offloads, > + dev_info.tx_offload_capa); > + } Looking at diff between v1 and v2, following lines are missing: -                       port_conf.rxmode.offloads &= dev_info.rx_offload_capa; -                       port_conf.txmode.offloads &= dev_info.tx_offload_capa; I can see this change is consistent across all examples. Is it intentional to enforce the capabilities this way? If so, why enforcing DEV_RX_OFFLOAD_CHECKSUM if the feature is not used by l3fwd code? I.e. there is no reference to RX-side ol_flags so application can run without it. In v1 the flag was optional which made sense for this particular case. > ret = rte_eth_dev_configure(portid, nb_rx_queue, > (uint16_t)n_tx_queue, &port_conf); > if (ret < 0) > @@ -955,10 +971,9 @@ enum { > printf("txq=%u,%d,%d ", lcore_id, queueid, socketid); > fflush(stdout); > > - rte_eth_dev_info_get(portid, &dev_info); > txconf = &dev_info.default_txconf; > - if (port_conf.rxmode.jumbo_frame) > - txconf->txq_flags = 0; > + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; > + txconf->offloads = port_conf.txmode.offloads; > ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, > socketid, txconf); > if (ret < 0) > @@ -984,6 +999,8 @@ enum { > fflush(stdout); > /* init RX queues */ > for(queue = 0; queue < qconf->n_rx_queue; ++queue) { > + struct rte_eth_rxconf rxq_conf; > + > portid = qconf->rx_queue_list[queue].port_id; > queueid = qconf->rx_queue_list[queue].queue_id; > > @@ -996,9 +1013,12 @@ enum { > printf("rxq=%d,%d,%d ", portid, queueid, socketid); > fflush(stdout); > > + rte_eth_dev_info_get(portid, &dev_info); > + rxq_conf = dev_info.default_rxconf; > + rxq_conf.offloads = port_conf.rxmode.offloads; > ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, > socketid, > - NULL, > + &rxq_conf, > pktmbuf_pool[socketid]); > if (ret < 0) > rte_exit(EXIT_FAILURE,