net/ena: release 2.13.0
v4 cover net/ena: release 2.13.0
This patchset includes an upgrade of the ENA HAL, introduces a new feature, and addresses three bug fixes.
Thank you in advance to the net maintainers and community members for your time and effort reviewing the code.
Best regards,
Shai Brandes
AWS Elastic Network Adapter team
---
v2:
Removed patch "net/ena: fix virtual address calc for unaligned BARs" which contained a problematic casting when compiling with 32-bit system
v3:
no change, there was some technical issue when sending the emails where part of the patches apeared on different series.
v4:
Each patch in the series should compile independently. Patch 4/7 causes a compile error that was missed,
as the full series passed our directed tests when applied together
Shai Brandes (7):
net/ena/base: avoid recalculating desc per entry net/ena/base: coding style changes net/ena: separate doorbell logic for Rx and Tx net/ena: support fragment bypass mode net/ena: fix unhandled interrupt config failure net/ena: fix aenq timeout with low poll interval net/ena: upgrade driver version to 2.13.0
doc/guides/nics/ena.rst | 13 ++- doc/guides/rel_notes/release_25_07.rst | 9 ++ drivers/net/ena/base/ena_com.c | 39 +++++++- drivers/net/ena/base/ena_com.h | 8 ++ .../net/ena/base/ena_defs/ena_admin_defs.h | 15 +++ drivers/net/ena/base/ena_eth_com.c | 6 +- drivers/net/ena/base/ena_eth_com.h | 15 ++- drivers/net/ena/ena_ethdev.c | 98 +++++++++++++++---- drivers/net/ena/ena_ethdev.h | 5 +- 9 files changed, 177 insertions(+), 31 deletions(-)
Signature · 1 line
2.17.1
PATCH v4 1/7 net/ena/base: avoid recalculating desc per entry
desc_per_entry is precomputed in ena_com_config_llq_info() using desc_stride_ctrl and desc_list_entry_size, which remain unchanged after device negotiation. Reuse the existing value instead of recalculating it in the fast path.
--- drivers/net/ena/base/ena_eth_com.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/ena/base/ena_eth_com.c +1 -5
@@ -248,11 +248,7 @@ static int ena_com_sq_update_llq_tail(struct ena_com_io_sq *io_sq) 0x0, llq_info->desc_list_entry_size); pkt_ctrl->idx =0 ; -if (unlikely (llq_info->desc_stride_ctrl ==ENA_ADMIN_SINGLE_DESC_PER_ENTRY )) - pkt_ctrl->descs_left_in_line =1 ; -else - pkt_ctrl->descs_left_in_line = - llq_info->desc_list_entry_size / io_sq->desc_entry_size; + pkt_ctrl->descs_left_in_line = llq_info->descs_per_entry; }return ENA_COM_OK ;
Signature · 1 line
2.17.1
PATCH v4 2/7 net/ena/base: coding style changes
In reply to Shai BrandesReordered variable declarations to follow the reverse Christmas tree style.
--- drivers/net/ena/base/ena_com.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ena/base/ena_com.c +3 -3
@@ -308,8 +308,8 @@ static struct ena_comp_ctx *ena_com_submit_admin_cmd(struct ena_com_admin_queue struct ena_admin_acq_entry *comp, size_t comp_size_in_bytes) { -unsigned long flags =0 ;struct ena_comp_ctx *comp_ctx; +unsigned long flags =0 ;ENA_SPINLOCK_LOCK (admin_queue->q_lock, flags);if (unlikely (!admin_queue->running_state)) {
@@ -616,10 +616,10 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c*/ static int ena_com_set_llq (struct ena_com_dev *ena_dev) { +struct ena_com_llq_info *llq_info = &ena_dev->llq_info;struct ena_com_admin_queue *admin_queue; -struct ena_admin_set_feat_cmd cmd;struct ena_admin_set_feat_resp resp; -struct ena_com_llq_info *llq_info = &ena_dev->llq_info; +struct ena_admin_set_feat_cmd cmd;int ret;memset (&cmd,0x0 ,sizeof (cmd));
Signature · 1 line
2.17.1
PATCH v4 3/7 net/ena: separate doorbell logic for Rx and Tx
In reply to Shai BrandesThe function ena_com_write_sq_doorbell() currently checks for LLQ mode using is_llq_max_tx_burst_exists() which is relevant only for TX queues.
Since RX queues do not operate in LLQ mode, this check is unnecessary for the RX path.
This patch separates the doorbell write logic into two distinct handlers for RX and TX, eliminating the irrelevant LLQ check in the RX path.
--- drivers/net/ena/base/ena_eth_com.h | 15 ++++++++++++++- drivers/net/ena/ena_ethdev.c | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-)
drivers/net/ena/base/ena_eth_com.h +14 -1
@@ -159,7 +159,20 @@ static inline bool ena_com_is_doorbell_needed(struct ena_com_io_sq *io_sq,return num_entries_needed > io_sq->entries_in_tx_burst_left; } -static inline int ena_com_write_sq_doorbell (struct ena_com_io_sq *io_sq) +static inline int ena_com_write_rx_sq_doorbell (struct ena_com_io_sq *io_sq) +{ +u16 tail = io_sq->tail; + +ena_trc_dbg (ena_com_io_sq_to_ena_dev (io_sq), +"Write submission queue doorbell for queue: %d tail: %d\n" , + io_sq->qid, tail); + +ENA_REG_WRITE32 (io_sq->bus, tail, io_sq->db_addr); + +return 0 ; +} + +static inline int ena_com_write_tx_sq_doorbell (struct ena_com_io_sq *io_sq) {u16 max_entries_in_tx_burst = io_sq->llq_info.max_entries_in_tx_burst;u16 tail = io_sq->tail;
drivers/net/ena/ena_ethdev.c +3 -3
@@ -1835,7 +1835,7 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count)/* When we submitted free resources to device... */ if (likely (i >0 )) {/* ...let HW know that it can fill buffers with data. */ -ena_com_write_sq_doorbell (rxq->ena_com_io_sq); +ena_com_write_rx_sq_doorbell (rxq->ena_com_io_sq); rxq->next_to_use = next_to_use; }
@@ -3163,7 +3163,7 @@ static int ena_xmit_mbuf(struct ena_ring *tx_ring, struct rte_mbuf *mbuf)PMD_TX_LOG_LINE (DEBUG ,"LLQ Tx max burst size of queue %d achieved, writing doorbell to send burst" , tx_ring->id); -ena_com_write_sq_doorbell (tx_ring->ena_com_io_sq); +ena_com_write_tx_sq_doorbell (tx_ring->ena_com_io_sq); tx_ring->tx_stats.doorbells++; tx_ring->pkts_without_db = false; }
@@ -3296,7 +3296,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,/* If there are ready packets to be xmitted... */ if (likely (tx_ring->pkts_without_db)) {/* ...let HW do its best :-) */ -ena_com_write_sq_doorbell (tx_ring->ena_com_io_sq); +ena_com_write_tx_sq_doorbell (tx_ring->ena_com_io_sq); tx_ring->tx_stats.doorbells++; tx_ring->pkts_without_db = false; }
Signature · 1 line
2.17.1
PATCH v4 4/7 net/ena: support fragment bypass mode
In reply to Shai BrandesIntroduce devarg enable_frag_bypass to toggle the fragment bypass mode for egress packets.
When enabled, this feature bypasses the PPS limit enforced by EC2 for fragmented egress packets on every ENI. Note that enabling this might negatively impact network performance.
By default, this feature is disabled. To enable it set enable_frag_bypass=1. If it cannot be enabled, a warning will be printed, but driver initialization will proceed as normal.
--- doc/guides/nics/ena.rst | 9 ++++ doc/guides/rel_notes/release_25_07.rst | 5 ++ drivers/net/ena/base/ena_com.c | 33 +++++++++++++ drivers/net/ena/base/ena_com.h | 8 ++++ .../net/ena/base/ena_defs/ena_admin_defs.h | 15 ++++++ drivers/net/ena/ena_ethdev.c | 48 ++++++++++++++++++- drivers/net/ena/ena_ethdev.h | 2 + 7 files changed, 119 insertions(+), 1 deletion(-)
doc/guides/nics/ena.rst +9 -0
@@ -141,6 +141,15 @@ Runtime Configuration **A non-zero value for this devarg is mandatory for control path functionality when binding ports to uio_pci_generic kernel module which lacks interrupt support.** + * **enable_frag_bypass** (default 0) + + Enable fragment bypass mode for egress packets. This mode bypasses the PPS + limit enforced by EC2 for fragmented egress packets on every ENI. Note that + enabling it might negatively impact network performance. + + 0 - Disabled (Default). + + 1 - Enabled. ENA Configuration Parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
doc/guides/rel_notes/release_25_07.rst +5 -0
@@ -63,6 +63,11 @@ New Features * ixgbe * iavf +* **Updated Amazon ENA (Elastic Network Adapter) net driver.** + + * Added support for enabling fragment bypass mode for egress packets. + This mode bypasses the PPS limit enforced by EC2 for fragmented egress packets on every ENI. + * **Updated virtio driver.** * Added support for Rx and Tx burst mode query.
drivers/net/ena/base/ena_com.c +33 -0
@@ -3459,3 +3459,36 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_dev,return 0 ; } +int ena_com_set_frag_bypass (struct ena_com_dev *ena_dev,bool enable) +{ +struct ena_admin_set_feat_resp set_feat_resp; +struct ena_com_admin_queue *admin_queue; +struct ena_admin_set_feat_cmd cmd; +int ret; + +if (!ena_com_check_supported_feature_id (ena_dev,ENA_ADMIN_FRAG_BYPASS )) { +ena_trc_dbg (ena_dev,"Feature %d isn't supported\n" , +ENA_ADMIN_FRAG_BYPASS ); +return ENA_COM_UNSUPPORTED ; + } + +memset (&cmd,0x0 ,sizeof (cmd)); + admin_queue = &ena_dev->admin_queue; + + cmd.aq_common_descriptor.opcode =ENA_ADMIN_SET_FEATURE ; + cmd.aq_common_descriptor.flags =0 ; + cmd.feat_common.feature_id =ENA_ADMIN_FRAG_BYPASS ; + cmd.feat_common.feature_version =ENA_ADMIN_FRAG_BYPASS_FEATURE_VERSION_0 ; + cmd.u.frag_bypass.enable = (u8 )enable; + + ret =ena_com_execute_admin_command (admin_queue, + (struct ena_admin_aq_entry *)&cmd, +sizeof (cmd), + (struct ena_admin_acq_entry *)&set_feat_resp, +sizeof (set_feat_resp)); + +if (unlikely (ret)) +ena_trc_err (ena_dev,"Failed to enable frag bypass. error: %d\n" , ret); + +return ret; +}
drivers/net/ena/base/ena_com.h +8 -0
@@ -1109,6 +1109,14 @@ static inline bool ena_com_get_missing_admin_interrupt(struct ena_com_dev *ena_dreturn ena_dev->admin_queue.is_missing_admin_interrupt; } +/* ena_com_set_frag_bypass - set fragment bypass +* @ena_dev: ENA communication layer struct +* @enable: true if fragment bypass is enabled, false otherwise. +* +* @return - 0 on success, negative value on failure. +*/ +int ena_com_set_frag_bypass (struct ena_com_dev *ena_dev,bool enable); +/* ena_com_io_sq_to_ena_dev - Extract ena_com_dev using contained field io_sq. * @io_sq: IO submit queue struct *
drivers/net/ena/base/ena_defs/ena_admin_defs.h +15 -0
@@ -57,6 +57,7 @@ enum ena_admin_aq_feature_id {ENA_ADMIN_EXTRA_PROPERTIES_STRINGS =5 ,ENA_ADMIN_EXTRA_PROPERTIES_FLAGS =6 ,ENA_ADMIN_MAX_QUEUES_EXT =7 , +ENA_ADMIN_FRAG_BYPASS =8 ,ENA_ADMIN_RSS_HASH_FUNCTION =10 ,ENA_ADMIN_STATELESS_OFFLOAD_CONFIG =11 , ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG = 12,
@@ -165,6 +166,11 @@ enum ena_admin_ena_srd_flags { ENA_ADMIN_ENA_SRD_UDP_ORDERING_BYPASS_ENABLED = BIT(2), }; +enum ena_admin_frag_bypass_feature_version { +/* Enable only */ +ENA_ADMIN_FRAG_BYPASS_FEATURE_VERSION_0 =0 , +}; +struct ena_admin_aq_common_desc {/* 11:0 : command_id * 15:12 : reserved12
@@ -706,6 +712,13 @@ struct ena_admin_feature_llq_desc {struct ena_admin_accel_mode_req accel_mode; }; +struct ena_admin_feature_frag_bypass_desc { +/* Enable frag_bypass */ +uint8_t enable; + +uint8_t reserved[3 ]; +}; +struct ena_admin_queue_ext_feature_fields {uint32_t max_tx_sq_num;
@@ -1180,6 +1193,8 @@ struct ena_admin_set_feat_cmd {/* PHC configuration */ struct ena_admin_feature_phc_desc phc; +/* Fragment bypass configuration */ +struct ena_admin_feature_frag_bypass_desc frag_bypass; } u; };
drivers/net/ena/ena_ethdev.c +47 -1
90 lines not on this page · raw message
drivers/net/ena/ena_ethdev.h +2 -0
@@ -348,6 +348,8 @@ struct ena_adapter {/* Time (in microseconds) of the control path queues monitoring interval */ uint64_t control_path_poll_interval; +bool enable_frag_bypass; +/* * Helper variables for holding the information about the supported * metrics.
Signature · 1 line
2.17.1
Quoted 9 lines · On Wed, 28 May 2025 13:25:24 +0300 Shai Brandes <[email protected]> wrote:
This patchset includes an upgrade of the ENA HAL, introduces a new feature, and addresses three bug fixes.
Thank you in advance to the net maintainers and community members for your time and effort reviewing the code.
Best regards,
Shai Brandes
AWS Elastic Network Adapter team
Could you check against current main branch.
This no longer applies, either it already got merged or something changed.
Quoted 24 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Sunday, June 29, 2025 7:50 PM
To: Brandes, Shai <[email protected]>
Cc: [email protected]
Subject: RE: [EXTERNAL] [PATCH v4 0/7] net/ena: release 2.13.0CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
Quoted 6 lines · On Wed, 28 May 2025 13:25:24 +0300 Shai Brandes <[email protected]> wrote:
This patchset includes an upgrade of the ENA HAL, introduces a new feature, and addresses three bug fixes.
Thank you in advance to the net maintainers and community members for your time and effort reviewing the code.
Quoted 6 lines
Quoted 3 lines
Best regards,
Shai Brandes
AWS Elastic Network Adapter teamCould you check against current main branch.
This no longer applies, either it already got merged or something changed.
Hi Stephen, the merge conflict occurred due to updates in the release notes after we initially uploaded the patchset. I've rebased the changes on top of origin/main and will submit a revised version shortly. I'll go ahead and abandon the previous set.
Just a quick note, we originally submitted the patchset over a month ago, and it has been in the "awaiting upstream" state since then. I noticed that rc2 has already been released.
we would greatly appreciate it if you could include the ENA changes in rc3.
ENA is a self-contained module, and the previous maintainer approved that mode of operation. Hopefully, an exception can be made in this case. Thanks again for your time and continued support.
Quoted 28 lines · Shai
Quoted 22 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Sunday, June 29, 2025 7:50 PM
To: Brandes, Shai <[email protected]>
Cc: [email protected]
Subject: RE: [EXTERNAL] [PATCH v4 0/7] net/ena: release 2.13.0CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
Quoted 6 lines · On Wed, 28 May 2025 13:25:24 +0300 Shai Brandes <[email protected]> wrote:
This patchset includes an upgrade of the ENA HAL, introduces a new feature, and addresses three bug fixes.
Thank you in advance to the net maintainers and community members for your time and effort reviewing the code.
Quoted 6 lines
Quoted 3 lines
Best regards,
Shai Brandes
AWS Elastic Network Adapter teamCould you check against current main branch.
This no longer applies, either it already got merged or something changed.
Quoted 8 lines
Hi Stephen, the merge conflict occurred due to updates in the release notes after we initially uploaded the patchset. I've rebased the changes on top of origin/main and will submit a revised version shortly. I'll go ahead and abandon the previous set.
Just a quick note, we originally submitted the patchset over a month ago, and it has been in the "awaiting upstream" state since then. I noticed that rc2 has already been released.
we would greatly appreciate it if you could include the ENA changes in rc3.
ENA is a self-contained module, and the previous maintainer approved that mode of operation. Hopefully, an exception can be made in this case. Thanks again for your time and continued support.
Thanks, that version got lost in the huge patchsets that were sitting in backlog.
Quoted 53 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Monday, June 30, 2025 5:55 PM
To: Brandes, Shai <[email protected]>
Cc: [email protected]
Subject: RE: [EXTERNAL] [PATCH v4 0/7] net/ena: release 2.13.0CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
Quoted 22 lines · Shai
Quoted 22 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Sunday, June 29, 2025 7:50 PM
To: Brandes, Shai <[email protected]>
Cc: [email protected]
Subject: RE: [EXTERNAL] [PATCH v4 0/7] net/ena: release 2.13.0CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
Quoted 6 lines · On Wed, 28 May 2025 13:25:24 +0300 Shai Brandes <[email protected]> wrote:
This patchset includes an upgrade of the ENA HAL, introduces a new feature, and addresses three bug fixes.
Thank you in advance to the net maintainers and community members for your time and effort reviewing the code.
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Best regards,
Shai Brandes
AWS Elastic Network Adapter teamCould you check against current main branch.
This no longer applies, either it already got merged or somethingchanged.
Quoted 1 line
Hi Stephen, the merge conflict occurred due to updates in the release notes
after we initially uploaded the patchset.
Quoted 1 line
I've rebased the changes on top of origin/main and will submit a revised
version shortly. I'll go ahead and abandon the previous set.
Quoted 2 lines
Just a quick note, we originally submitted the patchset over a month ago,
Quoted 8 lines
and it has been in the "awaiting upstream" state since then.
Quoted 3 lines
I noticed that rc2 has already been released.
we would greatly appreciate it if you could include the ENA changes in rc3. ENA is a self-contained module, and the previous maintainer approved thatmode of operation. Hopefully, an exception can be made in this case.
Quoted 1 line
Thanks again for your time and continued support.
Thanks, that version got lost in the huge patchsets that were sitting in backlog.
Hi Stephen, just wanted to touch base and confirm we're still on track to include the patchset in rc3. Let me know if there's anything you need from me to help move things forward. Thanks!