* [PATCH] pcapng: allow any protocol link type for the interface block
@ 2025-05-29 17:16 Schneide
2025-05-29 19:31 ` Stephen Hemminger
` (4 more replies)
0 siblings, 5 replies; 24+ messages in thread
From: Schneide @ 2025-05-29 17:16 UTC (permalink / raw)
To: Thomas Monjalon, Reshma Pattan, Stephen Hemminger, Jerin Jacob,
Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
Cc: dev, Dylan Schneider
From: Dylan Schneider <schneide@qti.qualcomm.com>
Allow the user to specify protocol link type when creating pcapng files.
This change is needed to specify the protocol type in the pcapng file,
DLT_EN10MB specifies ethernet packets only. This will allow dissectors
for other protocols to be used on files generated by pcapng.
Includes a breaking change to rte_pcapng_add_interface to add link_type
parameter. Existing calls to the function have been updated to pass
DLT_EN10MB for the link type argument.
Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: stephen@networkplumber.org
---
diff --git a/.mailmap b/.mailmap
index d9423aa..7ef0964 100644
--- a/.mailmap
+++ b/.mailmap
@@ -388,6 +388,7 @@
Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
Duncan Bellamy <dunk@denkimushi.com>
Dustin Lundquist <dustin@null-ptr.net>
+Dylan Schneider <schneide@qti.qualcomm.com>
Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Ed Czeck <ed.czeck@atomicrules.com>
Eduard Serra <eserra@vmware.com>
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0db..e0e2b26 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
free(os);
TAILQ_FOREACH(intf, &interfaces, next) {
- if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
- intf->ifdescr, intf->opts.filter) < 0)
+ if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
+ intf->ifname, intf->ifdescr, intf->opts.filter) < 0)
rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
intf->port);
}
diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
index 8f2cff3..bcf9972 100644
--- a/app/test/test_pcapng.c
+++ b/app/test/test_pcapng.c
@@ -345,7 +345,7 @@ test_add_interface(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
@@ -353,7 +353,7 @@ test_add_interface(void)
}
/* Add interface with ifname and ifdescr */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
"myeth", "Some long description", NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u with ifname\n", port_id);
@@ -361,7 +361,7 @@ test_add_interface(void)
}
/* Add interface with filter */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, "tcp port 8080");
if (ret < 0) {
fprintf(stderr, "can not add port %u with filter\n", port_id);
@@ -406,7 +406,7 @@ test_write_packets(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 89525f1..46fab8c 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -117,7 +117,7 @@ graph_pcap_file_open(const char *filename)
/* Add the configured interfaces as possible capture ports */
RTE_ETH_FOREACH_DEV(portid) {
- ret = rte_pcapng_add_interface(pcapng_fd, portid,
+ ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB
NULL, NULL, NULL);
if (ret < 0) {
graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index 16485b2..bed1e14 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -205,7 +205,7 @@ pcapng_section_block(rte_pcapng_t *self,
/* Write an interface block for a DPDK port */
RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter)
{
@@ -277,7 +277,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
hdr = (struct pcapng_interface_block *)buf;
*hdr = (struct pcapng_interface_block) {
.block_type = PCAPNG_INTERFACE_BLOCK,
- .link_type = 1, /* DLT_EN10MB - Ethernet */
+ .link_type = link_type,
.block_length = len,
};
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 48f2b57..0a35ec9 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
* The handle to the packet capture file
* @param port
* The Ethernet port to report stats on.
+ * @param link_type
+ * The protocol link type of the packets
* @param ifname (optional)
* Interface name to record in the file.
* If not specified, name will be constructed from port
@@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
* must be added.
*/
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter);
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] pcapng: allow any protocol link type for the interface block
2025-05-29 17:16 [PATCH] pcapng: allow any protocol link type for the interface block Schneide
@ 2025-05-29 19:31 ` Stephen Hemminger
2025-05-29 19:57 ` Stephen Hemminger
` (3 subsequent siblings)
4 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-05-29 19:31 UTC (permalink / raw)
To: Schneide
Cc: Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan, dev
[-- Attachment #1: Type: text/plain, Size: 6558 bytes --]
What other packet types would a DPDK app use. The possible type fields are
quite limited see the spec.
Plus it would be an ABI breakage would require versioning.
On Thu, May 29, 2025, 10:16 Schneide <schneide@qti.qualcomm.com> wrote:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
> ---
>
> diff --git a/.mailmap b/.mailmap
> index d9423aa..7ef0964 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -388,6 +388,7 @@
> Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
> Duncan Bellamy <dunk@denkimushi.com>
> Dustin Lundquist <dustin@null-ptr.net>
> +Dylan Schneider <schneide@qti.qualcomm.com>
> Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
> Ed Czeck <ed.czeck@atomicrules.com>
> Eduard Serra <eserra@vmware.com>
> diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
> index 3d3c0db..e0e2b26 100644
> --- a/app/dumpcap/main.c
> +++ b/app/dumpcap/main.c
> @@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
> free(os);
>
> TAILQ_FOREACH(intf, &interfaces, next) {
> - if (rte_pcapng_add_interface(ret.pcapng,
> intf->port, intf->ifname,
> - intf->ifdescr,
> intf->opts.filter) < 0)
> + if (rte_pcapng_add_interface(ret.pcapng,
> intf->port, DLT_EN10MB,
> + intf->ifname, intf->ifdescr,
> intf->opts.filter) < 0)
> rte_exit(EXIT_FAILURE,
> "rte_pcapng_add_interface %u failed\n",
> intf->port);
> }
> diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
> index 8f2cff3..bcf9972 100644
> --- a/app/test/test_pcapng.c
> +++ b/app/test/test_pcapng.c
> @@ -345,7 +345,7 @@ test_add_interface(void)
> }
>
> /* Add interface to the file */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u\n", port_id);
> @@ -353,7 +353,7 @@ test_add_interface(void)
> }
>
> /* Add interface with ifname and ifdescr */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> "myeth", "Some long description",
> NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u with ifname\n",
> port_id);
> @@ -361,7 +361,7 @@ test_add_interface(void)
> }
>
> /* Add interface with filter */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, "tcp port 8080");
> if (ret < 0) {
> fprintf(stderr, "can not add port %u with filter\n",
> port_id);
> @@ -406,7 +406,7 @@ test_write_packets(void)
> }
>
> /* Add interface to the file */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u\n", port_id);
> diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
> index 89525f1..46fab8c 100644
> --- a/lib/graph/graph_pcap.c
> +++ b/lib/graph/graph_pcap.c
> @@ -117,7 +117,7 @@ graph_pcap_file_open(const char *filename)
>
> /* Add the configured interfaces as possible capture ports */
> RTE_ETH_FOREACH_DEV(portid) {
> - ret = rte_pcapng_add_interface(pcapng_fd, portid,
> + ret = rte_pcapng_add_interface(pcapng_fd, portid,
> DLT_EN10MB
> NULL, NULL, NULL);
> if (ret < 0) {
> graph_err("Graph rte_pcapng_add_interface port %u
> failed: %d",
> diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
> index 16485b2..bed1e14 100644
> --- a/lib/pcapng/rte_pcapng.c
> +++ b/lib/pcapng/rte_pcapng.c
> @@ -205,7 +205,7 @@ pcapng_section_block(rte_pcapng_t *self,
> /* Write an interface block for a DPDK port */
> RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
> int
> -rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> +rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t
> link_type,
> const char *ifname, const char *ifdescr,
> const char *filter)
> {
> @@ -277,7 +277,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t
> port,
> hdr = (struct pcapng_interface_block *)buf;
> *hdr = (struct pcapng_interface_block) {
> .block_type = PCAPNG_INTERFACE_BLOCK,
> - .link_type = 1, /* DLT_EN10MB - Ethernet */
> + .link_type = link_type,
> .block_length = len,
> };
>
> diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
> index 48f2b57..0a35ec9 100644
> --- a/lib/pcapng/rte_pcapng.h
> +++ b/lib/pcapng/rte_pcapng.h
> @@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
> * The handle to the packet capture file
> * @param port
> * The Ethernet port to report stats on.
> + * @param link_type
> + * The protocol link type of the packets
> * @param ifname (optional)
> * Interface name to record in the file.
> * If not specified, name will be constructed from port
> @@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
> * must be added.
> */
> int
> -rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> +rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t
> link_type,
> const char *ifname, const char *ifdescr,
> const char *filter);
>
>
[-- Attachment #2: Type: text/html, Size: 8889 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] pcapng: allow any protocol link type for the interface block
2025-05-29 17:16 [PATCH] pcapng: allow any protocol link type for the interface block Schneide
2025-05-29 19:31 ` Stephen Hemminger
@ 2025-05-29 19:57 ` Stephen Hemminger
2025-06-05 23:02 ` [PATCH v2] " Schneide
` (2 subsequent siblings)
4 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-05-29 19:57 UTC (permalink / raw)
To: Schneide
Cc: Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan, dev
[-- Attachment #1: Type: text/plain, Size: 6461 bytes --]
Full list of types is here
https://www.tcpdump.org/linktypes.html
On Thu, May 29, 2025, 10:16 Schneide <schneide@qti.qualcomm.com> wrote:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
> ---
>
> diff --git a/.mailmap b/.mailmap
> index d9423aa..7ef0964 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -388,6 +388,7 @@
> Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
> Duncan Bellamy <dunk@denkimushi.com>
> Dustin Lundquist <dustin@null-ptr.net>
> +Dylan Schneider <schneide@qti.qualcomm.com>
> Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
> Ed Czeck <ed.czeck@atomicrules.com>
> Eduard Serra <eserra@vmware.com>
> diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
> index 3d3c0db..e0e2b26 100644
> --- a/app/dumpcap/main.c
> +++ b/app/dumpcap/main.c
> @@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
> free(os);
>
> TAILQ_FOREACH(intf, &interfaces, next) {
> - if (rte_pcapng_add_interface(ret.pcapng,
> intf->port, intf->ifname,
> - intf->ifdescr,
> intf->opts.filter) < 0)
> + if (rte_pcapng_add_interface(ret.pcapng,
> intf->port, DLT_EN10MB,
> + intf->ifname, intf->ifdescr,
> intf->opts.filter) < 0)
> rte_exit(EXIT_FAILURE,
> "rte_pcapng_add_interface %u failed\n",
> intf->port);
> }
> diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
> index 8f2cff3..bcf9972 100644
> --- a/app/test/test_pcapng.c
> +++ b/app/test/test_pcapng.c
> @@ -345,7 +345,7 @@ test_add_interface(void)
> }
>
> /* Add interface to the file */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u\n", port_id);
> @@ -353,7 +353,7 @@ test_add_interface(void)
> }
>
> /* Add interface with ifname and ifdescr */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> "myeth", "Some long description",
> NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u with ifname\n",
> port_id);
> @@ -361,7 +361,7 @@ test_add_interface(void)
> }
>
> /* Add interface with filter */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, "tcp port 8080");
> if (ret < 0) {
> fprintf(stderr, "can not add port %u with filter\n",
> port_id);
> @@ -406,7 +406,7 @@ test_write_packets(void)
> }
>
> /* Add interface to the file */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u\n", port_id);
> diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
> index 89525f1..46fab8c 100644
> --- a/lib/graph/graph_pcap.c
> +++ b/lib/graph/graph_pcap.c
> @@ -117,7 +117,7 @@ graph_pcap_file_open(const char *filename)
>
> /* Add the configured interfaces as possible capture ports */
> RTE_ETH_FOREACH_DEV(portid) {
> - ret = rte_pcapng_add_interface(pcapng_fd, portid,
> + ret = rte_pcapng_add_interface(pcapng_fd, portid,
> DLT_EN10MB
> NULL, NULL, NULL);
> if (ret < 0) {
> graph_err("Graph rte_pcapng_add_interface port %u
> failed: %d",
> diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
> index 16485b2..bed1e14 100644
> --- a/lib/pcapng/rte_pcapng.c
> +++ b/lib/pcapng/rte_pcapng.c
> @@ -205,7 +205,7 @@ pcapng_section_block(rte_pcapng_t *self,
> /* Write an interface block for a DPDK port */
> RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
> int
> -rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> +rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t
> link_type,
> const char *ifname, const char *ifdescr,
> const char *filter)
> {
> @@ -277,7 +277,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t
> port,
> hdr = (struct pcapng_interface_block *)buf;
> *hdr = (struct pcapng_interface_block) {
> .block_type = PCAPNG_INTERFACE_BLOCK,
> - .link_type = 1, /* DLT_EN10MB - Ethernet */
> + .link_type = link_type,
> .block_length = len,
> };
>
> diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
> index 48f2b57..0a35ec9 100644
> --- a/lib/pcapng/rte_pcapng.h
> +++ b/lib/pcapng/rte_pcapng.h
> @@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
> * The handle to the packet capture file
> * @param port
> * The Ethernet port to report stats on.
> + * @param link_type
> + * The protocol link type of the packets
> * @param ifname (optional)
> * Interface name to record in the file.
> * If not specified, name will be constructed from port
> @@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
> * must be added.
> */
> int
> -rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> +rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t
> link_type,
> const char *ifname, const char *ifdescr,
> const char *filter);
>
>
[-- Attachment #2: Type: text/html, Size: 8822 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-05-29 17:16 [PATCH] pcapng: allow any protocol link type for the interface block Schneide
2025-05-29 19:31 ` Stephen Hemminger
2025-05-29 19:57 ` Stephen Hemminger
@ 2025-06-05 23:02 ` Schneide
2025-06-06 15:13 ` Stephen Hemminger
2025-06-06 21:52 ` Schneide
2025-06-09 21:19 ` Schneide
4 siblings, 1 reply; 24+ messages in thread
From: Schneide @ 2025-06-05 23:02 UTC (permalink / raw)
To: dev, Thomas Monjalon, Reshma Pattan, Stephen Hemminger,
Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
Cc: Dylan Schneider
From: Dylan Schneider <schneide@qti.qualcomm.com>
Allow the user to specify protocol link type when creating pcapng files.
This change is needed to specify the protocol type in the pcapng file,
DLT_EN10MB specifies ethernet packets only. This will allow dissectors
for other protocols to be used on files generated by pcapng.
Includes a breaking change to rte_pcapng_add_interface to add link_type
parameter. Existing calls to the function have been updated to pass
DLT_EN10MB for the link type argument.
Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: stephen@networkplumber.org
---
.mailmap | 1 +
app/dumpcap/main.c | 4 ++--
app/test/test_pcapng.c | 8 ++++----
doc/guides/rel_notes/release_25_07.rst | 5 ++++-
lib/graph/graph_pcap.c | 4 +++-
lib/pcapng/rte_pcapng.c | 21 +++++++++++++++------
lib/pcapng/rte_pcapng.h | 4 +++-
7 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/.mailmap b/.mailmap
index 91e08f4a1f..a585124832 100644
--- a/.mailmap
+++ b/.mailmap
@@ -390,6 +390,7 @@ Dukai Yuan <dukaix.yuan@intel.com>
Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
Duncan Bellamy <dunk@denkimushi.com>
Dustin Lundquist <dustin@null-ptr.net>
+Dylan Schneider <schneide@qti.qualcomm.com>
Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Ed Czeck <ed.czeck@atomicrules.com>
Eduard Serra <eserra@vmware.com>
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0dbc66..e0e2b26269 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
free(os);
TAILQ_FOREACH(intf, &interfaces, next) {
- if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
- intf->ifdescr, intf->opts.filter) < 0)
+ if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
+ intf->ifname, intf->ifdescr, intf->opts.filter) < 0)
rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
intf->port);
}
diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
index 8f2cff36c3..bcf99724fa 100644
--- a/app/test/test_pcapng.c
+++ b/app/test/test_pcapng.c
@@ -345,7 +345,7 @@ test_add_interface(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
@@ -353,7 +353,7 @@ test_add_interface(void)
}
/* Add interface with ifname and ifdescr */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
"myeth", "Some long description", NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u with ifname\n", port_id);
@@ -361,7 +361,7 @@ test_add_interface(void)
}
/* Add interface with filter */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, "tcp port 8080");
if (ret < 0) {
fprintf(stderr, "can not add port %u with filter\n", port_id);
@@ -406,7 +406,7 @@ test_write_packets(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
index 6b070801de..2396c7b014 100644
--- a/doc/guides/rel_notes/release_25_07.rst
+++ b/doc/guides/rel_notes/release_25_07.rst
@@ -108,7 +108,10 @@ API Changes
This section is a comment. Do not overwrite or remove it.
Also, make sure to start the actual text at the margin.
=======================================================
-
+* pcapng: Changed the API for adding interfaces to include a link type argument.
+ The link type was previously hardcoded to the ethernet link type in the API.
+ This argument is added to ``rte_pcapng_add_interface``.
+ These functions are versioned to retain binary compatibility until the next LTS release.
ABI Changes
-----------
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 89525f1220..13d86b7a18 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -11,6 +11,8 @@
#include <rte_mbuf.h>
#include <rte_pcapng.h>
+#include <pcap/pcap.h>
+
#include "rte_graph_worker.h"
#include "graph_pcap_private.h"
@@ -117,7 +119,7 @@ graph_pcap_file_open(const char *filename)
/* Add the configured interfaces as possible capture ports */
RTE_ETH_FOREACH_DEV(portid) {
- ret = rte_pcapng_add_interface(pcapng_fd, portid,
+ ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index cacbefdc50..95c1a4d635 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -200,11 +200,10 @@ pcapng_section_block(rte_pcapng_t *self,
}
/* Write an interface block for a DPDK port */
-RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
-int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
- const char *ifname, const char *ifdescr,
- const char *filter)
+RTE_DEFAULT_SYMBOL(26, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port, uint16_t link_type,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
{
struct pcapng_interface_block *hdr;
struct rte_eth_dev_info dev_info;
@@ -274,7 +273,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
hdr = (struct pcapng_interface_block *)buf;
*hdr = (struct pcapng_interface_block) {
.block_type = PCAPNG_INTERFACE_BLOCK,
- .link_type = 1, /* DLT_EN10MB - Ethernet */
+ .link_type = link_type,
.block_length = len,
};
@@ -319,6 +318,16 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
return write(self->outfd, buf, len);
}
+RTE_VERSION_SYMBOL(25, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
+{
+ /* Call the new version with a default link_type (Ethernet) */
+ return rte_pcapng_add_interface(self, port, 1 /* DLT_EN10MB */,
+ ifname, ifdescr, filter);
+}
+
/*
* Write an Interface statistics block at the end of capture.
*/
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 48f2b57564..9880d415c4 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
* The handle to the packet capture file
* @param port
* The Ethernet port to report stats on.
+ * @param link_type
+ * The link type (e.g., DLT_EN10MB).
* @param ifname (optional)
* Interface name to record in the file.
* If not specified, name will be constructed from port
@@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
* must be added.
*/
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter);
--
2.27.0
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-05 23:02 ` [PATCH v2] " Schneide
@ 2025-06-06 15:13 ` Stephen Hemminger
0 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-06-06 15:13 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Thu, 5 Jun 2025 17:02:37 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
>
> +RTE_VERSION_SYMBOL(25, int, rte_pcapng_add_interface,
> + (rte_pcapng_t *self, uint16_t port,
> + const char *ifname, const char *ifdescr,
> + const char *filter))
> +{
> + /* Call the new version with a default link_type (Ethernet) */
> + return rte_pcapng_add_interface(self, port, 1 /* DLT_EN10MB */,
> + ifname, ifdescr, filter);
> +}
> +
You should be able to use the defined value directly here.
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-05-29 17:16 [PATCH] pcapng: allow any protocol link type for the interface block Schneide
` (2 preceding siblings ...)
2025-06-05 23:02 ` [PATCH v2] " Schneide
@ 2025-06-06 21:52 ` Schneide
2025-06-08 22:16 ` Stephen Hemminger
` (5 more replies)
2025-06-09 21:19 ` Schneide
4 siblings, 6 replies; 24+ messages in thread
From: Schneide @ 2025-06-06 21:52 UTC (permalink / raw)
To: dev, Thomas Monjalon, Reshma Pattan, Stephen Hemminger,
Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
Cc: Dylan Schneider
From: Dylan Schneider <schneide@qti.qualcomm.com>
Allow the user to specify protocol link type when creating pcapng files.
This change is needed to specify the protocol type in the pcapng file,
DLT_EN10MB specifies ethernet packets only. This will allow dissectors
for other protocols to be used on files generated by pcapng.
Includes a breaking change to rte_pcapng_add_interface to add link_type
parameter. Existing calls to the function have been updated to pass
DLT_EN10MB for the link type argument.
Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: stephen@networkplumber.org
---
.mailmap | 1 +
app/dumpcap/main.c | 4 ++--
app/test/test_pcapng.c | 8 ++++----
doc/guides/rel_notes/release_25_07.rst | 5 ++++-
lib/graph/graph_pcap.c | 4 +++-
lib/pcapng/meson.build | 2 ++
lib/pcapng/rte_pcapng.c | 21 +++++++++++++++------
lib/pcapng/rte_pcapng.h | 4 +++-
8 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/.mailmap b/.mailmap
index 91e08f4a1f..a585124832 100644
--- a/.mailmap
+++ b/.mailmap
@@ -390,6 +390,7 @@ Dukai Yuan <dukaix.yuan@intel.com>
Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
Duncan Bellamy <dunk@denkimushi.com>
Dustin Lundquist <dustin@null-ptr.net>
+Dylan Schneider <schneide@qti.qualcomm.com>
Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Ed Czeck <ed.czeck@atomicrules.com>
Eduard Serra <eserra@vmware.com>
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0dbc66..e0e2b26269 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
free(os);
TAILQ_FOREACH(intf, &interfaces, next) {
- if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
- intf->ifdescr, intf->opts.filter) < 0)
+ if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
+ intf->ifname, intf->ifdescr, intf->opts.filter) < 0)
rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
intf->port);
}
diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
index 8f2cff36c3..bcf99724fa 100644
--- a/app/test/test_pcapng.c
+++ b/app/test/test_pcapng.c
@@ -345,7 +345,7 @@ test_add_interface(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
@@ -353,7 +353,7 @@ test_add_interface(void)
}
/* Add interface with ifname and ifdescr */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
"myeth", "Some long description", NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u with ifname\n", port_id);
@@ -361,7 +361,7 @@ test_add_interface(void)
}
/* Add interface with filter */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, "tcp port 8080");
if (ret < 0) {
fprintf(stderr, "can not add port %u with filter\n", port_id);
@@ -406,7 +406,7 @@ test_write_packets(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
index 6b070801de..2396c7b014 100644
--- a/doc/guides/rel_notes/release_25_07.rst
+++ b/doc/guides/rel_notes/release_25_07.rst
@@ -108,7 +108,10 @@ API Changes
This section is a comment. Do not overwrite or remove it.
Also, make sure to start the actual text at the margin.
=======================================================
-
+* pcapng: Changed the API for adding interfaces to include a link type argument.
+ The link type was previously hardcoded to the ethernet link type in the API.
+ This argument is added to ``rte_pcapng_add_interface``.
+ These functions are versioned to retain binary compatibility until the next LTS release.
ABI Changes
-----------
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 89525f1220..13d86b7a18 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -11,6 +11,8 @@
#include <rte_mbuf.h>
#include <rte_pcapng.h>
+#include <pcap/pcap.h>
+
#include "rte_graph_worker.h"
#include "graph_pcap_private.h"
@@ -117,7 +119,7 @@ graph_pcap_file_open(const char *filename)
/* Add the configured interfaces as possible capture ports */
RTE_ETH_FOREACH_DEV(portid) {
- ret = rte_pcapng_add_interface(pcapng_fd, portid,
+ ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
diff --git a/lib/pcapng/meson.build b/lib/pcapng/meson.build
index 4549925d41..3aa7ba5155 100644
--- a/lib/pcapng/meson.build
+++ b/lib/pcapng/meson.build
@@ -5,3 +5,5 @@ sources = files('rte_pcapng.c')
headers = files('rte_pcapng.h')
deps += ['ethdev']
+
+use_function_versioning = true
diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index cacbefdc50..f18af25983 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -200,11 +200,10 @@ pcapng_section_block(rte_pcapng_t *self,
}
/* Write an interface block for a DPDK port */
-RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
-int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
- const char *ifname, const char *ifdescr,
- const char *filter)
+RTE_DEFAULT_SYMBOL(26, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port, uint16_t link_type,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
{
struct pcapng_interface_block *hdr;
struct rte_eth_dev_info dev_info;
@@ -274,7 +273,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
hdr = (struct pcapng_interface_block *)buf;
*hdr = (struct pcapng_interface_block) {
.block_type = PCAPNG_INTERFACE_BLOCK,
- .link_type = 1, /* DLT_EN10MB - Ethernet */
+ .link_type = link_type,
.block_length = len,
};
@@ -319,6 +318,16 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
return write(self->outfd, buf, len);
}
+RTE_VERSION_SYMBOL(25, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
+{
+ /* Call the new version with a default link_type (Ethernet) */
+ return rte_pcapng_add_interface(self, port, DLT_EN10MB,
+ ifname, ifdescr, filter);
+}
+
/*
* Write an Interface statistics block at the end of capture.
*/
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 48f2b57564..9880d415c4 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
* The handle to the packet capture file
* @param port
* The Ethernet port to report stats on.
+ * @param link_type
+ * The link type (e.g., DLT_EN10MB).
* @param ifname (optional)
* Interface name to record in the file.
* If not specified, name will be constructed from port
@@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
* must be added.
*/
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter);
--
2.27.0
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-06 21:52 ` Schneide
@ 2025-06-08 22:16 ` Stephen Hemminger
2025-06-08 22:19 ` Stephen Hemminger
` (4 subsequent siblings)
5 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-06-08 22:16 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Fri, 6 Jun 2025 15:52:08 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> +RTE_VERSION_SYMBOL(25, int, rte_pcapng_add_interface,
> + (rte_pcapng_t *self, uint16_t port,
> + const char *ifname, const char *ifdescr,
> + const char *filter))
> +{
> + /* Call the new version with a default link_type (Ethernet) */
> + return rte_pcapng_add_interface(self, port, DLT_EN10MB,
> + ifname, ifdescr, filter);
> +}
> +
Indentation here is wonky, will fix on merge.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-06 21:52 ` Schneide
2025-06-08 22:16 ` Stephen Hemminger
@ 2025-06-08 22:19 ` Stephen Hemminger
2025-06-08 22:23 ` Stephen Hemminger
` (3 subsequent siblings)
5 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-06-08 22:19 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Fri, 6 Jun 2025 15:52:08 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
> index 48f2b57564..9880d415c4 100644
> --- a/lib/pcapng/rte_pcapng.h
> +++ b/lib/pcapng/rte_pcapng.h
> @@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
> * The handle to the packet capture file
> * @param port
> * The Ethernet port to report stats on.
> + * @param link_type
> + * The link type (e.g., DLT_EN10MB)
Emacs shows use of tab in the doc book comment, which is wrong.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-06 21:52 ` Schneide
2025-06-08 22:16 ` Stephen Hemminger
2025-06-08 22:19 ` Stephen Hemminger
@ 2025-06-08 22:23 ` Stephen Hemminger
2025-06-08 22:30 ` Stephen Hemminger
` (2 subsequent siblings)
5 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-06-08 22:23 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Fri, 6 Jun 2025 15:52:08 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
$ ninja -C build doc
ninja: Entering directory `build'
[5/6] Generating doc/guides/html_guides with a custom command
release_25_07.rst:141: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-06 21:52 ` Schneide
` (2 preceding siblings ...)
2025-06-08 22:23 ` Stephen Hemminger
@ 2025-06-08 22:30 ` Stephen Hemminger
2025-06-08 22:34 ` Stephen Hemminger
2025-06-16 14:29 ` Dylan Schneider
5 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-06-08 22:30 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Fri, 6 Jun 2025 15:52:08 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
Applied to next-net with some whitespace fixes (see previous comments).
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-06 21:52 ` Schneide
` (3 preceding siblings ...)
2025-06-08 22:30 ` Stephen Hemminger
@ 2025-06-08 22:34 ` Stephen Hemminger
2025-06-09 15:51 ` Dylan Schneider
2025-06-16 14:29 ` Dylan Schneider
5 siblings, 1 reply; 24+ messages in thread
From: Stephen Hemminger @ 2025-06-08 22:34 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Fri, 6 Jun 2025 15:52:08 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
> ---
> .mailmap | 1 +
> app/dumpcap/main.c | 4 ++--
> app/test/test_pcapng.c | 8 ++++----
> doc/guides/rel_notes/release_25_07.rst | 5 ++++-
> lib/graph/graph_pcap.c | 4 +++-
> lib/pcapng/meson.build | 2 ++
> lib/pcapng/rte_pcapng.c | 21 +++++++++++++++------
> lib/pcapng/rte_pcapng.h | 4 +++-
> 8 files changed, 34 insertions(+), 15 deletions(-)
>
> diff --git a/.mailmap b/.mailmap
> index 91e08f4a1f..a585124832 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -390,6 +390,7 @@ Dukai Yuan <dukaix.yuan@intel.com>
> Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
> Duncan Bellamy <dunk@denkimushi.com>
> Dustin Lundquist <dustin@null-ptr.net>
> +Dylan Schneider <schneide@qti.qualcomm.com>
> Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
> Ed Czeck <ed.czeck@atomicrules.com>
> Eduard Serra <eserra@vmware.com>
> diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
> index 3d3c0dbc66..e0e2b26269 100644
> --- a/app/dumpcap/main.c
> +++ b/app/dumpcap/main.c
> @@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
> free(os);
>
> TAILQ_FOREACH(intf, &interfaces, next) {
> - if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
> - intf->ifdescr, intf->opts.filter) < 0)
> + if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
> + intf->ifname, intf->ifdescr, intf->opts.filter) < 0)
> rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
> intf->port);
> }
> diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
> index 8f2cff36c3..bcf99724fa 100644
> --- a/app/test/test_pcapng.c
> +++ b/app/test/test_pcapng.c
> @@ -345,7 +345,7 @@ test_add_interface(void)
> }
>
> /* Add interface to the file */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u\n", port_id);
> @@ -353,7 +353,7 @@ test_add_interface(void)
> }
>
> /* Add interface with ifname and ifdescr */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> "myeth", "Some long description", NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u with ifname\n", port_id);
> @@ -361,7 +361,7 @@ test_add_interface(void)
> }
>
> /* Add interface with filter */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, "tcp port 8080");
> if (ret < 0) {
> fprintf(stderr, "can not add port %u with filter\n", port_id);
> @@ -406,7 +406,7 @@ test_write_packets(void)
> }
>
> /* Add interface to the file */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u\n", port_id);
> diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
> index 6b070801de..2396c7b014 100644
> --- a/doc/guides/rel_notes/release_25_07.rst
> +++ b/doc/guides/rel_notes/release_25_07.rst
> @@ -108,7 +108,10 @@ API Changes
> This section is a comment. Do not overwrite or remove it.
> Also, make sure to start the actual text at the margin.
> =======================================================
> -
> +* pcapng: Changed the API for adding interfaces to include a link type argument.
> + The link type was previously hardcoded to the ethernet link type in the API.
> + This argument is added to ``rte_pcapng_add_interface``.
> + These functions are versioned to retain binary compatibility until the next LTS release.
>
> ABI Changes
> -----------
> diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
> index 89525f1220..13d86b7a18 100644
> --- a/lib/graph/graph_pcap.c
> +++ b/lib/graph/graph_pcap.c
> @@ -11,6 +11,8 @@
> #include <rte_mbuf.h>
> #include <rte_pcapng.h>
>
> +#include <pcap/pcap.h>
> +
> #include "rte_graph_worker.h"
>
> #include "graph_pcap_private.h"
> @@ -117,7 +119,7 @@ graph_pcap_file_open(const char *filename)
>
> /* Add the configured interfaces as possible capture ports */
> RTE_ETH_FOREACH_DEV(portid) {
> - ret = rte_pcapng_add_interface(pcapng_fd, portid,
> + ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
> diff --git a/lib/pcapng/meson.build b/lib/pcapng/meson.build
> index 4549925d41..3aa7ba5155 100644
> --- a/lib/pcapng/meson.build
> +++ b/lib/pcapng/meson.build
> @@ -5,3 +5,5 @@ sources = files('rte_pcapng.c')
> headers = files('rte_pcapng.h')
>
> deps += ['ethdev']
> +
> +use_function_versioning = true
> diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
> index cacbefdc50..f18af25983 100644
> --- a/lib/pcapng/rte_pcapng.c
> +++ b/lib/pcapng/rte_pcapng.c
> @@ -200,11 +200,10 @@ pcapng_section_block(rte_pcapng_t *self,
> }
>
> /* Write an interface block for a DPDK port */
> -RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
> -int
> -rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> - const char *ifname, const char *ifdescr,
> - const char *filter)
> +RTE_DEFAULT_SYMBOL(26, int, rte_pcapng_add_interface,
> + (rte_pcapng_t *self, uint16_t port, uint16_t link_type,
> + const char *ifname, const char *ifdescr,
> + const char *filter))
> {
> struct pcapng_interface_block *hdr;
> struct rte_eth_dev_info dev_info;
> @@ -274,7 +273,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> hdr = (struct pcapng_interface_block *)buf;
> *hdr = (struct pcapng_interface_block) {
> .block_type = PCAPNG_INTERFACE_BLOCK,
> - .link_type = 1, /* DLT_EN10MB - Ethernet */
> + .link_type = link_type,
> .block_length = len,
> };
>
> @@ -319,6 +318,16 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> return write(self->outfd, buf, len);
> }
>
> +RTE_VERSION_SYMBOL(25, int, rte_pcapng_add_interface,
> + (rte_pcapng_t *self, uint16_t port,
> + const char *ifname, const char *ifdescr,
> + const char *filter))
> +{
> + /* Call the new version with a default link_type (Ethernet) */
> + return rte_pcapng_add_interface(self, port, DLT_EN10MB,
> + ifname, ifdescr, filter);
> +}
> +
> /*
> * Write an Interface statistics block at the end of capture.
> */
> diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
> index 48f2b57564..9880d415c4 100644
> --- a/lib/pcapng/rte_pcapng.h
> +++ b/lib/pcapng/rte_pcapng.h
> @@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
> * The handle to the packet capture file
> * @param port
> * The Ethernet port to report stats on.
> + * @param link_type
> + * The link type (e.g., DLT_EN10MB).
> * @param ifname (optional)
> * Interface name to record in the file.
> * If not specified, name will be constructed from port
> @@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
> * must be added.
> */
> int
> -rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> +rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
> const char *ifname, const char *ifdescr,
> const char *filter);
>
Build is failing, DLT_EN10MB is not available in all configs.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-08 22:34 ` Stephen Hemminger
@ 2025-06-09 15:51 ` Dylan Schneider
2025-06-09 16:24 ` Stephen Hemminger
0 siblings, 1 reply; 24+ messages in thread
From: Dylan Schneider @ 2025-06-09 15:51 UTC (permalink / raw)
To: Stephen Hemminger
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
[-- Attachment #1: Type: text/plain, Size: 10177 bytes --]
Hey Stephen,
In this case, is it best to just pass 1 with a comment saying that is DLT_EN10MB? Or is there a way we can get it defined in all configs?
________________________________
From: Stephen Hemminger <stephen@networkplumber.org>
Sent: Sunday, June 8, 2025 4:34 PM
To: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: dev@dpdk.org <dev@dpdk.org>; Thomas Monjalon <thomas@monjalon.net>; Reshma Pattan <reshma.pattan@intel.com>; Jerin Jacob <jerinj@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
Subject: Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
On Fri, 6 Jun 2025 15:52:08 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
> ---
> .mailmap | 1 +
> app/dumpcap/main.c | 4 ++--
> app/test/test_pcapng.c | 8 ++++----
> doc/guides/rel_notes/release_25_07.rst | 5 ++++-
> lib/graph/graph_pcap.c | 4 +++-
> lib/pcapng/meson.build | 2 ++
> lib/pcapng/rte_pcapng.c | 21 +++++++++++++++------
> lib/pcapng/rte_pcapng.h | 4 +++-
> 8 files changed, 34 insertions(+), 15 deletions(-)
>
> diff --git a/.mailmap b/.mailmap
> index 91e08f4a1f..a585124832 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -390,6 +390,7 @@ Dukai Yuan <dukaix.yuan@intel.com>
> Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
> Duncan Bellamy <dunk@denkimushi.com>
> Dustin Lundquist <dustin@null-ptr.net>
> +Dylan Schneider <schneide@qti.qualcomm.com>
> Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
> Ed Czeck <ed.czeck@atomicrules.com>
> Eduard Serra <eserra@vmware.com>
> diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
> index 3d3c0dbc66..e0e2b26269 100644
> --- a/app/dumpcap/main.c
> +++ b/app/dumpcap/main.c
> @@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
> free(os);
>
> TAILQ_FOREACH(intf, &interfaces, next) {
> - if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
> - intf->ifdescr, intf->opts.filter) < 0)
> + if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
> + intf->ifname, intf->ifdescr, intf->opts.filter) < 0)
> rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
> intf->port);
> }
> diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
> index 8f2cff36c3..bcf99724fa 100644
> --- a/app/test/test_pcapng.c
> +++ b/app/test/test_pcapng.c
> @@ -345,7 +345,7 @@ test_add_interface(void)
> }
>
> /* Add interface to the file */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u\n", port_id);
> @@ -353,7 +353,7 @@ test_add_interface(void)
> }
>
> /* Add interface with ifname and ifdescr */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> "myeth", "Some long description", NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u with ifname\n", port_id);
> @@ -361,7 +361,7 @@ test_add_interface(void)
> }
>
> /* Add interface with filter */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, "tcp port 8080");
> if (ret < 0) {
> fprintf(stderr, "can not add port %u with filter\n", port_id);
> @@ -406,7 +406,7 @@ test_write_packets(void)
> }
>
> /* Add interface to the file */
> - ret = rte_pcapng_add_interface(pcapng, port_id,
> + ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> fprintf(stderr, "can not add port %u\n", port_id);
> diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
> index 6b070801de..2396c7b014 100644
> --- a/doc/guides/rel_notes/release_25_07.rst
> +++ b/doc/guides/rel_notes/release_25_07.rst
> @@ -108,7 +108,10 @@ API Changes
> This section is a comment. Do not overwrite or remove it.
> Also, make sure to start the actual text at the margin.
> =======================================================
> -
> +* pcapng: Changed the API for adding interfaces to include a link type argument.
> + The link type was previously hardcoded to the ethernet link type in the API.
> + This argument is added to ``rte_pcapng_add_interface``.
> + These functions are versioned to retain binary compatibility until the next LTS release.
>
> ABI Changes
> -----------
> diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
> index 89525f1220..13d86b7a18 100644
> --- a/lib/graph/graph_pcap.c
> +++ b/lib/graph/graph_pcap.c
> @@ -11,6 +11,8 @@
> #include <rte_mbuf.h>
> #include <rte_pcapng.h>
>
> +#include <pcap/pcap.h>
> +
> #include "rte_graph_worker.h"
>
> #include "graph_pcap_private.h"
> @@ -117,7 +119,7 @@ graph_pcap_file_open(const char *filename)
>
> /* Add the configured interfaces as possible capture ports */
> RTE_ETH_FOREACH_DEV(portid) {
> - ret = rte_pcapng_add_interface(pcapng_fd, portid,
> + ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB,
> NULL, NULL, NULL);
> if (ret < 0) {
> graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
> diff --git a/lib/pcapng/meson.build b/lib/pcapng/meson.build
> index 4549925d41..3aa7ba5155 100644
> --- a/lib/pcapng/meson.build
> +++ b/lib/pcapng/meson.build
> @@ -5,3 +5,5 @@ sources = files('rte_pcapng.c')
> headers = files('rte_pcapng.h')
>
> deps += ['ethdev']
> +
> +use_function_versioning = true
> diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
> index cacbefdc50..f18af25983 100644
> --- a/lib/pcapng/rte_pcapng.c
> +++ b/lib/pcapng/rte_pcapng.c
> @@ -200,11 +200,10 @@ pcapng_section_block(rte_pcapng_t *self,
> }
>
> /* Write an interface block for a DPDK port */
> -RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
> -int
> -rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> - const char *ifname, const char *ifdescr,
> - const char *filter)
> +RTE_DEFAULT_SYMBOL(26, int, rte_pcapng_add_interface,
> + (rte_pcapng_t *self, uint16_t port, uint16_t link_type,
> + const char *ifname, const char *ifdescr,
> + const char *filter))
> {
> struct pcapng_interface_block *hdr;
> struct rte_eth_dev_info dev_info;
> @@ -274,7 +273,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> hdr = (struct pcapng_interface_block *)buf;
> *hdr = (struct pcapng_interface_block) {
> .block_type = PCAPNG_INTERFACE_BLOCK,
> - .link_type = 1, /* DLT_EN10MB - Ethernet */
> + .link_type = link_type,
> .block_length = len,
> };
>
> @@ -319,6 +318,16 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> return write(self->outfd, buf, len);
> }
>
> +RTE_VERSION_SYMBOL(25, int, rte_pcapng_add_interface,
> + (rte_pcapng_t *self, uint16_t port,
> + const char *ifname, const char *ifdescr,
> + const char *filter))
> +{
> + /* Call the new version with a default link_type (Ethernet) */
> + return rte_pcapng_add_interface(self, port, DLT_EN10MB,
> + ifname, ifdescr, filter);
> +}
> +
> /*
> * Write an Interface statistics block at the end of capture.
> */
> diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
> index 48f2b57564..9880d415c4 100644
> --- a/lib/pcapng/rte_pcapng.h
> +++ b/lib/pcapng/rte_pcapng.h
> @@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
> * The handle to the packet capture file
> * @param port
> * The Ethernet port to report stats on.
> + * @param link_type
> + * The link type (e.g., DLT_EN10MB).
> * @param ifname (optional)
> * Interface name to record in the file.
> * If not specified, name will be constructed from port
> @@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
> * must be added.
> */
> int
> -rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> +rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
> const char *ifname, const char *ifdescr,
> const char *filter);
>
Build is failing, DLT_EN10MB is not available in all configs.
[-- Attachment #2: Type: text/html, Size: 19274 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-09 15:51 ` Dylan Schneider
@ 2025-06-09 16:24 ` Stephen Hemminger
0 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-06-09 16:24 UTC (permalink / raw)
To: Dylan Schneider
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Mon, 9 Jun 2025 15:51:03 +0000
Dylan Schneider <schneide@qti.qualcomm.com> wrote:
> In this case, is it best to just pass 1 with a comment saying that is DLT_EN10MB? Or is there a way we can get it defined in all configs?
Just add a dependency on libpcap like other places do (see pcap PMD)
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-05-29 17:16 [PATCH] pcapng: allow any protocol link type for the interface block Schneide
` (3 preceding siblings ...)
2025-06-06 21:52 ` Schneide
@ 2025-06-09 21:19 ` Schneide
2025-06-16 18:05 ` Stephen Hemminger
` (3 more replies)
4 siblings, 4 replies; 24+ messages in thread
From: Schneide @ 2025-06-09 21:19 UTC (permalink / raw)
To: dev, Thomas Monjalon, Reshma Pattan, Stephen Hemminger,
Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
Cc: Dylan Schneider
From: Dylan Schneider <schneide@qti.qualcomm.com>
Allow the user to specify protocol link type when creating pcapng files.
This change is needed to specify the protocol type in the pcapng file,
DLT_EN10MB specifies ethernet packets only. This will allow dissectors
for other protocols to be used on files generated by pcapng.
Includes a breaking change to rte_pcapng_add_interface to add link_type
parameter. Existing calls to the function have been updated to pass
DLT_EN10MB for the link type argument.
Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: stephen@networkplumber.org
---
.mailmap | 1 +
app/dumpcap/main.c | 4 ++--
app/test/test_pcapng.c | 8 ++++----
doc/guides/rel_notes/release_25_07.rst | 4 ++++
lib/graph/graph_pcap.c | 4 +++-
lib/pcapng/meson.build | 7 +++++++
lib/pcapng/rte_pcapng.c | 22 ++++++++++++++++------
lib/pcapng/rte_pcapng.h | 4 +++-
8 files changed, 40 insertions(+), 14 deletions(-)
diff --git a/.mailmap b/.mailmap
index 91e08f4a1f..a585124832 100644
--- a/.mailmap
+++ b/.mailmap
@@ -390,6 +390,7 @@ Dukai Yuan <dukaix.yuan@intel.com>
Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
Duncan Bellamy <dunk@denkimushi.com>
Dustin Lundquist <dustin@null-ptr.net>
+Dylan Schneider <schneide@qti.qualcomm.com>
Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Ed Czeck <ed.czeck@atomicrules.com>
Eduard Serra <eserra@vmware.com>
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0dbc66..e0e2b26269 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
free(os);
TAILQ_FOREACH(intf, &interfaces, next) {
- if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
- intf->ifdescr, intf->opts.filter) < 0)
+ if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
+ intf->ifname, intf->ifdescr, intf->opts.filter) < 0)
rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
intf->port);
}
diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
index 8f2cff36c3..bcf99724fa 100644
--- a/app/test/test_pcapng.c
+++ b/app/test/test_pcapng.c
@@ -345,7 +345,7 @@ test_add_interface(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
@@ -353,7 +353,7 @@ test_add_interface(void)
}
/* Add interface with ifname and ifdescr */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
"myeth", "Some long description", NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u with ifname\n", port_id);
@@ -361,7 +361,7 @@ test_add_interface(void)
}
/* Add interface with filter */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, "tcp port 8080");
if (ret < 0) {
fprintf(stderr, "can not add port %u with filter\n", port_id);
@@ -406,7 +406,7 @@ test_write_packets(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
index 6b070801de..5f8a472928 100644
--- a/doc/guides/rel_notes/release_25_07.rst
+++ b/doc/guides/rel_notes/release_25_07.rst
@@ -109,6 +109,10 @@ API Changes
Also, make sure to start the actual text at the margin.
=======================================================
+* pcapng: Changed the API for adding interfaces to include a link type argument.
+ The link type was previously hardcoded to the ethernet link type in the API.
+ This argument is added to ``rte_pcapng_add_interface``.
+ These functions are versioned to retain binary compatibility until the next LTS release.
ABI Changes
-----------
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 89525f1220..13d86b7a18 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -11,6 +11,8 @@
#include <rte_mbuf.h>
#include <rte_pcapng.h>
+#include <pcap/pcap.h>
+
#include "rte_graph_worker.h"
#include "graph_pcap_private.h"
@@ -117,7 +119,7 @@ graph_pcap_file_open(const char *filename)
/* Add the configured interfaces as possible capture ports */
RTE_ETH_FOREACH_DEV(portid) {
- ret = rte_pcapng_add_interface(pcapng_fd, portid,
+ ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
diff --git a/lib/pcapng/meson.build b/lib/pcapng/meson.build
index 4549925d41..d1ace87feb 100644
--- a/lib/pcapng/meson.build
+++ b/lib/pcapng/meson.build
@@ -1,7 +1,14 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2019 Microsoft Corporation
+if not dpdk_conf.has('RTE_HAS_LIBPCAP')
+ build = false
+ reason = 'missing dependency, "libpcap"'
+endif
+
sources = files('rte_pcapng.c')
headers = files('rte_pcapng.h')
deps += ['ethdev']
+
+use_function_versioning = true
diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index cacbefdc50..9db8813696 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -29,6 +29,7 @@
#include <rte_reciprocal.h>
#include <rte_time.h>
+#include "pcap/dlt.h"
#include "pcapng_proto.h"
/* conversion from DPDK speed to PCAPNG */
@@ -200,11 +201,10 @@ pcapng_section_block(rte_pcapng_t *self,
}
/* Write an interface block for a DPDK port */
-RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
-int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
- const char *ifname, const char *ifdescr,
- const char *filter)
+RTE_DEFAULT_SYMBOL(26, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port, uint16_t link_type,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
{
struct pcapng_interface_block *hdr;
struct rte_eth_dev_info dev_info;
@@ -274,7 +274,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
hdr = (struct pcapng_interface_block *)buf;
*hdr = (struct pcapng_interface_block) {
.block_type = PCAPNG_INTERFACE_BLOCK,
- .link_type = 1, /* DLT_EN10MB - Ethernet */
+ .link_type = link_type,
.block_length = len,
};
@@ -319,6 +319,16 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
return write(self->outfd, buf, len);
}
+RTE_VERSION_SYMBOL(25, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
+{
+ /* Call the new version with a default link_type (Ethernet) */
+ return rte_pcapng_add_interface(self, port, DLT_EN10MB,
+ ifname, ifdescr, filter);
+}
+
/*
* Write an Interface statistics block at the end of capture.
*/
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 48f2b57564..cce141e3f4 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
* The handle to the packet capture file
* @param port
* The Ethernet port to report stats on.
+ * @param link_type
+ * The link type (e.g., DLT_EN10MB).
* @param ifname (optional)
* Interface name to record in the file.
* If not specified, name will be constructed from port
@@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
* must be added.
*/
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter);
--
2.27.0
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-06 21:52 ` Schneide
` (4 preceding siblings ...)
2025-06-08 22:34 ` Stephen Hemminger
@ 2025-06-16 14:29 ` Dylan Schneider
2025-06-24 15:15 ` Dylan Schneider
5 siblings, 1 reply; 24+ messages in thread
From: Dylan Schneider @ 2025-06-16 14:29 UTC (permalink / raw)
To: dev, Thomas Monjalon, Reshma Pattan, Stephen Hemminger,
Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
[-- Attachment #1: Type: text/plain, Size: 9752 bytes --]
Hello Stephen and Thomas,
I uploaded this patch which says it has UT failures, but upon closer inspection, there aren't any signs of any tests failing. Can you please take a look?
________________________________
From: Schneide <schneide@qti.qualcomm.com>
Sent: Friday, June 6, 2025 3:52 PM
To: dev@dpdk.org <dev@dpdk.org>; Thomas Monjalon <thomas@monjalon.net>; Reshma Pattan <reshma.pattan@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Jerin Jacob <jerinj@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
Cc: Dylan Schneider <schneide@qti.qualcomm.com>
Subject: [PATCH v2] pcapng: allow any protocol link type for the interface block
From: Dylan Schneider <schneide@qti.qualcomm.com>
Allow the user to specify protocol link type when creating pcapng files.
This change is needed to specify the protocol type in the pcapng file,
DLT_EN10MB specifies ethernet packets only. This will allow dissectors
for other protocols to be used on files generated by pcapng.
Includes a breaking change to rte_pcapng_add_interface to add link_type
parameter. Existing calls to the function have been updated to pass
DLT_EN10MB for the link type argument.
Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: stephen@networkplumber.org
---
.mailmap | 1 +
app/dumpcap/main.c | 4 ++--
app/test/test_pcapng.c | 8 ++++----
doc/guides/rel_notes/release_25_07.rst | 5 ++++-
lib/graph/graph_pcap.c | 4 +++-
lib/pcapng/meson.build | 2 ++
lib/pcapng/rte_pcapng.c | 21 +++++++++++++++------
lib/pcapng/rte_pcapng.h | 4 +++-
8 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/.mailmap b/.mailmap
index 91e08f4a1f..a585124832 100644
--- a/.mailmap
+++ b/.mailmap
@@ -390,6 +390,7 @@ Dukai Yuan <dukaix.yuan@intel.com>
Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
Duncan Bellamy <dunk@denkimushi.com>
Dustin Lundquist <dustin@null-ptr.net>
+Dylan Schneider <schneide@qti.qualcomm.com>
Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Ed Czeck <ed.czeck@atomicrules.com>
Eduard Serra <eserra@vmware.com>
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0dbc66..e0e2b26269 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
free(os);
TAILQ_FOREACH(intf, &interfaces, next) {
- if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
- intf->ifdescr, intf->opts.filter) < 0)
+ if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
+ intf->ifname, intf->ifdescr, intf->opts.filter) < 0)
rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
intf->port);
}
diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
index 8f2cff36c3..bcf99724fa 100644
--- a/app/test/test_pcapng.c
+++ b/app/test/test_pcapng.c
@@ -345,7 +345,7 @@ test_add_interface(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
@@ -353,7 +353,7 @@ test_add_interface(void)
}
/* Add interface with ifname and ifdescr */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
"myeth", "Some long description", NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u with ifname\n", port_id);
@@ -361,7 +361,7 @@ test_add_interface(void)
}
/* Add interface with filter */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, "tcp port 8080");
if (ret < 0) {
fprintf(stderr, "can not add port %u with filter\n", port_id);
@@ -406,7 +406,7 @@ test_write_packets(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
index 6b070801de..2396c7b014 100644
--- a/doc/guides/rel_notes/release_25_07.rst
+++ b/doc/guides/rel_notes/release_25_07.rst
@@ -108,7 +108,10 @@ API Changes
This section is a comment. Do not overwrite or remove it.
Also, make sure to start the actual text at the margin.
=======================================================
-
+* pcapng: Changed the API for adding interfaces to include a link type argument.
+ The link type was previously hardcoded to the ethernet link type in the API.
+ This argument is added to ``rte_pcapng_add_interface``.
+ These functions are versioned to retain binary compatibility until the next LTS release.
ABI Changes
-----------
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 89525f1220..13d86b7a18 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -11,6 +11,8 @@
#include <rte_mbuf.h>
#include <rte_pcapng.h>
+#include <pcap/pcap.h>
+
#include "rte_graph_worker.h"
#include "graph_pcap_private.h"
@@ -117,7 +119,7 @@ graph_pcap_file_open(const char *filename)
/* Add the configured interfaces as possible capture ports */
RTE_ETH_FOREACH_DEV(portid) {
- ret = rte_pcapng_add_interface(pcapng_fd, portid,
+ ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
diff --git a/lib/pcapng/meson.build b/lib/pcapng/meson.build
index 4549925d41..3aa7ba5155 100644
--- a/lib/pcapng/meson.build
+++ b/lib/pcapng/meson.build
@@ -5,3 +5,5 @@ sources = files('rte_pcapng.c')
headers = files('rte_pcapng.h')
deps += ['ethdev']
+
+use_function_versioning = true
diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index cacbefdc50..f18af25983 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -200,11 +200,10 @@ pcapng_section_block(rte_pcapng_t *self,
}
/* Write an interface block for a DPDK port */
-RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
-int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
- const char *ifname, const char *ifdescr,
- const char *filter)
+RTE_DEFAULT_SYMBOL(26, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port, uint16_t link_type,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
{
struct pcapng_interface_block *hdr;
struct rte_eth_dev_info dev_info;
@@ -274,7 +273,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
hdr = (struct pcapng_interface_block *)buf;
*hdr = (struct pcapng_interface_block) {
.block_type = PCAPNG_INTERFACE_BLOCK,
- .link_type = 1, /* DLT_EN10MB - Ethernet */
+ .link_type = link_type,
.block_length = len,
};
@@ -319,6 +318,16 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
return write(self->outfd, buf, len);
}
+RTE_VERSION_SYMBOL(25, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
+{
+ /* Call the new version with a default link_type (Ethernet) */
+ return rte_pcapng_add_interface(self, port, DLT_EN10MB,
+ ifname, ifdescr, filter);
+}
+
/*
* Write an Interface statistics block at the end of capture.
*/
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 48f2b57564..9880d415c4 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
* The handle to the packet capture file
* @param port
* The Ethernet port to report stats on.
+ * @param link_type
+ * The link type (e.g., DLT_EN10MB).
* @param ifname (optional)
* Interface name to record in the file.
* If not specified, name will be constructed from port
@@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
* must be added.
*/
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter);
--
2.27.0
[-- Attachment #2: Type: text/html, Size: 18902 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-09 21:19 ` Schneide
@ 2025-06-16 18:05 ` Stephen Hemminger
2025-06-26 13:57 ` Stephen Hemminger
` (2 subsequent siblings)
3 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-06-16 18:05 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Mon, 9 Jun 2025 15:19:37 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
> ---
Recheck-request: aws-unit-testing
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-16 14:29 ` Dylan Schneider
@ 2025-06-24 15:15 ` Dylan Schneider
0 siblings, 0 replies; 24+ messages in thread
From: Dylan Schneider @ 2025-06-24 15:15 UTC (permalink / raw)
To: dev, Thomas Monjalon, Reshma Pattan, Stephen Hemminger,
Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
[-- Attachment #1: Type: text/plain, Size: 10565 bytes --]
Hey Stephen, I saw the comment you made to re-run UTs but I cant distinguish if anything actually happened, the report still says everything is passing.
________________________________
From: Dylan Schneider <schneide@qti.qualcomm.com>
Sent: Monday, June 16, 2025 8:29 AM
To: dev@dpdk.org <dev@dpdk.org>; Thomas Monjalon <thomas@monjalon.net>; Reshma Pattan <reshma.pattan@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Jerin Jacob <jerinj@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
Subject: Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
Hello Stephen and Thomas,
I uploaded this patch which says it has UT failures, but upon closer inspection, there aren't any signs of any tests failing. Can you please take a look?
________________________________
From: Schneide <schneide@qti.qualcomm.com>
Sent: Friday, June 6, 2025 3:52 PM
To: dev@dpdk.org <dev@dpdk.org>; Thomas Monjalon <thomas@monjalon.net>; Reshma Pattan <reshma.pattan@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Jerin Jacob <jerinj@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
Cc: Dylan Schneider <schneide@qti.qualcomm.com>
Subject: [PATCH v2] pcapng: allow any protocol link type for the interface block
From: Dylan Schneider <schneide@qti.qualcomm.com>
Allow the user to specify protocol link type when creating pcapng files.
This change is needed to specify the protocol type in the pcapng file,
DLT_EN10MB specifies ethernet packets only. This will allow dissectors
for other protocols to be used on files generated by pcapng.
Includes a breaking change to rte_pcapng_add_interface to add link_type
parameter. Existing calls to the function have been updated to pass
DLT_EN10MB for the link type argument.
Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: stephen@networkplumber.org
---
.mailmap | 1 +
app/dumpcap/main.c | 4 ++--
app/test/test_pcapng.c | 8 ++++----
doc/guides/rel_notes/release_25_07.rst | 5 ++++-
lib/graph/graph_pcap.c | 4 +++-
lib/pcapng/meson.build | 2 ++
lib/pcapng/rte_pcapng.c | 21 +++++++++++++++------
lib/pcapng/rte_pcapng.h | 4 +++-
8 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/.mailmap b/.mailmap
index 91e08f4a1f..a585124832 100644
--- a/.mailmap
+++ b/.mailmap
@@ -390,6 +390,7 @@ Dukai Yuan <dukaix.yuan@intel.com>
Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
Duncan Bellamy <dunk@denkimushi.com>
Dustin Lundquist <dustin@null-ptr.net>
+Dylan Schneider <schneide@qti.qualcomm.com>
Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Ed Czeck <ed.czeck@atomicrules.com>
Eduard Serra <eserra@vmware.com>
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0dbc66..e0e2b26269 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
free(os);
TAILQ_FOREACH(intf, &interfaces, next) {
- if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
- intf->ifdescr, intf->opts.filter) < 0)
+ if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
+ intf->ifname, intf->ifdescr, intf->opts.filter) < 0)
rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
intf->port);
}
diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
index 8f2cff36c3..bcf99724fa 100644
--- a/app/test/test_pcapng.c
+++ b/app/test/test_pcapng.c
@@ -345,7 +345,7 @@ test_add_interface(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
@@ -353,7 +353,7 @@ test_add_interface(void)
}
/* Add interface with ifname and ifdescr */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
"myeth", "Some long description", NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u with ifname\n", port_id);
@@ -361,7 +361,7 @@ test_add_interface(void)
}
/* Add interface with filter */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, "tcp port 8080");
if (ret < 0) {
fprintf(stderr, "can not add port %u with filter\n", port_id);
@@ -406,7 +406,7 @@ test_write_packets(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
index 6b070801de..2396c7b014 100644
--- a/doc/guides/rel_notes/release_25_07.rst
+++ b/doc/guides/rel_notes/release_25_07.rst
@@ -108,7 +108,10 @@ API Changes
This section is a comment. Do not overwrite or remove it.
Also, make sure to start the actual text at the margin.
=======================================================
-
+* pcapng: Changed the API for adding interfaces to include a link type argument.
+ The link type was previously hardcoded to the ethernet link type in the API.
+ This argument is added to ``rte_pcapng_add_interface``.
+ These functions are versioned to retain binary compatibility until the next LTS release.
ABI Changes
-----------
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 89525f1220..13d86b7a18 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -11,6 +11,8 @@
#include <rte_mbuf.h>
#include <rte_pcapng.h>
+#include <pcap/pcap.h>
+
#include "rte_graph_worker.h"
#include "graph_pcap_private.h"
@@ -117,7 +119,7 @@ graph_pcap_file_open(const char *filename)
/* Add the configured interfaces as possible capture ports */
RTE_ETH_FOREACH_DEV(portid) {
- ret = rte_pcapng_add_interface(pcapng_fd, portid,
+ ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
diff --git a/lib/pcapng/meson.build b/lib/pcapng/meson.build
index 4549925d41..3aa7ba5155 100644
--- a/lib/pcapng/meson.build
+++ b/lib/pcapng/meson.build
@@ -5,3 +5,5 @@ sources = files('rte_pcapng.c')
headers = files('rte_pcapng.h')
deps += ['ethdev']
+
+use_function_versioning = true
diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index cacbefdc50..f18af25983 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -200,11 +200,10 @@ pcapng_section_block(rte_pcapng_t *self,
}
/* Write an interface block for a DPDK port */
-RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
-int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
- const char *ifname, const char *ifdescr,
- const char *filter)
+RTE_DEFAULT_SYMBOL(26, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port, uint16_t link_type,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
{
struct pcapng_interface_block *hdr;
struct rte_eth_dev_info dev_info;
@@ -274,7 +273,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
hdr = (struct pcapng_interface_block *)buf;
*hdr = (struct pcapng_interface_block) {
.block_type = PCAPNG_INTERFACE_BLOCK,
- .link_type = 1, /* DLT_EN10MB - Ethernet */
+ .link_type = link_type,
.block_length = len,
};
@@ -319,6 +318,16 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
return write(self->outfd, buf, len);
}
+RTE_VERSION_SYMBOL(25, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
+{
+ /* Call the new version with a default link_type (Ethernet) */
+ return rte_pcapng_add_interface(self, port, DLT_EN10MB,
+ ifname, ifdescr, filter);
+}
+
/*
* Write an Interface statistics block at the end of capture.
*/
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 48f2b57564..9880d415c4 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
* The handle to the packet capture file
* @param port
* The Ethernet port to report stats on.
+ * @param link_type
+ * The link type (e.g., DLT_EN10MB).
* @param ifname (optional)
* Interface name to record in the file.
* If not specified, name will be constructed from port
@@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
* must be added.
*/
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter);
--
2.27.0
[-- Attachment #2: Type: text/html, Size: 20465 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-09 21:19 ` Schneide
2025-06-16 18:05 ` Stephen Hemminger
@ 2025-06-26 13:57 ` Stephen Hemminger
2025-06-27 16:05 ` Thomas Monjalon
2025-06-27 17:39 ` Thomas Monjalon
3 siblings, 0 replies; 24+ messages in thread
From: Stephen Hemminger @ 2025-06-26 13:57 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Mon, 9 Jun 2025 15:19:37 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-09 21:19 ` Schneide
2025-06-16 18:05 ` Stephen Hemminger
2025-06-26 13:57 ` Stephen Hemminger
@ 2025-06-27 16:05 ` Thomas Monjalon
2025-06-27 17:39 ` Thomas Monjalon
3 siblings, 0 replies; 24+ messages in thread
From: Thomas Monjalon @ 2025-06-27 16:05 UTC (permalink / raw)
To: Dylan Schneider
Cc: dev, Reshma Pattan, Stephen Hemminger, Jerin Jacob,
Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
09/06/2025 23:19, Schneide:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
Excuse me, I'm a bit lost because you have sent 3 v2,
and there is no changelog.
I suppose I should assume this last v2 fixed the comments done by Stephen.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-09 21:19 ` Schneide
` (2 preceding siblings ...)
2025-06-27 16:05 ` Thomas Monjalon
@ 2025-06-27 17:39 ` Thomas Monjalon
2025-06-27 17:46 ` Dylan Schneider
3 siblings, 1 reply; 24+ messages in thread
From: Thomas Monjalon @ 2025-06-27 17:39 UTC (permalink / raw)
To: Dylan Schneider
Cc: dev, Reshma Pattan, Stephen Hemminger, Jerin Jacob,
Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
09/06/2025 23:19, Schneide:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
I doesn't pass compilation test on my machine:
Error: cannot find librte_pcapng.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_graph.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_node.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_pdump.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-27 17:39 ` Thomas Monjalon
@ 2025-06-27 17:46 ` Dylan Schneider
2025-06-27 18:27 ` Thomas Monjalon
2025-06-30 13:50 ` Dylan Schneider
0 siblings, 2 replies; 24+ messages in thread
From: Dylan Schneider @ 2025-06-27 17:46 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Reshma Pattan, Stephen Hemminger, Jerin Jacob,
Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]
Hey Thomas,
Thanks for the reply.
Can you tell me the build command you're using to produce those errors? I have ran the builds on my test machine and cannot reproduce these. Thanks!
Dylan
________________________________
From: Thomas Monjalon <thomas@monjalon.net>
Sent: Friday, June 27, 2025 11:39 AM
To: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: dev@dpdk.org <dev@dpdk.org>; Reshma Pattan <reshma.pattan@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Jerin Jacob <jerinj@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
Subject: Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
09/06/2025 23:19, Schneide:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
I doesn't pass compilation test on my machine:
Error: cannot find librte_pcapng.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_graph.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_node.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_pdump.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
[-- Attachment #2: Type: text/html, Size: 3515 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-27 17:46 ` Dylan Schneider
@ 2025-06-27 18:27 ` Thomas Monjalon
2025-06-30 13:50 ` Dylan Schneider
1 sibling, 0 replies; 24+ messages in thread
From: Thomas Monjalon @ 2025-06-27 18:27 UTC (permalink / raw)
To: Dylan Schneider
Cc: dev, Reshma Pattan, Stephen Hemminger, Jerin Jacob,
Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
27/06/2025 19:46, Dylan Schneider:
> Can you tell me the build command you're using to produce those errors? I have ran the builds on my test machine and cannot reproduce these. Thanks!
I run devtools/test-meson-builds.sh with an Arm toolchain installed.
Message:
=================
Libraries Enabled
=================
libs:
log, kvargs, argparse, telemetry, pmu, eal, ptr_compress, ring,
rcu, mempool, mbuf, net, meter, ethdev, pci, cmdline,
metrics, hash, timer, acl, bbdev, bitratestats, bpf, cfgfile,
compressdev, cryptodev, distributor, dmadev, efd, eventdev, dispatcher, gpudev,
gro, gso, ip_frag, jobstats, latencystats, lpm, member, power,
rawdev, regexdev, mldev, rib, reorder, sched, security, stack,
vhost, ipsec, pdcp, fib, port, table, pipeline,
Message:
===============
Drivers Enabled
===============
common:
cpt, dpaax, ionic, mvep, octeontx, cnxk, mlx5, nfp,
nitrox, qat, sfc_efx, zsda,
bus:
auxiliary, cdx, dpaa, fslmc, ifpga, pci, platform, uacce,
vdev, vmbus,
mempool:
bucket, cnxk, dpaa, dpaa2, octeontx, ring, stack,
dma:
cnxk, dpaa, dpaa2, hisilicon, odm, skeleton,
net:
af_packet, ark, atlantic, avp, axgbe, bnx2x, bnxt, bond,
cnxk, cxgbe, dpaa, dpaa2, ena, enetc, enetfec, enic,
failsafe, gve, hinic, hns3, e1000, fm10k, i40e, iavf,
ice, idpf, ixgbe, cpfl, ionic, mana, memif, mlx4,
mlx5, mvneta, mvpp2, netvsc, nfp, ngbe, null, octeontx,
octeon_ep, pfe, qede, r8169, ring, rnp, sfc, softnic,
tap, thunderx, txgbe, vdev_netvsc, vhost, virtio, vmxnet3, xsc,
raw:
cnxk_bphy, cnxk_gpio, cnxk_rvu_lf, dpaa2_cmdif, gdtc, ntb, skeleton,
crypto:
armv8, bcmfs, caam_jr, cnxk, dpaa_sec, dpaa2_sec, ionic, mlx5,
mvsam, nitrox, null, octeontx, scheduler, virtio,
compress:
mlx5, nitrox, octeontx, zlib,
regex:
mlx5, cn9k,
ml:
cnxk,
vdpa:
ifc, mlx5, nfp, sfc,
event:
cnxk, dpaa, dpaa2, dsw, opdl, skeleton, sw, octeontx,
baseband:
acc, fpga_5gnr_fec, fpga_lte_fec, la12xx, null, turbo_sw,
gpu:
power:
acpi, amd_pstate, cppc, intel_pstate, intel_uncore, kvm_vm,
[...]
User defined options
Cross files : dpdk/config/arm/arm64_armv8_linux_gcc
buildtype : debugoptimized
default_library : shared
enable_deprecated_libs: *
examples : all
werror : True
Found ninja-1.12.1 at /usr/bin/ninja
Cleaning... 75 files.
[3652/3653] Linking target drivers/librte_event_cnxk.so.25.2
Error: cannot find librte_pcapng.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_graph.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_node.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_pdump.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-27 17:46 ` Dylan Schneider
2025-06-27 18:27 ` Thomas Monjalon
@ 2025-06-30 13:50 ` Dylan Schneider
2025-06-30 14:28 ` Thomas Monjalon
1 sibling, 1 reply; 24+ messages in thread
From: Dylan Schneider @ 2025-06-30 13:50 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Reshma Pattan, Stephen Hemminger, Jerin Jacob,
Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
[-- Attachment #1: Type: text/plain, Size: 2801 bytes --]
Hey Thomas, just wanted to confirm, I see the ARM build passing in CI. Is there a reason it would pass there but not on your dev machine?
________________________________
From: Dylan Schneider <schneide@qti.qualcomm.com>
Sent: Friday, June 27, 2025 11:46 AM
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org <dev@dpdk.org>; Reshma Pattan <reshma.pattan@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Jerin Jacob <jerinj@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
Subject: Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
Hey Thomas,
Thanks for the reply.
Can you tell me the build command you're using to produce those errors? I have ran the builds on my test machine and cannot reproduce these. Thanks!
Dylan
________________________________
From: Thomas Monjalon <thomas@monjalon.net>
Sent: Friday, June 27, 2025 11:39 AM
To: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: dev@dpdk.org <dev@dpdk.org>; Reshma Pattan <reshma.pattan@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Jerin Jacob <jerinj@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
Subject: Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
09/06/2025 23:19, Schneide:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
I doesn't pass compilation test on my machine:
Error: cannot find librte_pcapng.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_graph.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_node.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
Error: cannot find librte_pdump.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
[-- Attachment #2: Type: text/html, Size: 5497 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-06-30 13:50 ` Dylan Schneider
@ 2025-06-30 14:28 ` Thomas Monjalon
0 siblings, 0 replies; 24+ messages in thread
From: Thomas Monjalon @ 2025-06-30 14:28 UTC (permalink / raw)
To: Dylan Schneider
Cc: dev, Reshma Pattan, Stephen Hemminger, Jerin Jacob,
Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
Sorry I did not investigate, but there is probably a different installation of the pcap library.
I have this in a config file:
pcaparm=$deps/libpcap/build-aarch64/install # requires big changes in DPDK
#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$pcaparm/lib/pkgconfig
I don't remember what are the big changes required, and why it is disabled.
Checking Meson, libpcap is indeed not found on aarch64:
Run-time dependency libpcap found: NO (tried pkgconfig)
Library pcap found: NO
Can you check whether the error can be related to the absence of libpcap?
30/06/2025 15:50, Dylan Schneider:
> Hey Thomas, just wanted to confirm, I see the ARM build passing in CI. Is there a reason it would pass there but not on your dev machine?
>
>
> ________________________________
> From: Dylan Schneider <schneide@qti.qualcomm.com>
> Sent: Friday, June 27, 2025 11:46 AM
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: dev@dpdk.org <dev@dpdk.org>; Reshma Pattan <reshma.pattan@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Jerin Jacob <jerinj@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
> Subject: Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
>
>
> WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
>
> Hey Thomas,
> Thanks for the reply.
> Can you tell me the build command you're using to produce those errors? I have ran the builds on my test machine and cannot reproduce these. Thanks!
> Dylan
> ________________________________
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Friday, June 27, 2025 11:39 AM
> To: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: dev@dpdk.org <dev@dpdk.org>; Reshma Pattan <reshma.pattan@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Jerin Jacob <jerinj@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
> Subject: Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
>
> WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.
>
> 09/06/2025 23:19, Schneide:
> > From: Dylan Schneider <schneide@qti.qualcomm.com>
> >
> > Allow the user to specify protocol link type when creating pcapng files.
> > This change is needed to specify the protocol type in the pcapng file,
> > DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> > for other protocols to be used on files generated by pcapng.
> >
> > Includes a breaking change to rte_pcapng_add_interface to add link_type
> > parameter. Existing calls to the function have been updated to pass
> > DLT_EN10MB for the link type argument.
> >
> > Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> > Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> > Cc: stephen@networkplumber.org
>
> I doesn't pass compilation test on my machine:
>
> Error: cannot find librte_pcapng.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
> Error: cannot find librte_graph.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
> Error: cannot find librte_node.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
> Error: cannot find librte_pdump.so.25.1 in dpdk-build/build-arm64-generic-gcc/install
>
>
>
>
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2025-06-30 14:28 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-29 17:16 [PATCH] pcapng: allow any protocol link type for the interface block Schneide
2025-05-29 19:31 ` Stephen Hemminger
2025-05-29 19:57 ` Stephen Hemminger
2025-06-05 23:02 ` [PATCH v2] " Schneide
2025-06-06 15:13 ` Stephen Hemminger
2025-06-06 21:52 ` Schneide
2025-06-08 22:16 ` Stephen Hemminger
2025-06-08 22:19 ` Stephen Hemminger
2025-06-08 22:23 ` Stephen Hemminger
2025-06-08 22:30 ` Stephen Hemminger
2025-06-08 22:34 ` Stephen Hemminger
2025-06-09 15:51 ` Dylan Schneider
2025-06-09 16:24 ` Stephen Hemminger
2025-06-16 14:29 ` Dylan Schneider
2025-06-24 15:15 ` Dylan Schneider
2025-06-09 21:19 ` Schneide
2025-06-16 18:05 ` Stephen Hemminger
2025-06-26 13:57 ` Stephen Hemminger
2025-06-27 16:05 ` Thomas Monjalon
2025-06-27 17:39 ` Thomas Monjalon
2025-06-27 17:46 ` Dylan Schneider
2025-06-27 18:27 ` Thomas Monjalon
2025-06-30 13:50 ` Dylan Schneider
2025-06-30 14:28 ` Thomas Monjalon
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).