From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2 1/2] net/ena: convert to new Tx offloads API Date: Thu, 18 Jan 2018 14:49:22 +0000 Message-ID: <13f38c4c-7758-1ea7-16ba-ab0453f101a1@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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, Shahaf Shuler , Marcin Wojtas , =?UTF-8?Q?Micha=c5=82_Krawczyk?= , "Tzalik, Guy" , evgenys@amazon.com, "Matushevsky, Alexander" , "Chauskin, Igor" To: =?UTF-8?Q?Rafa=c5=82_Kozik?= Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 9395B1B328 for ; Thu, 18 Jan 2018 15:49:27 +0100 (CET) In-Reply-To: Content-Language: en-US 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 1/18/2018 9:18 AM, RafaƂ Kozik wrote: > 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. OK, thanks for clarification.