Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d7bb1cf authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller
Browse files

pktgen: cleanup clone count test



The if statement to test for "should a new packet be used"
can be simplified.

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3791decb
Loading
Loading
Loading
Loading
+15 −17
Original line number Diff line number Diff line
@@ -3395,9 +3395,8 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
		return;
	}

	if (pkt_dev->last_ok || !pkt_dev->skb) {
		if ((++pkt_dev->clone_count >= pkt_dev->clone_skb)
		    || (!pkt_dev->skb)) {
	if (!pkt_dev->skb || (pkt_dev->last_ok &&
			      ++pkt_dev->clone_count >= pkt_dev->clone_skb)) {
		/* build a new pkt */
		kfree_skb(pkt_dev->skb);

@@ -3409,10 +3408,10 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
			pkt_dev->clone_count--;	/* back out increment, OOM */
			return;
		}

		pkt_dev->allocated_skbs++;
		pkt_dev->clone_count = 0;	/* reset counter */
	}
	}

	/* fill_packet() might have changed the queue */
	queue_map = skb_get_queue_mapping(pkt_dev->skb);
@@ -3476,7 +3475,6 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
		/* Done with this */
		pktgen_stop_device(pkt_dev);
	}
out:;
}

/*