From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by dpdk.org (Postfix) with ESMTP id 9ACD17260 for ; Thu, 18 Jan 2018 10:18:38 +0100 (CET) Received: by mail-lf0-f68.google.com with SMTP id k19so5405215lfj.1 for ; Thu, 18 Jan 2018 01:18:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EURm+DKI6ru3QApzqueqWkJDpT48NRQ63mqLrOddXbw=; b=ps2vB9tn+eK4E8Q6bZ1YpE9mp3RnVIu8+CsQ16If7AtNwjs7oHPA52T4oTlg5DIYBe cgVnzSTqg2eCKWhYErG8osMncKoew793iD4Hbck11cA7QYj6TvyHSzTX/nEFZY6mR0lZ IamjuFvPhuqrOvHwd056Ik3Ny01om2pBtZk2KyiXu3XnZnT6COOyCVddZwxXEuhPmu1A HnM0ty4Mm7VBIpdW0zC8TPDu50YiG91fKTOaRx3RuXD6eg8uGdaUcJRlrhj5S3mltT11 w1nUJaxOhNFU40QRaKjT2CdehDu8FHxQCGjkirrJH8PQGtp8kZtXJwDWCEZ0V7cyCsW7 0gGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EURm+DKI6ru3QApzqueqWkJDpT48NRQ63mqLrOddXbw=; b=HtkHn+L0uLnP04kH9GGCr+lXqkhDy8CMneJ+gs5Gbz6ClbgQm0v3Peflhx1qc0X/y+ 67BC3neObQIj2rp7b1yeJpwBih/MGa5w9aHMf8OoAu6LI09ctJ8Gpki9MZxyDIAICf29 vkQbFKoZo9M9c8E9295t7PK/Ds3IhG8mAFX4Jc3thrTwwuTy5yxL7p8PbAeiiRZNcM7W EG3MKmSZPxnze0uAEvxwWfiedQ6xXJSFVnrRGOWJHP/yQNfBZM5oMRWr0RYcoMKnwagN 2sk89iBz1jG16Ias8+uYf1a7pGh1QKKFP/cgKFF8j7yQ1aX/PpfMQ7esFOX9A+n6EaYu d7sA== X-Gm-Message-State: AKwxytcIPZ6ub3j8jPUutmNXh8IoyDht7RInbCtSO3S41GBiPhxpgFaG GWimFi+8oTSF2bpeudP3lEidBnNmnat2ZmTwn9Fn4A== X-Google-Smtp-Source: ACJfBouEn88t99pgfQG+VBRImuJX5M2LjcHhGOy7fGs3Ww0KJMEyWs1sDdE3RK83jEDS49l5ZOwOS3lpnPBRurPtNRk= X-Received: by 10.25.233.140 with SMTP id j12mr18978932lfk.0.1516267118132; Thu, 18 Jan 2018 01:18:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.161.131 with HTTP; Thu, 18 Jan 2018 01:18:37 -0800 (PST) In-Reply-To: <953fa892-d65f-2aca-9909-a812ef6a18c4@intel.com> References: <1516103563-9275-2-git-send-email-rk@semihalf.com> <1516177424-8613-1-git-send-email-rk@semihalf.com> <953fa892-d65f-2aca-9909-a812ef6a18c4@intel.com> From: =?UTF-8?B?UmFmYcWCIEtvemlr?= Date: Thu, 18 Jan 2018 10:18:37 +0100 Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org, Shahaf Shuler , Marcin Wojtas , =?UTF-8?Q?Micha=C5=82_Krawczyk?= , "Tzalik, Guy" , evgenys@amazon.com, "Matushevsky, Alexander" , "Chauskin, Igor" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 1/2] net/ena: convert to new Tx 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: Thu, 18 Jan 2018 09:18:38 -0000 2018-01-17 19:58 GMT+01:00 Ferruh Yigit : > On 1/17/2018 8:23 AM, Rafal Kozik wrote: >> Ethdev Tx offloads API has changed since: >> >> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") >> >> This commit support the new Tx offloads API. Queue configuration >> is stored in ena_ring.offloads. During preparing mbufs for tx, offloads are >> allowed only if appropriate flags in this field are set. >> >> Signed-off-by: Rafal Kozik > > <...> > >> @@ -280,21 +290,24 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf, >> } >> >> static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf, >> - struct ena_com_tx_ctx *ena_tx_ctx) >> + struct ena_com_tx_ctx *ena_tx_ctx, >> + uint64_t queue_offloads) >> { >> struct ena_com_tx_meta *ena_meta = &ena_tx_ctx->ena_meta; >> >> - if (mbuf->ol_flags & >> - (PKT_TX_L4_MASK | PKT_TX_IP_CKSUM | PKT_TX_TCP_SEG)) { >> + if ((mbuf->ol_flags & MBUF_OFFLOADS) && >> + (queue_offloads & QUEUE_OFFLOADS)) { >> /* check if TSO is required */ >> - if (mbuf->ol_flags & PKT_TX_TCP_SEG) { >> + if ((mbuf->ol_flags & PKT_TX_TCP_SEG) && >> + (queue_offloads & DEV_TX_OFFLOAD_TCP_TSO)) { >> ena_tx_ctx->tso_enable = true; >> >> ena_meta->l4_hdr_len = GET_L4_HDR_LEN(mbuf); >> } >> >> /* check if L3 checksum is needed */ >> - if (mbuf->ol_flags & PKT_TX_IP_CKSUM) >> + if ((mbuf->ol_flags & PKT_TX_IP_CKSUM) && >> + (queue_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM)) >> ena_tx_ctx->l3_csum_enable = true; > > This function is fast path right? > Do you really need new extra check to queue_offloads, isn't that information is > for setup phase? > ENA does not have a switch for enabling/disabling offloads during configuration. We must use additional variable and track it, otherwise the driver could use checksum offloads by enabling it in mbuf although it was disabled in queue configuration.