From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0971145710; Thu, 1 Aug 2024 12:33:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED3DA40DF8; Thu, 1 Aug 2024 12:33:17 +0200 (CEST) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) by mails.dpdk.org (Postfix) with ESMTP id D165340270 for ; Thu, 1 Aug 2024 12:33:16 +0200 (CEST) Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-49297fca3c2so1830241137.1 for ; Thu, 01 Aug 2024 03:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722508396; x=1723113196; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=xvukT4ZcVAX6ytyVJIQTRwBnoWETD7rZZY7ml2U/6v0=; b=TJ+8lSHWdQvXh46W2YMZoUzIEp115y36PAiHuRjnyUP6ln6hriW4YR+ARq0joZclPm chmCZVspodaVxGLz/C6fNVs15c8JleYzgaALOQajyF2zVVYcwu7FKR9i6rHaIt1FJ1Di L6HlN323CDRQKrb61CnU3VRIbeaJy3BrPZZZTcLt0hqf/HW4+FPw8gTr6Y95L31+1ik8 P8H64sgBoKCHAN/+sOluy/BjINaJztNcRFT6pWMzEMYJ0GGpPxwVh9haRKsWz/KKjfvo M1VQiqz8YAJw+dRUoCMft4CFsbOW2ar+J9VpZNQXNNJpiPLFLoAoEeEqqfg1gBA5aGqE Cvzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722508396; x=1723113196; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xvukT4ZcVAX6ytyVJIQTRwBnoWETD7rZZY7ml2U/6v0=; b=d+yzxKjf6D9akjfmduRh0ksZqR4Ic6nsvwicPJcEWdf315CJaqcsPiPriefeY/wM9W GeKQB/TbDoUtXC5xTIH9cbSYR7py4YpQsTUcCdB8CmWboqgqRuQVKPAxB76ufsNYV9dP LrseuKOHk7CCzpdqWeo/oQzgDvoMuHUDgFSxm40UTUP/0+/rgDK4UcjShapYWWAXZJBN b0878tITWIpFQqkUpHarCJ4wBOq3nqUylayRw06WuGYjoCFivRS7Hxxxmwtg4163tqho 0VdXZ4RTtZHVBRIzXPEnQ4+jFv2j2oQsnTUsR5PKa/f8idemM2YCmnIjzIPrRnousmdv eqtw== X-Gm-Message-State: AOJu0Yy+eecOitVV40JiR65dZC5ob9haijqp9ZvCwicGPDxgghuufTeY skW2TE7QYbhxZhOBuCz6JfeQHL87kkOp53ImFckGoLcHaivtlJGx74AbkgyCwkVRVXakehz2nrW EyCDICi3CaDC9GimwYF7N+SC4SLk= X-Google-Smtp-Source: AGHT+IERYbAZ3oHeH1V+qR+1q5WrbfgLtw0f7afS8mmsu4yPFRjMuePtn4dOaCjvHbaIItB9bvxhMKEVvBXxGcG/34A= X-Received: by 2002:a05:6102:947:b0:48f:868f:9f7a with SMTP id ada2fe7eead31-494506c7becmr89796137.10.1722508395891; Thu, 01 Aug 2024 03:33:15 -0700 (PDT) MIME-Version: 1.0 References: <1722507548-2401507-1-git-send-email-tathagat.dpdk@gmail.com> In-Reply-To: <1722507548-2401507-1-git-send-email-tathagat.dpdk@gmail.com> From: Tathagat Priyadarshi Date: Thu, 1 Aug 2024 16:03:05 +0530 Message-ID: Subject: Re: [PATCH] net/gve: Add support for TSO in DQO RDA To: rushilg@google.com, joshwash@google.com Cc: dev@dpdk.org, Varun Lakkur Ambaji Rao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The following patch depends on https://patches.dpdk.org/project/dpdk/patch/1722443901-2400194-1-git-send-e= mail-tathagat.dpdk@gmail.com/ Will retrigger git patch checks post its approved and upstreamed. To avoid conflicts. On Thu, Aug 1, 2024 at 3:47=E2=80=AFPM Tathagat Priyadarshi wrote: > > The patch intends on adding support for TSO in DQO RDA format. > > Signed-off-by: Tathagat Priyadarshi > Signed-off-by: Varun Lakkur Ambaji Rao > --- > drivers/net/gve/gve_tx_dqo.c | 42 ++++++++++++++++++++++++++++++++++++--= ---- > 1 file changed, 36 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c > index 579b8d6..e5cdb57 100644 > --- a/drivers/net/gve/gve_tx_dqo.c > +++ b/drivers/net/gve/gve_tx_dqo.c > @@ -72,6 +72,17 @@ > txq->complq_tail =3D next; > } > > +static inline void > +gve_tx_fill_seg_desc_dqo(volatile union gve_tx_desc_dqo *desc, struct rt= e_mbuf *tx_pkt) > +{ > + uint32_t hlen =3D tx_pkt->l2_len + tx_pkt->l3_len + tx_pkt->l4_le= n; > + desc->tso_ctx.cmd_dtype.dtype =3D GVE_TX_TSO_CTX_DESC_DTYPE_DQO; > + desc->tso_ctx.cmd_dtype.tso =3D 1; > + desc->tso_ctx.mss =3D (uint16_t)tx_pkt->tso_segsz; > + desc->tso_ctx.tso_total_len =3D tx_pkt->pkt_len - hlen; > + desc->tso_ctx.header_len =3D (uint8_t)hlen; > +} > + > uint16_t > gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_= pkts) > { > @@ -89,6 +100,8 @@ > uint16_t sw_id; > uint64_t bytes; > uint16_t first_sw_id; > + uint8_t tso; > + uint8_t csum; > > sw_ring =3D txq->sw_ring; > txr =3D txq->tx_ring; > @@ -108,12 +121,31 @@ > gve_tx_clean_dqo(txq); > } > > - if (txq->nb_free < tx_pkt->nb_segs) > - break; > - > ol_flags =3D tx_pkt->ol_flags; > nb_used =3D tx_pkt->nb_segs; > first_sw_id =3D sw_id; > + > + if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) { > + tso =3D 1; > + csum =3D 1; > + } else if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO) { > + tso =3D 0; > + csum =3D 1; > + } else { > + tso =3D 0; > + csum =3D 0; > + } > + > + nb_used +=3D tso; > + if (txq->nb_free < nb_used) > + break; > + > + if (tso) { > + txd =3D &txr[tx_id]; > + gve_tx_fill_seg_desc_dqo(txd, tx_pkt); > + tx_id =3D (tx_id + 1) & mask; > + } > + > do { > if (sw_ring[sw_id] !=3D NULL) > PMD_DRV_LOG(DEBUG, "Overwriting an entry = in sw_ring"); > @@ -127,6 +159,7 @@ > txd->pkt.compl_tag =3D rte_cpu_to_le_16(first_sw_= id); > txd->pkt.buf_size =3D RTE_MIN(tx_pkt->data_len, G= VE_TX_MAX_BUF_SIZE_DQO); > txd->pkt.end_of_packet =3D 0; > + txd->pkt.checksum_offload_enable =3D csum; > > /* size of desc_ring and sw_ring could be differe= nt */ > tx_id =3D (tx_id + 1) & mask; > @@ -139,9 +172,6 @@ > /* fill the last descriptor with End of Packet (EOP) bit = */ > txd->pkt.end_of_packet =3D 1; > > - if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO) > - txd->pkt.checksum_offload_enable =3D 1; > - > txq->nb_free -=3D nb_used; > txq->nb_used +=3D nb_used; > } > -- > 1.8.3.1 >