DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev] [PATCH v1] pktgen: fix generating sequences with vlan header
       [not found] <CGME20200115062430eucas1p21a74e501ddd00e8fdaba7da1a9f2c304@eucas1p2.samsung.com>
@ 2020-01-15  6:24 ` Ivan Dyukov
  0 siblings, 0 replies; only message in thread
From: Ivan Dyukov @ 2020-01-15  6:24 UTC (permalink / raw)
  To: dev, keith.wiles; +Cc: Ivan Dyukov

If lua file contains following code:
pktgen.seqTable(0, "0", seq_table);
pktgen.set("all", "seqCnt", 1);
pktgen.vlan("all", 15);
it will not work because the vlan setting resets sequence
flag on the port.

To solve the issue vlan should not reset EXCLUSIVE_MODES,
it should reset only EXCLUSIVE_PKT_MODES

Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
---
 app/pktgen-cmds.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/app/pktgen-cmds.c b/app/pktgen-cmds.c
index 0e9af7c..280341a 100644
--- a/app/pktgen-cmds.c
+++ b/app/pktgen-cmds.c
@@ -1386,7 +1386,6 @@ enable_random(port_info_t *info, uint32_t onOff)
 {
 	if (onOff == ENABLE_STATE) {
 		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
-		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_RANDOM_PKTS);
 	} else
 		pktgen_clr_port_flags(info, SEND_RANDOM_PKTS);
@@ -1637,7 +1636,6 @@ enable_pcap(port_info_t *info, uint32_t state)
 	if ( (info->pcap != NULL) && (info->pcap->pkt_count != 0) ) {
 		if (state == ENABLE_STATE) {
 			pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
-			pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 			pktgen_set_port_flags(info, SEND_PCAP_PKTS);
 		} else
 			pktgen_clr_port_flags(info, SEND_PCAP_PKTS);
@@ -1662,7 +1660,6 @@ enable_rate(port_info_t *info, uint32_t state)
 {
 	if (state == ENABLE_STATE) {
 		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
-		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_RATE_PACKETS);
 
 		single_set_proto(info, (char *)(uintptr_t)"udp");
@@ -2102,7 +2099,6 @@ void
 enable_vxlan(port_info_t *info, uint32_t onOff)
 {
 	if (onOff == ENABLE_STATE) {
-		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
 		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_VXLAN_PACKETS);
 	} else
@@ -2127,7 +2123,6 @@ void
 enable_vlan(port_info_t *info, uint32_t onOff)
 {
 	if (onOff == ENABLE_STATE) {
-		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
 		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_VLAN_ID);
 	} else
@@ -2244,7 +2239,6 @@ void
 enable_mpls(port_info_t *info, uint32_t onOff)
 {
 	if (onOff == ENABLE_STATE) {
-		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
 		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_MPLS_LABEL);
 	} else
@@ -2290,7 +2284,6 @@ void
 enable_qinq(port_info_t *info, uint32_t onOff)
 {
 	if (onOff == ENABLE_STATE) {
-		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
 		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_Q_IN_Q_IDS);
 	} else
@@ -2359,7 +2352,6 @@ void
 enable_gre(port_info_t *info, uint32_t onOff)
 {
 	if (onOff == ENABLE_STATE) {
-		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
 		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_GRE_IPv4_HEADER);
 	} else
@@ -2384,7 +2376,6 @@ void
 enable_gre_eth(port_info_t *info, uint32_t onOff)
 {
 	if (onOff == ENABLE_STATE) {
-		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
 		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_GRE_ETHER_HEADER);
 	} else
@@ -2750,7 +2741,6 @@ pktgen_set_port_seqCnt(port_info_t *info, uint32_t cnt)
 	info->seqCnt = cnt;
 	if (cnt) {
 		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
-		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_SEQ_PKTS);
 	} else
 		pktgen_clr_port_flags(info, SEND_SEQ_PKTS);
@@ -3242,7 +3232,6 @@ enable_range(port_info_t *info, uint32_t state)
 			return;
 		}
 		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
-		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_RANGE_PKTS);
 	} else
 		pktgen_clr_port_flags(info, SEND_RANGE_PKTS);
@@ -3267,7 +3256,6 @@ enable_latency(port_info_t *info, uint32_t state)
 {
 	if (state == ENABLE_STATE) {
 		pktgen_clr_port_flags(info, EXCLUSIVE_MODES);
-		pktgen_clr_port_flags(info, EXCLUSIVE_PKT_MODES);
 		pktgen_set_port_flags(info, SEND_LATENCY_PKTS);
 
 		if (info->seq_pkt[SINGLE_PKT].pktSize < (PG_ETHER_MIN_LEN - PG_ETHER_CRC_LEN) + sizeof(tstamp_t)) {
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200115062430eucas1p21a74e501ddd00e8fdaba7da1a9f2c304@eucas1p2.samsung.com>
2020-01-15  6:24 ` [dpdk-dev] [PATCH v1] pktgen: fix generating sequences with vlan header Ivan Dyukov

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git