From patchwork Fri Aug 9 18:51:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tathagat Priyadarshi X-Patchwork-Id: 143054 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A67354577C; Fri, 9 Aug 2024 20:49:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94B7E42F07; Fri, 9 Aug 2024 20:49:34 +0200 (CEST) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id F1BF940291 for ; Fri, 9 Aug 2024 20:49:33 +0200 (CEST) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1fc569440e1so22096305ad.3 for ; Fri, 09 Aug 2024 11:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723229373; x=1723834173; darn=dpdk.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=RGOQlg3eaLjSoMh+ZyaPxu3libw44+K6M+1IaWnkvfg=; b=meAjCdPurnlDBjUJ0JDpw+HpEkrYSrTXnAVRsp4yv6S5zlEfl3BiRW1F59Xcbeb4Ua m/drZRpns5ZVUujyriCmOk6s39V9uYR7Rkhz2d1zLF5aq4ThFXCOX4TFmL2cX+UX8rZ4 vdkJSNmzrmDoLNHDRdqeSunj+6RXicKRAfH2xb7ewBB+NUGL8MdBlMFzzU3gxju2BfNF RUvzICd1o1t0BMBLZsOyoNDsqtpgdt/vKk/EfnSZgc8BSmcxD3o+WqP7A+Q35OqvxV5q C5he7Qovf5wI/wG3fZw5f8SbYi5ZY9narbFFyshM6DH0dwu9UKMm2t0qwtZ+5OPU1NNR xczg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723229373; x=1723834173; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RGOQlg3eaLjSoMh+ZyaPxu3libw44+K6M+1IaWnkvfg=; b=F7V9n2ae8hEn2CJcpHaXXqgHQvgkDHENN0GTXT5TKTUfPvZFhQc0yRCpdegR7O27pV Ie5v1uQg7AiCtYWoLEOT+zpsZ29r/71KluauuB81E1gyB5ce/RuxSfm0AMR0ppCOfmSX 6pfVI1MK6EbtLIwjpVlixLDXvXKuTm8DACjbZu78QJP/+fX4RdZ4pO2VeO+1g2h/Hutw OIHbPIwtOw4jOL+oibTDcCKBiMTO/2zSDwwsGPF5GtzQNtzhPaNpR7Mbq6+T4OhW0l3K bR7A5dtTPYqbwHKpwOX13a9toGMcPZ5f9soMIE+WXsFDM6QoAeJ692VzydvCLnwmkQ9s pxKQ== X-Gm-Message-State: AOJu0YwuuEqP8657PDAekULhIPyHwLIg+n7ZLvfIk5Z9wJOL25bDZ+N8 XYAQpzQn3QbzwyZlzVDSYftIZyaYRewm3e+pyambkZVISGTBBibE03YUZg== X-Google-Smtp-Source: AGHT+IH/Nml/tYSHQHXgCjfAGBa3K2z7G/Qn1cc0ccfJoBMGAvIWcm5DSd4Cc0c1QyAO8Cba0Gz+/Q== X-Received: by 2002:a17:902:ce8f:b0:1fb:7c7f:6447 with SMTP id d9443c01a7336-200ae5455afmr28445825ad.25.1723229372818; Fri, 09 Aug 2024 11:49:32 -0700 (PDT) Received: from tp-fat-se.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-200bb7eabaasm866695ad.32.2024.08.09.11.49.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Aug 2024 11:49:32 -0700 (PDT) From: Tathagat Priyadarshi To: dev@dpdk.org Cc: Tathagat Priyadarshi , Varun Lakkur Ambaji Rao Subject: [PATCH v3] net/gve: add support for TSO in DQO RDA Date: Fri, 9 Aug 2024 18:51:02 +0000 Message-Id: <1723229462-2439640-1-git-send-email-tathagat.dpdk@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1722507548-2401507-1-git-send-email-tathagat.dpdk@gmail.com> References: <1722507548-2401507-1-git-send-email-tathagat.dpdk@gmail.com> 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 Acked-by: Rushil Gupta --- drivers/net/gve/gve_tx_dqo.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c index b9d6d01..731c287 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,7 @@ uint16_t sw_id; uint64_t bytes; uint16_t first_sw_id; + uint8_t tso; uint8_t csum; sw_ring = txq->sw_ring; @@ -109,15 +121,23 @@ 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; + tso = !!(ol_flags & RTE_MBUF_F_TX_TCP_SEG); csum = !!(ol_flags & GVE_TX_CKSUM_OFFLOAD_MASK_DQO); + 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");