01817b10d2
A new parameter `hairpin-mode` is introduced to the testpmd command line. Bitmask value is used to provide a more flexible configuration. This parameter should be used when `hairpinq` is specified in the command line. Bit 0 in the LSB indicates the hairpin will use the loop mode. The previous port Rx queue will be connected to the current port Tx queue. Bit 1 in the LSB indicates the hairpin will use pair port mode. The even index port will be paired with the next odd index port. If the total number of the probed ports is odd, then the last one will be paired to itself. If this byte is zero, then each port will be paired to itself. Bit 0 takes a higher priority in the checking. Bit 4 in the second bytes indicate if the hairpin will use explicit Tx flow mode. e.g. in the command line, "--hairpinq=2 --hairpin-mode=0x11" If not set, default value zero will be used and the behavior will try to get aligned with the previous single port mode. If the ports belong to different vendors' NICs, it is suggested to use the `self` hairpin mode only. Since hairpin configures the hardware resources, the port mask of packets forwarding engine will not be used here. Signed-off-by: Bing Zhao <bingz@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com>