* [dpdk-stable] [PATCH v4 01/19] net/ena: switch memcpy to dpdk-optimized version
[not found] ` <20210511064554.10656-1-mk@semihalf.com>
@ 2021-05-11 6:45 ` Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 05/19] net/ena/base: fix issues from the static code scan Michal Krawczyk
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Michal Krawczyk @ 2021-05-11 6:45 UTC (permalink / raw)
To: ferruh.yigit
Cc: dev, ndagan, gtzalik, igorch, upstream, stable, Michal Krawczyk,
Artur Rojek
From: Igor Chauskin <igorch@amazon.com>
memcpy is now mapped to rte_memcpy macro on x86 architectures.
Fixes: 9ba7981ec992 ("ena: add communication layer for DPDK")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Artur Rojek <ar@semihalf.com>
---
v4:
* Add release notes
v2:
* Fix nested declaration of the rte_memcpy on arm64 architecture.
doc/guides/rel_notes/release_21_05.rst | 7 +++++++
drivers/net/ena/base/ena_plat_dpdk.h | 7 ++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst
index 30dec1c1d1..eb1107729a 100644
--- a/doc/guides/rel_notes/release_21_05.rst
+++ b/doc/guides/rel_notes/release_21_05.rst
@@ -202,6 +202,13 @@ New Features
Added packed ring support for async vhost.
+* **Updated Amazon ENA PMD.**
+
+ The new driver version (v2.3.0) introduces bug fixes and improvements,
+ including:
+
+ * Changed memcpy mapping to the dpdk-optimized version.
+
* **Added support of multiple data-units in cryptodev API.**
The cryptodev library has been enhanced to allow operations on multiple
diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h
index a1d749f83f..ae68f860a5 100644
--- a/drivers/net/ena/base/ena_plat_dpdk.h
+++ b/drivers/net/ena/base/ena_plat_dpdk.h
@@ -25,6 +25,7 @@
#include <rte_spinlock.h>
#include <sys/time.h>
+#include <rte_memcpy.h>
typedef uint64_t u64;
typedef uint32_t u32;
@@ -62,7 +63,11 @@ typedef uint64_t dma_addr_t;
#define ENA_UDELAY(x) rte_delay_us_block(x)
#define ENA_TOUCH(x) ((void)(x))
-#define memcpy_toio memcpy
+/* Avoid nested declaration on arm64, as it may define rte_memcpy as memcpy. */
+#if defined(RTE_ARCH_X86)
+#undef memcpy
+#define memcpy rte_memcpy
+#endif
#define wmb rte_wmb
#define rmb rte_rmb
#define mb rte_mb
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-stable] [PATCH v4 05/19] net/ena/base: fix issues from the static code scan
[not found] ` <20210511064554.10656-1-mk@semihalf.com>
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 01/19] net/ena: switch memcpy to dpdk-optimized version Michal Krawczyk
@ 2021-05-11 6:45 ` Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 06/19] net/ena/base: destroy multiple "wait events" Michal Krawczyk
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Michal Krawczyk @ 2021-05-11 6:45 UTC (permalink / raw)
To: ferruh.yigit
Cc: dev, ndagan, gtzalik, igorch, upstream, Michal Krawczyk, stable
To silence error messages from the static code analysis, make the type
conversions explicit where they're intended.
Also fix the type for the DMA width value.
Fixes: 99ecfbf845b3 ("ena: import communication layer")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
---
v4:
* Add stable dpdk as cc.
drivers/net/ena/base/ena_com.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c
index 9dc9f280c4..0cdeb1a2d9 100644
--- a/drivers/net/ena/base/ena_com.c
+++ b/drivers/net/ena/base/ena_com.c
@@ -1382,7 +1382,7 @@ int ena_com_execute_admin_command(struct ena_com_admin_queue *admin_queue,
"Failed to submit command [%ld]\n",
PTR_ERR(comp_ctx));
- return PTR_ERR(comp_ctx);
+ return (int)PTR_ERR(comp_ctx);
}
ret = ena_com_wait_and_process_admin_cq(comp_ctx, admin_queue);
@@ -1602,7 +1602,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag)
int ena_com_get_dma_width(struct ena_com_dev *ena_dev)
{
u32 caps = ena_com_reg_bar_read32(ena_dev, ENA_REGS_CAPS_OFF);
- int width;
+ u32 width;
if (unlikely(caps == ENA_MMIO_READ_TIMEOUT)) {
ena_trc_err(ena_dev, "Reg read timeout occurred\n");
@@ -2280,7 +2280,7 @@ int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, int mtu)
cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE;
cmd.aq_common_descriptor.flags = 0;
cmd.feat_common.feature_id = ENA_ADMIN_MTU;
- cmd.u.mtu.mtu = mtu;
+ cmd.u.mtu.mtu = (u32)mtu;
ret = ena_com_execute_admin_command(admin_queue,
(struct ena_admin_aq_entry *)&cmd,
@@ -2691,7 +2691,7 @@ int ena_com_indirect_table_set(struct ena_com_dev *ena_dev)
return ret;
}
- cmd.control_buffer.length = (1ULL << rss->tbl_log_size) *
+ cmd.control_buffer.length = (u32)(1ULL << rss->tbl_log_size) *
sizeof(struct ena_admin_rss_ind_table_entry);
ret = ena_com_execute_admin_command(admin_queue,
@@ -2713,7 +2713,7 @@ int ena_com_indirect_table_get(struct ena_com_dev *ena_dev, u32 *ind_tbl)
u32 tbl_size;
int i, rc;
- tbl_size = (1ULL << rss->tbl_log_size) *
+ tbl_size = (u32)(1ULL << rss->tbl_log_size) *
sizeof(struct ena_admin_rss_ind_table_entry);
rc = ena_com_get_feature_ex(ena_dev, &get_resp,
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-stable] [PATCH v4 06/19] net/ena/base: destroy multiple "wait events"
[not found] ` <20210511064554.10656-1-mk@semihalf.com>
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 01/19] net/ena: switch memcpy to dpdk-optimized version Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 05/19] net/ena/base: fix issues from the static code scan Michal Krawczyk
@ 2021-05-11 6:45 ` Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 11/19] net/ena: fix parsing of large LLQ header devarg Michal Krawczyk
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Michal Krawczyk @ 2021-05-11 6:45 UTC (permalink / raw)
To: ferruh.yigit
Cc: dev, ndagan, gtzalik, igorch, upstream, Michal Krawczyk, stable
Although the ENA DPDK PMD doesn't have to perform any actions for
destroying the wait event, some other platforms have to.
The macro "ENA_WAIT_EVENT_DESTROY" was renamed to
"ENA_WAIT_EVENTS_DESTROY" and also whole implementation responsible for
that was moved to a separate function for better readability.
Fixes: 3adcba9a8987 ("net/ena: update HAL to the newer version")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
---
v4:
* Revert changes to the "ENA_WAIT_EVENT_DESTROY".
* Change name of the argument of "ENA_WAIT_EVENTS_DESTROY" to the "admin_queue".
* Add stable dpdk as cc.
drivers/net/ena/base/ena_com.c | 24 +++++++++++++++++-------
drivers/net/ena/base/ena_plat_dpdk.h | 2 +-
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c
index 0cdeb1a2d9..d025c9cee1 100644
--- a/drivers/net/ena/base/ena_com.c
+++ b/drivers/net/ena/base/ena_com.c
@@ -1671,6 +1671,22 @@ int ena_com_validate_version(struct ena_com_dev *ena_dev)
return 0;
}
+static void
+ena_com_free_ena_admin_queue_comp_ctx(struct ena_com_dev *ena_dev,
+ struct ena_com_admin_queue *admin_queue)
+
+{
+ if (!admin_queue->comp_ctx)
+ return;
+
+ ENA_WAIT_EVENTS_DESTROY(admin_queue);
+ ENA_MEM_FREE(ena_dev->dmadev,
+ admin_queue->comp_ctx,
+ (admin_queue->q_depth * sizeof(struct ena_comp_ctx)));
+
+ admin_queue->comp_ctx = NULL;
+}
+
void ena_com_admin_destroy(struct ena_com_dev *ena_dev)
{
struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue;
@@ -1679,14 +1695,8 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev)
struct ena_com_aenq *aenq = &ena_dev->aenq;
u16 size;
- if (admin_queue->comp_ctx) {
- ENA_WAIT_EVENT_DESTROY(admin_queue->comp_ctx->wait_event);
- ENA_MEM_FREE(ena_dev->dmadev,
- admin_queue->comp_ctx,
- (admin_queue->q_depth * sizeof(struct ena_comp_ctx)));
- }
+ ena_com_free_ena_admin_queue_comp_ctx(ena_dev, admin_queue);
- admin_queue->comp_ctx = NULL;
size = ADMIN_SQ_SIZE(admin_queue->q_depth);
if (sq->entries)
ENA_MEM_FREE_COHERENT(ena_dev->dmadev, size, sq->entries,
diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h
index df2fdd30f6..ddf54f0ad5 100644
--- a/drivers/net/ena/base/ena_plat_dpdk.h
+++ b/drivers/net/ena/base/ena_plat_dpdk.h
@@ -299,7 +299,7 @@ extern rte_atomic32_t ena_alloc_cnt;
#define ENA_TIME_EXPIRE(timeout) (timeout < rte_get_timer_cycles())
#define ENA_GET_SYSTEM_TIMEOUT(timeout_us) \
(timeout_us * rte_get_timer_hz() / 1000000 + rte_get_timer_cycles())
-#define ENA_WAIT_EVENT_DESTROY(waitqueue) ((void)(waitqueue))
+#define ENA_WAIT_EVENTS_DESTROY(admin_queue) ((void)(admin_queue))
#ifndef READ_ONCE
#define READ_ONCE(var) (*((volatile typeof(var) *)(&(var))))
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-stable] [PATCH v4 11/19] net/ena: fix parsing of large LLQ header devarg
[not found] ` <20210511064554.10656-1-mk@semihalf.com>
` (2 preceding siblings ...)
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 06/19] net/ena/base: destroy multiple "wait events" Michal Krawczyk
@ 2021-05-11 6:45 ` Michal Krawczyk
2021-05-12 17:48 ` Thomas Monjalon
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 12/19] net/ena: terminate devargs allowed keys with null Michal Krawczyk
` (2 subsequent siblings)
6 siblings, 1 reply; 9+ messages in thread
From: Michal Krawczyk @ 2021-05-11 6:45 UTC (permalink / raw)
To: ferruh.yigit
Cc: dev, ndagan, gtzalik, igorch, upstream, stable, Shay Agroskin,
Michal Krawczyk
From: Igor Chauskin <igorch@amazon.com>
The code incorrectly checked the return value of comparison when parsing
the argument key name. The return value of strcmp should be compared
to 0 to identify a match.
Fixes: 8a7a73f26cc9 ("net/ena: support large LLQ headers")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
---
v4:
* Add release notes.
* Fix commit heading style.
doc/guides/rel_notes/release_21_05.rst | 1 +
drivers/net/ena/ena_ethdev.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst
index 6e4fcde1bc..755d5fcd32 100644
--- a/doc/guides/rel_notes/release_21_05.rst
+++ b/doc/guides/rel_notes/release_21_05.rst
@@ -209,6 +209,7 @@ New Features
* Changed memcpy mapping to the dpdk-optimized version.
* Updated ena_com (HAL) to the latest version.
+ * Fixed bugs when requesting large LLQ headers using the devargs.
* **Added support of multiple data-units in cryptodev API.**
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 3c9102cd19..cb8ad5c3d0 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2865,7 +2865,7 @@ static int ena_process_bool_devarg(const char *key,
}
/* Now, assign it to the proper adapter field. */
- if (strcmp(key, ENA_DEVARG_LARGE_LLQ_HDR))
+ if (strcmp(key, ENA_DEVARG_LARGE_LLQ_HDR) == 0)
adapter->use_large_llq_hdr = bool_value;
return 0;
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-stable] [PATCH v4 12/19] net/ena: terminate devargs allowed keys with null
[not found] ` <20210511064554.10656-1-mk@semihalf.com>
` (3 preceding siblings ...)
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 11/19] net/ena: fix parsing of large LLQ header devarg Michal Krawczyk
@ 2021-05-11 6:45 ` Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 13/19] net/ena: indicate Rx RSS hash presence Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 18/19] net/ena: report default ring size Michal Krawczyk
6 siblings, 0 replies; 9+ messages in thread
From: Michal Krawczyk @ 2021-05-11 6:45 UTC (permalink / raw)
To: ferruh.yigit
Cc: dev, ndagan, gtzalik, igorch, upstream, Michal Krawczyk, stable,
Shay Agroskin
As the documentation of rte_kvargs_parse() states, the valid_keys
argument must be NULL terminated. Lack of this feature may cause
segmentation fault if the passed devarg will be different then the
supported value.
Fixes: 8a7a73f26cc9 ("net/ena: support large LLQ headers")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v4:
* Fix commit heading style.
drivers/net/ena/ena_ethdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index cb8ad5c3d0..6092288239 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2876,6 +2876,7 @@ static int ena_parse_devargs(struct ena_adapter *adapter,
{
static const char * const allowed_args[] = {
ENA_DEVARG_LARGE_LLQ_HDR,
+ NULL,
};
struct rte_kvargs *kvlist;
int rc;
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-stable] [PATCH v4 13/19] net/ena: indicate Rx RSS hash presence
[not found] ` <20210511064554.10656-1-mk@semihalf.com>
` (4 preceding siblings ...)
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 12/19] net/ena: terminate devargs allowed keys with null Michal Krawczyk
@ 2021-05-11 6:45 ` Michal Krawczyk
2021-05-11 12:16 ` Ferruh Yigit
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 18/19] net/ena: report default ring size Michal Krawczyk
6 siblings, 1 reply; 9+ messages in thread
From: Michal Krawczyk @ 2021-05-11 6:45 UTC (permalink / raw)
To: ferruh.yigit
Cc: dev, ndagan, gtzalik, igorch, upstream, Michal Krawczyk, stable,
Amit Bernstein
To make it possible to the app to determine if the hash was calculated
for the packet or not, the PKT_RX_RSS_HASH should be set in the mbuf's
ol_flags.
As the PMD wasn't setting that, the application couldn't check if there
is a hash in a proper way.
The hash is valid only if it's UDP or TCP and the IP packet wasn't
fragmented.
Fixes: e5df9f33db00 ("net/ena: fix passing RSS hash to mbuf")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
---
v4:
* Add release notes.
* Always announce DEV_RX_OFFLOAD_RSS_HASH if RSS is enabled.
doc/guides/rel_notes/release_21_05.rst | 1 +
drivers/net/ena/ena_ethdev.c | 12 ++++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst
index 755d5fcd32..389a7a05ac 100644
--- a/doc/guides/rel_notes/release_21_05.rst
+++ b/doc/guides/rel_notes/release_21_05.rst
@@ -210,6 +210,7 @@ New Features
* Changed memcpy mapping to the dpdk-optimized version.
* Updated ena_com (HAL) to the latest version.
* Fixed bugs when requesting large LLQ headers using the devargs.
+ * Added indication of the RSS hash presence in the mbuf.
* **Added support of multiple data-units in cryptodev API.**
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 6092288239..9a43ab50fe 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -51,6 +51,8 @@
#define ENA_MIN_RING_DESC 128
+#define ENA_PTYPE_HAS_HASH (RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP)
+
enum ethtool_stringset {
ETH_SS_TEST = 0,
ETH_SS_STATS,
@@ -314,6 +316,11 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf,
else
ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+ if (likely((packet_type & ENA_PTYPE_HAS_HASH) && !ena_rx_ctx->frag)) {
+ ol_flags |= PKT_RX_RSS_HASH;
+ mbuf->hash.rss = ena_rx_ctx->hash;
+ }
+
mbuf->ol_flags = ol_flags;
mbuf->packet_type = packet_type;
}
@@ -1960,6 +1967,9 @@ static int ena_dev_configure(struct rte_eth_dev *dev)
adapter->state = ENA_ADAPTER_STATE_CONFIG;
+ if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
adapter->tx_selected_offloads = dev->data->dev_conf.txmode.offloads;
adapter->rx_selected_offloads = dev->data->dev_conf.rxmode.offloads;
return 0;
@@ -2245,8 +2255,6 @@ static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
++rx_ring->rx_stats.bad_csum;
}
- mbuf->hash.rss = ena_rx_ctx.hash;
-
rx_pkts[completed] = mbuf;
rx_ring->rx_stats.bytes += mbuf->pkt_len;
}
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-stable] [PATCH v4 18/19] net/ena: report default ring size
[not found] ` <20210511064554.10656-1-mk@semihalf.com>
` (5 preceding siblings ...)
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 13/19] net/ena: indicate Rx RSS hash presence Michal Krawczyk
@ 2021-05-11 6:45 ` Michal Krawczyk
6 siblings, 0 replies; 9+ messages in thread
From: Michal Krawczyk @ 2021-05-11 6:45 UTC (permalink / raw)
To: ferruh.yigit
Cc: dev, ndagan, gtzalik, igorch, upstream, Stanislaw Kardach,
stable, Michal Krawczyk, Shay Agroskin
From: Stanislaw Kardach <kda@semihalf.com>
Remove invalid ring size alignment logic and add default rx and tx port
ring sizes to the device info spec.
The logic in lines 1297 and 1371 is invalid. The
RTE_ETH_DEV_FALLBACK_RX_RINGSIZE (and the TX counterpart) is a value
that rte_eth_rx_queue_setup() will set if
dev_info.default_rxportconf.ring_size is 0 and user provided 0 in
nb_rx_desc argument. However the current code treats it as a hint for
the PMD to change the ring size to internal defaults.
Additionally since the ENA_DEFAULT_RING_SIZE is defined, report it in
the device capabilities so that both rte_ethdev code and the user can
utilize it for device configuration.
Fixes: ea93d37eb49d ("net/ena: add HW queues depth setup")
Cc: stable@dpdk.org
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
---
v4:
* Add release notes.
doc/guides/rel_notes/release_21_05.rst | 1 +
drivers/net/ena/ena_ethdev.c | 9 +++------
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst
index 389a7a05ac..f6c566f05c 100644
--- a/doc/guides/rel_notes/release_21_05.rst
+++ b/doc/guides/rel_notes/release_21_05.rst
@@ -211,6 +211,7 @@ New Features
* Updated ena_com (HAL) to the latest version.
* Fixed bugs when requesting large LLQ headers using the devargs.
* Added indication of the RSS hash presence in the mbuf.
+ * Fixed bug when the default ring size was set.
* **Added support of multiple data-units in cryptodev API.**
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 21bea98007..cb2c93052a 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1300,9 +1300,6 @@ static int ena_tx_queue_setup(struct rte_eth_dev *dev,
return -EINVAL;
}
- if (nb_desc == RTE_ETH_DEV_FALLBACK_TX_RINGSIZE)
- nb_desc = adapter->max_tx_ring_size;
-
txq->port_id = dev->data->port_id;
txq->next_to_clean = 0;
txq->next_to_use = 0;
@@ -1374,9 +1371,6 @@ static int ena_rx_queue_setup(struct rte_eth_dev *dev,
return ENA_COM_FAULT;
}
- if (nb_desc == RTE_ETH_DEV_FALLBACK_RX_RINGSIZE)
- nb_desc = adapter->max_rx_ring_size;
-
if (!rte_is_power_of_2(nb_desc)) {
PMD_DRV_LOG(ERR,
"Unsupported size of RX queue: %d is not a power of 2.\n",
@@ -2096,6 +2090,9 @@ static int ena_infos_get(struct rte_eth_dev *dev,
dev_info->tx_desc_lim.nb_mtu_seg_max = RTE_MIN(ENA_PKT_MAX_BUFS,
adapter->max_tx_sgl_size);
+ dev_info->default_rxportconf.ring_size = ENA_DEFAULT_RING_SIZE;
+ dev_info->default_txportconf.ring_size = ENA_DEFAULT_RING_SIZE;
+
return 0;
}
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-stable] [PATCH v4 13/19] net/ena: indicate Rx RSS hash presence
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 13/19] net/ena: indicate Rx RSS hash presence Michal Krawczyk
@ 2021-05-11 12:16 ` Ferruh Yigit
0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2021-05-11 12:16 UTC (permalink / raw)
To: Michal Krawczyk
Cc: dev, ndagan, gtzalik, igorch, upstream, stable, Amit Bernstein
On 5/11/2021 7:45 AM, Michal Krawczyk wrote:
> To make it possible to the app to determine if the hash was calculated
> for the packet or not, the PKT_RX_RSS_HASH should be set in the mbuf's
> ol_flags.
>
> As the PMD wasn't setting that, the application couldn't check if there
> is a hash in a proper way.
>
> The hash is valid only if it's UDP or TCP and the IP packet wasn't
> fragmented.
>
> Fixes: e5df9f33db00 ("net/ena: fix passing RSS hash to mbuf")
> Cc: stable@dpdk.org
>
> Signed-off-by: Michal Krawczyk <mk@semihalf.com>
> Reviewed-by: Igor Chauskin <igorch@amazon.com>
> Reviewed-by: Amit Bernstein <amitbern@amazon.com>
> ---
> v4:
> * Add release notes.
> * Always announce DEV_RX_OFFLOAD_RSS_HASH if RSS is enabled.
>
> doc/guides/rel_notes/release_21_05.rst | 1 +
> drivers/net/ena/ena_ethdev.c | 12 ++++++++++--
> 2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst
> index 755d5fcd32..389a7a05ac 100644
> --- a/doc/guides/rel_notes/release_21_05.rst
> +++ b/doc/guides/rel_notes/release_21_05.rst
> @@ -210,6 +210,7 @@ New Features
> * Changed memcpy mapping to the dpdk-optimized version.
> * Updated ena_com (HAL) to the latest version.
> * Fixed bugs when requesting large LLQ headers using the devargs.
> + * Added indication of the RSS hash presence in the mbuf.
>
> * **Added support of multiple data-units in cryptodev API.**
>
> diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
> index 6092288239..9a43ab50fe 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -51,6 +51,8 @@
>
> #define ENA_MIN_RING_DESC 128
>
> +#define ENA_PTYPE_HAS_HASH (RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP)
> +
> enum ethtool_stringset {
> ETH_SS_TEST = 0,
> ETH_SS_STATS,
> @@ -314,6 +316,11 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf,
> else
> ol_flags |= PKT_RX_L4_CKSUM_GOOD;
>
> + if (likely((packet_type & ENA_PTYPE_HAS_HASH) && !ena_rx_ctx->frag)) {
> + ol_flags |= PKT_RX_RSS_HASH;
> + mbuf->hash.rss = ena_rx_ctx->hash;
> + }
> +
> mbuf->ol_flags = ol_flags;
> mbuf->packet_type = packet_type;
> }
> @@ -1960,6 +1967,9 @@ static int ena_dev_configure(struct rte_eth_dev *dev)
>
> adapter->state = ENA_ADAPTER_STATE_CONFIG;
>
> + if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
> + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
Also need to advertise this offload in 'dev_info->rx_offload_capa'.
> adapter->tx_selected_offloads = dev->data->dev_conf.txmode.offloads;
> adapter->rx_selected_offloads = dev->data->dev_conf.rxmode.offloads;
> return 0;
> @@ -2245,8 +2255,6 @@ static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
> ++rx_ring->rx_stats.bad_csum;
> }
>
> - mbuf->hash.rss = ena_rx_ctx.hash;
> -
> rx_pkts[completed] = mbuf;
> rx_ring->rx_stats.bytes += mbuf->pkt_len;
> }
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-stable] [PATCH v4 11/19] net/ena: fix parsing of large LLQ header devarg
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 11/19] net/ena: fix parsing of large LLQ header devarg Michal Krawczyk
@ 2021-05-12 17:48 ` Thomas Monjalon
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2021-05-12 17:48 UTC (permalink / raw)
To: igorch, Shay Agroskin, Michal Krawczyk
Cc: ferruh.yigit, stable, dev, ndagan, gtzalik, upstream
11/05/2021 08:45, Michal Krawczyk:
> From: Igor Chauskin <igorch@amazon.com>
> --- a/doc/guides/rel_notes/release_21_05.rst
> +++ b/doc/guides/rel_notes/release_21_05.rst
> @@ -209,6 +209,7 @@ New Features
>
> * Changed memcpy mapping to the dpdk-optimized version.
> * Updated ena_com (HAL) to the latest version.
> + * Fixed bugs when requesting large LLQ headers using the devargs.
Until now, we don't mention fixed bugs in the "New Features"
of the release notes.
I'll drop this one and the next one for consistency.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-05-12 17:48 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <87e65a42-4ae5-1a81-8f8e-74759fc14999@intel.com>
[not found] ` <20210511064554.10656-1-mk@semihalf.com>
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 01/19] net/ena: switch memcpy to dpdk-optimized version Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 05/19] net/ena/base: fix issues from the static code scan Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 06/19] net/ena/base: destroy multiple "wait events" Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 11/19] net/ena: fix parsing of large LLQ header devarg Michal Krawczyk
2021-05-12 17:48 ` Thomas Monjalon
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 12/19] net/ena: terminate devargs allowed keys with null Michal Krawczyk
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 13/19] net/ena: indicate Rx RSS hash presence Michal Krawczyk
2021-05-11 12:16 ` Ferruh Yigit
2021-05-11 6:45 ` [dpdk-stable] [PATCH v4 18/19] net/ena: report default ring size Michal Krawczyk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).