DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: add the check for port and queue Rx/Tx offload
@ 2023-11-15 10:33 Huisong Li
  2023-11-15 12:50 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Huisong Li @ 2023-11-15 10:33 UTC (permalink / raw)
  To: dev, ferruh.yigit, Aman Singh, Yuying Zhang
  Cc: andrew.rybchenko, liuyonglong, lihuisong

This patch adds the check for port and per queue Rx/Tx offload to avoid the
failure of "port start all" when config a offload driver didn't support.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 app/test-pmd/cmdline.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index a231d112b0..c040de7a79 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -11186,6 +11186,11 @@ config_port_rx_offload(portid_t port_id, char *name, bool on)
 			fprintf(stderr, "Unknown offload name: %s\n", name);
 			return;
 		}
+		if ((offload & dev_info.rx_offload_capa) == 0) {
+			fprintf(stderr, "Error: port %u doesn't support offload: %s.\n",
+				port_id, name);
+			return;
+		}
 	}
 
 	nb_rx_queues = dev_info.nb_rx_queues;
@@ -11388,6 +11393,11 @@ cmd_config_per_queue_rx_offload_parsed(void *parsed_result,
 			fprintf(stderr, "Unknown offload name: %s\n", res->offload);
 			return;
 		}
+		if ((offload & dev_info.rx_queue_offload_capa) == 0) {
+			fprintf(stderr, "Error: port %u doesn't support per queue offload: %s.\n",
+				port_id, res->offload);
+			return;
+		}
 	}
 
 	if (!strcmp(res->on_off, "on"))
@@ -11698,6 +11708,11 @@ config_port_tx_offload(portid_t port_id, char *name, bool on)
 			fprintf(stderr, "Unknown offload name: %s\n", name);
 			return;
 		}
+		if ((offload & dev_info.tx_offload_capa) == 0) {
+			fprintf(stderr, "Error: port %u doesn't support offload: %s.\n",
+				port_id, name);
+			return;
+		}
 	}
 
 	nb_tx_queues = dev_info.nb_tx_queues;
@@ -11904,6 +11919,11 @@ cmd_config_per_queue_tx_offload_parsed(void *parsed_result,
 			fprintf(stderr, "Unknown offload name: %s\n", res->offload);
 			return;
 		}
+		if ((offload & dev_info.tx_queue_offload_capa) == 0) {
+			fprintf(stderr, "Error: port %u doesn't support per queue offload: %s.\n",
+				port_id, res->offload);
+			return;
+		}
 	}
 
 	if (!strcmp(res->on_off, "on"))
-- 
2.33.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] app/testpmd: add the check for port and queue Rx/Tx offload
  2023-11-15 10:33 [PATCH] app/testpmd: add the check for port and queue Rx/Tx offload Huisong Li
@ 2023-11-15 12:50 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2023-11-15 12:50 UTC (permalink / raw)
  To: Huisong Li, dev, Aman Singh, Yuying Zhang; +Cc: andrew.rybchenko, liuyonglong

On 11/15/2023 10:33 AM, Huisong Li wrote:
> This patch adds the check for port and per queue Rx/Tx offload to avoid the
> failure of "port start all" when config a offload driver didn't support.
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> 

Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>

Applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-15 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 10:33 [PATCH] app/testpmd: add the check for port and queue Rx/Tx offload Huisong Li
2023-11-15 12:50 ` Ferruh Yigit

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).