From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 4893B1C724 for ; Mon, 14 May 2018 08:54:23 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id E063E140053; Mon, 14 May 2018 06:54:21 +0000 (UTC) Received: from [192.168.38.17] (84.52.114.114) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Mon, 14 May 2018 07:54:16 +0100 To: Shahaf Shuler , "dev@dpdk.org" CC: Ferruh Yigit , Thomas Monjalon , Wei Dai References: <1526055955-14027-1-git-send-email-arybchenko@solarflare.com> <1526055955-14027-3-git-send-email-arybchenko@solarflare.com> From: Andrew Rybchenko Message-ID: Date: Mon, 14 May 2018 09:54:11 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Originating-IP: [84.52.114.114] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.100.1062-23842.003 X-TM-AS-Result: No--11.747300-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MDID: 1526280862-Zu2uYaYZiaAm Subject: Re: [dpdk-dev] [PATCH 2/3] ethdev: fail if Tx queue offload is not supported at all 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, 14 May 2018 06:54:23 -0000 On 05/13/2018 08:37 AM, Shahaf Shuler wrote: >> Do not allow to request unsupported Tx offload since all checks are removed >> from PMDs because of consistency check in ethdev. >> Otherwise application may rely on offload which is not actually supported >> and send traffic with, for example, wrong checksums, truncated packets or >> packets with garbage. >> >> Fixes: d04dd6d4ed67 ("ethdev: new Rx/Tx offloads API") >> >> Signed-off-by: Andrew Rybchenko >> --- >> lib/librte_ethdev/rte_ethdev.c | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c >> index dd36e6270..60577efcf 100644 >> --- a/lib/librte_ethdev/rte_ethdev.c >> +++ b/lib/librte_ethdev/rte_ethdev.c >> @@ -1744,6 +1744,16 @@ rte_eth_tx_queue_setup(uint16_t port_id, >> uint16_t tx_queue_id, >> local_conf.offloads, >> dev_info.tx_queue_offload_capa, >> __func__); >> + /* >> + * Applications which are not converted yet to the new >> + * Tx offload API may request device level offloads on >> + * queue level (and nothing is requested on device level). >> + * However, if the offload is not supported at all Tx >> + * queue setup must fail. >> + */ >> + if ((local_conf.offloads & dev_info.tx_offload_capa) != >> + local_conf.offloads) >> + return -EINVAL; > Not converted application doesn't have a clue what are per-queue offloads, and this is the error they will get when the Tx queue configuration will fail. > > How about using ETH_TXQ_FLAGS_IGNORE flag, which explicitly says "application converted to the new Tx offloads API". and have 2 different checks: > 1. for converted application the already exist check[1] with the related error. > 2. for not converted application your check with a related error. Yes, I like the idea. Many thanks. I'll send v2 shortly. > [1] > if ((local_conf.offloads & dev_info.tx_queue_offload_capa) != > local_conf.offloads) { > >> } >> >> return eth_err(port_id, (*dev->dev_ops->tx_queue_setup)(dev, >> -- >> 2.17.0