pdump: initialize snaplen if enabled by device id

Message ID 20211027180847.66572-1-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series pdump: initialize snaplen if enabled by device id |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional fail Functional Testing issues

Commit Message

Stephen Hemminger Oct. 27, 2021, 6:08 p.m. UTC
  If packet dump was enabled via pdump_enable_by_deviceid
the packet snapshot length was not being set.

Bugzilla ID: 840
Fixes: 10f726efe26c ("pdump: support pcapng and filtering")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/pdump/rte_pdump.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Stephen Hemminger Oct. 28, 2021, 5:21 p.m. UTC | #1
On Wed, 27 Oct 2021 11:08:47 -0700
Stephen Hemminger <stephen@networkplumber.org> wrote:

> If packet dump was enabled via pdump_enable_by_deviceid
> the packet snapshot length was not being set.
> 
> Bugzilla ID: 840
> Fixes: 10f726efe26c ("pdump: support pcapng and filtering")
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  lib/pdump/rte_pdump.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
> index 71602685d544..3086b2a1688b 100644
> --- a/lib/pdump/rte_pdump.c
> +++ b/lib/pdump/rte_pdump.c
> @@ -631,6 +631,9 @@ pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
>  	if (ret < 0)
>  		return ret;
>  
> +	if (snaplen == 0)
> +		snaplen = UINT32_MAX;
> +
>  	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
>  					    ENABLE, ring, mp, prm);
>  }

There appears to be bug in the CI system reporting bogus failure on
this patch.
  
Thomas Monjalon Oct. 31, 2021, 11:39 p.m. UTC | #2
27/10/2021 20:08, Stephen Hemminger:
> If packet dump was enabled via pdump_enable_by_deviceid
> the packet snapshot length was not being set.
> 
> Bugzilla ID: 840
> Fixes: 10f726efe26c ("pdump: support pcapng and filtering")
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Applied, thanks.
  

Patch

diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 71602685d544..3086b2a1688b 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -631,6 +631,9 @@  pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
+
 	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
 					    ENABLE, ring, mp, prm);
 }