[v2] app/pdump: exit if no device specified
Checks
Commit Message
Simpler version of earlier patch which had a good idea, was just
implemented with more code than necessary.
If no device is specified don't start the capture loop.
Reported-by: usman.tanveer <usman.tanveer@emumba.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/pdump/main.c | 3 +++
1 file changed, 3 insertions(+)
Comments
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
On 2023/7/1 10:16, Stephen Hemminger wrote:
> Simpler version of earlier patch which had a good idea, was just
> implemented with more code than necessary.
> If no device is specified don't start the capture loop.
>
> Reported-by: usman.tanveer <usman.tanveer@emumba.com>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> app/pdump/main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/app/pdump/main.c b/app/pdump/main.c
> index c94606275b28..7a1c7bdf6011 100644
> --- a/app/pdump/main.c
> +++ b/app/pdump/main.c
> @@ -915,6 +915,9 @@ dump_packets(void)
> int i;
> unsigned int lcore_id = 0;
>
> + if (num_tuples == 0)
> + rte_exit(EXIT_FAILURE, "No device specified for capture\n");
> +
> if (!multiple_core_capture) {
> printf(" core (%u), capture for (%d) tuples\n",
> rte_lcore_id(), num_tuples);
>
03/07/2023 08:29, fengchengwen:
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>
> On 2023/7/1 10:16, Stephen Hemminger wrote:
> > Simpler version of earlier patch which had a good idea, was just
> > implemented with more code than necessary.
> > If no device is specified don't start the capture loop.
> >
> > Reported-by: usman.tanveer <usman.tanveer@emumba.com>
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied, thanks.
@@ -915,6 +915,9 @@ dump_packets(void)
int i;
unsigned int lcore_id = 0;
+ if (num_tuples == 0)
+ rte_exit(EXIT_FAILURE, "No device specified for capture\n");
+
if (!multiple_core_capture) {
printf(" core (%u), capture for (%d) tuples\n",
rte_lcore_id(), num_tuples);