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 9A78545710; Thu, 1 Aug 2024 12:17:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 747BD42F77; Thu, 1 Aug 2024 12:17:48 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 2B4EA40270 for ; Thu, 1 Aug 2024 12:17:47 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1fc611a0f8cso49760465ad.2 for ; Thu, 01 Aug 2024 03:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722507466; x=1723112266; darn=dpdk.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wfXOPPLoJ0FWJA0NbLfU99DHlYt82GBxGXaCUrFKkAE=; b=cyrWHuzyISMBZQXDF/s2rz1+E0o1kr2FM1ge5qQFjD7+1iYKtENv/Tp41oy2pqGznK 4sX2GSTWsaBVEJ3lM9qPikWsw3PHc0twuKJ5oiN1q0heL4ud20F90HdxkFR9GeYACPay qf1o80Zxu1/ZCR4FSocZM7Aw4tZ/krO6U65/sSBwqQnBIqCVHSqrkDA99Ee9k0Q83d/W jTN9AQNwab2LCgNrDz23RzNkLZLyXfM0gL9Ececo+vSEs3FfOgA1kxT5pMIF6VMS8Kb0 G6OAI/Jzc3ZbMsOl0AFl8ybQ2wAlI5Tm2Qh+6JFokk2ZX1i2bQlzbixjrWsYEK8ThmdI yaHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722507466; x=1723112266; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wfXOPPLoJ0FWJA0NbLfU99DHlYt82GBxGXaCUrFKkAE=; b=Wu0E3Q7/7ASgXNSlMPmJpOFLZKa1JGRnnoIy7gnQ4UEv6WpLs9BilTnyy2wQZpwPUP 3rxTg0UxmBfxnBdPGHC3kb5h/lRhjit8OdxAMfmCE2b8WuqCpuekqaYnhqT9WtBjkBhL bX/nlZC5USC5Hs0v/EOWCrNoWFqLiulsIKmJoQSRe1KdCU7GvHp64XsBFqhZYw/Cqo1f vrM5bCAYvcDmfJBn7enP09lfr7CRp66DTK0R8BXdmlnsWjldgDE5n9vhASElPlJPDnnw g9saujy8OkwC01gEl1yU90wL6jMg8Bp6lZ8Am56aNGjy7TLHGuF13IRRGr9r2O43Oyx6 h1qA== X-Gm-Message-State: AOJu0YzKYZweQt+iaRtubD7nP+b0D36C4kz7BcLQPMmE7riIHA503ZiE 5HbjhiPL26gvyWeFkc5SJXqEA+ICyvms4p7hLYJkhHgwli1sE+VH X-Google-Smtp-Source: AGHT+IEsMTnIgWCnkOJ2GtnvaBB0BgpBoVvHSqzJhuKQDjlYiOh21Infv5BBJMon89wNQ8zufry+dg== X-Received: by 2002:a17:902:d4cc:b0:1fd:73e6:83dc with SMTP id d9443c01a7336-1ff4cc82620mr22975715ad.0.1722507466096; Thu, 01 Aug 2024 03:17:46 -0700 (PDT) Received: from tp-fat-se.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ff36f26c57sm48551135ad.281.2024.08.01.03.17.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2024 03:17:45 -0700 (PDT) From: Tathagat Priyadarshi To: rushilg@google.com, joshwash@google.com Cc: dev@dpdk.org, Tathagat Priyadarshi , Varun Lakkur Ambaji Rao Subject: [PATCH] net/gve: Add support for TSO in DQO RDA Date: Thu, 1 Aug 2024 10:19:08 +0000 Message-Id: <1722507548-2401507-1-git-send-email-tathagat.dpdk@gmail.com> X-Mailer: git-send-email 1.8.3.1 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 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 = next; } +static inline void +gve_tx_fill_seg_desc_dqo(volatile union gve_tx_desc_dqo *desc, struct rte_mbuf *tx_pkt) +{ + uint32_t hlen = tx_pkt->l2_len + tx_pkt->l3_len + tx_pkt->l4_len; + desc->tso_ctx.cmd_dtype.dtype = GVE_TX_TSO_CTX_DESC_DTYPE_DQO; + desc->tso_ctx.cmd_dtype.tso = 1; + desc->tso_ctx.mss = (uint16_t)tx_pkt->tso_segsz; + desc->tso_ctx.tso_total_len = tx_pkt->pkt_len - hlen; + desc->tso_ctx.header_len = (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 = txq->sw_ring; txr = txq->tx_ring; @@ -108,12 +121,31 @@ gve_tx_clean_dqo(txq); } - if (txq->nb_free < tx_pkt->nb_segs) - break; - ol_flags = tx_pkt->ol_flags; nb_used = tx_pkt->nb_segs; first_sw_id = sw_id; + + if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) { + tso = 1; + csum = 1; + } else if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO) { + tso = 0; + csum = 1; + } else { + tso = 0; + csum = 0; + } + + nb_used += tso; + if (txq->nb_free < nb_used) + break; + + if (tso) { + txd = &txr[tx_id]; + gve_tx_fill_seg_desc_dqo(txd, tx_pkt); + tx_id = (tx_id + 1) & mask; + } + do { if (sw_ring[sw_id] != NULL) PMD_DRV_LOG(DEBUG, "Overwriting an entry in sw_ring"); @@ -127,6 +159,7 @@ txd->pkt.compl_tag = rte_cpu_to_le_16(first_sw_id); txd->pkt.buf_size = RTE_MIN(tx_pkt->data_len, GVE_TX_MAX_BUF_SIZE_DQO); txd->pkt.end_of_packet = 0; + txd->pkt.checksum_offload_enable = csum; /* size of desc_ring and sw_ring could be different */ tx_id = (tx_id + 1) & mask; @@ -139,9 +172,6 @@ /* fill the last descriptor with End of Packet (EOP) bit */ txd->pkt.end_of_packet = 1; - if (ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO) - txd->pkt.checksum_offload_enable = 1; - txq->nb_free -= nb_used; txq->nb_used += nb_used; } -- 1.8.3.1