[dpdk-dev] [PATCH v4 1/3] app/testpmd: move dumping packets to a separate function

Ferruh Yigit ferruh.yigit at intel.com
Thu Oct 11 16:56:18 CEST 2018


On 10/7/2018 8:38 AM, Raslan Darawsheh wrote:
> verbosity for the received/sent packets is needed in all of the
> forwarding engines so moving it to be in a separate function

+1, this is good idea.

> ---
> changes in v3:
> 	- add util.c in the mason.build file
> 	- restore missing check for ol_flags & PKT_RX_RSS_HASH.
> 	- add local variables for rte_be_to_cpu to avoid long
> 	  lines.
> 
> changes in v4:
> 	- add missing l3 and l4 checks
> ---
> 
> Signed-off-by: Raslan Darawsheh <rasland at mellanox.com>

<...>

> @@ -0,0 +1,150 @@
> +/* SPDX-License-Identifie.r: BSD-3-Clause
> + * Copyri.ght(c) 2010-2018 Mellanox technology.

It can be good to keep original Copyright owner when moving some code from one
file another.

<...>

> +		sw_packet_type = rte_net_get_ptype(mb, &hdr_lens,
> +						   RTE_PTYPE_ALL_MASK);

DPDK coding convention requires a single tab in next line, instead of alligning
to the parenthesis.

<...>

> +			/* Do not support ipv4 option field */
> +			if (RTE_ETH_IS_IPV4_HDR(packet_type)) {
> +				l3_len = sizeof(struct ipv4_hdr);
> +				ipv4_hdr = rte_pktmbuf_mtod_offset(mb,
> +				struct ipv4_hdr *,
> +				l2_len);
> +				l4_proto = ipv4_hdr->next_proto_id;

The syntax broken here.

<...>

> +		}
> +		printf(" - %s queue=0x%x", is_rx ? "Receive" : "Send",
> +			(unsigned int) queue);

Isn't this same information with initial header line, does this add any
extra/new information?


More information about the dev mailing list