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: Wed, 17 Jan 2018 18:58:08 +0000 Message-ID: <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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: mw@semihalf.com, mk@semihalf.com, gtzalik@amazon.com, evgenys@amazon.com, matua@amazon.com, igorch@amazon.com To: Rafal Kozik , dev@dpdk.org, Shahaf Shuler Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6D0A71B2C9 for ; Wed, 17 Jan 2018 19:58:12 +0100 (CET) In-Reply-To: <1516177424-8613-1-git-send-email-rk@semihalf.com> 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/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?