From: Shai Brandes <shaibran@amazon.com>
To: <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, Shai Brandes <shaibran@amazon.com>
Subject: [PATCH 01/21] net/ena/base: optimize Tx desc fields setting
Date: Wed, 15 Oct 2025 10:06:47 +0300 [thread overview]
Message-ID: <20251015070707.340-2-shaibran@amazon.com> (raw)
In-Reply-To: <20251015070707.340-1-shaibran@amazon.com>
Instead of erasing tx descriptor and later set all fields using or,
use set for the first value of each field of the descriptor.
Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
Reviewed-by: Yosef Raisman <yraisman@amazon.com>
---
drivers/net/ena/base/ena_eth_com.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ena/base/ena_eth_com.c b/drivers/net/ena/base/ena_eth_com.c
index c6668238e5..c4fee7bb3c 100644
--- a/drivers/net/ena/base/ena_eth_com.c
+++ b/drivers/net/ena/base/ena_eth_com.c
@@ -516,26 +516,25 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,
desc = get_sq_desc(io_sq);
if (unlikely(!desc))
return ENA_COM_FAULT;
- memset(desc, 0x0, sizeof(struct ena_eth_io_tx_desc));
+
+ desc->len_ctrl = ENA_FIELD_PREP((u32)io_sq->phase,
+ ENA_ETH_IO_TX_DESC_PHASE_MASK,
+ ENA_ETH_IO_TX_DESC_PHASE_SHIFT);
/* Set first desc when we don't have meta descriptor */
if (!have_meta)
desc->len_ctrl |= ENA_ETH_IO_TX_DESC_FIRST_MASK;
- desc->buff_addr_hi_hdr_sz |= ENA_FIELD_PREP((u32)header_len,
- ENA_ETH_IO_TX_DESC_HEADER_LENGTH_MASK,
- ENA_ETH_IO_TX_DESC_HEADER_LENGTH_SHIFT);
-
- desc->len_ctrl |= ENA_FIELD_PREP((u32)io_sq->phase,
- ENA_ETH_IO_TX_DESC_PHASE_MASK,
- ENA_ETH_IO_TX_DESC_PHASE_SHIFT);
+ desc->buff_addr_hi_hdr_sz = ENA_FIELD_PREP((u32)header_len,
+ ENA_ETH_IO_TX_DESC_HEADER_LENGTH_MASK,
+ ENA_ETH_IO_TX_DESC_HEADER_LENGTH_SHIFT);
desc->len_ctrl |= ENA_ETH_IO_TX_DESC_COMP_REQ_MASK;
/* Bits 0-9 */
- desc->meta_ctrl |= ENA_FIELD_PREP((u32)ena_tx_ctx->req_id,
- ENA_ETH_IO_TX_DESC_REQ_ID_LO_MASK,
- ENA_ETH_IO_TX_DESC_REQ_ID_LO_SHIFT);
+ desc->meta_ctrl = ENA_FIELD_PREP((u32)ena_tx_ctx->req_id,
+ ENA_ETH_IO_TX_DESC_REQ_ID_LO_MASK,
+ ENA_ETH_IO_TX_DESC_REQ_ID_LO_SHIFT);
desc->meta_ctrl |= ENA_FIELD_PREP(ena_tx_ctx->df,
ENA_ETH_IO_TX_DESC_DF_MASK,
--
2.17.1
next prev parent reply other threads:[~2025-10-15 7:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 7:06 [PATCH 00/21] net/ena: Release 2.14.0 Shai Brandes
2025-10-15 7:06 ` Shai Brandes [this message]
2025-10-15 7:06 ` [PATCH 02/21] net/ena/base: rework admin timeout handling Shai Brandes
2025-10-15 7:06 ` [PATCH 03/21] net/ena/base: add extended Tx cdesc support Shai Brandes
2025-10-15 7:06 ` [PATCH 04/21] net/ena/base: add IO ring helper functions Shai Brandes
2025-10-15 8:50 ` [PATCH 00/21] net/ena: Release 2.14.0 Brandes, Shai
2025-10-15 18:12 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251015070707.340-2-shaibran@amazon.com \
--to=shaibran@amazon.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.