[dts][PATCH V1 3/3] tests/dpdk_gro_lib_cbdma: add dpdk_gro_lib_cbdma testsuite

David Marchand david.marchand at redhat.com
Mon May 9 08:52:22 CEST 2022


On Sat, May 7, 2022 at 10:44 AM Wei Ling <weix.ling at intel.com> wrote:
> +    def prepare_dpdk(self):
> +        # Changhe the testpmd checksum fwd code for mac change
> +        self.dut.send_expect("cp ./app/test-pmd/csumonly.c ./app/test-pmd/csumonly_backup.c", "#")
> +        self.dut.send_expect("cp ./drivers/net/vhost/rte_eth_vhost.c ./drivers/net/vhost/rte_eth_vhost-backup.c", "#")
> +        self.dut.send_expect("sed -i '/ether_addr_copy(&peer_eth/i\#if 0' ./app/test-pmd/csumonly.c", "#")
> +        self.dut.send_expect("sed -i '/parse_ethernet(eth_hdr, &info/i\#endif' ./app/test-pmd/csumonly.c", "#")
> +        # change offload of vhost
> +        tx_offload = 'RTE_ETH_TX_OFFLOAD_VLAN_INSERT | ' + \
> +                    'RTE_ETH_TX_OFFLOAD_UDP_CKSUM | ' + \
> +                    'RTE_ETH_TX_OFFLOAD_TCP_CKSUM | ' + \
> +                    'RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | ' + \
> +                    'RTE_ETH_TX_OFFLOAD_TCP_TSO;'
> +        rx_offload = 'RTE_ETH_RX_OFFLOAD_VLAN_STRIP | ' + \
> +                    'RTE_ETH_RX_OFFLOAD_TCP_CKSUM | ' + \
> +                    'RTE_ETH_RX_OFFLOAD_UDP_CKSUM | ' + \
> +                    'RTE_ETH_RX_OFFLOAD_IPV4_CKSUM | ' + \
> +                    'RTE_ETH_RX_OFFLOAD_TCP_LRO;'
> +        self.dut.send_expect("sed -i 's/RTE_ETH_TX_OFFLOAD_VLAN_INSERT;/%s/' drivers/net/vhost/rte_eth_vhost.c" % tx_offload, "#")
> +        self.dut.send_expect("sed -i 's/RTE_ETH_RX_OFFLOAD_VLAN_STRIP;/%s/' drivers/net/vhost/rte_eth_vhost.c" % rx_offload, "#")
> +        self.dut.build_install_dpdk(self.dut.target)

This hack is getting copy/pasted again and again.

_Don't modify DPDK sources in DTS_.


> +
> +    def unprepare_dpdk(self):
> +        # Recovery the DPDK code to original
> +        self.dut.send_expect("cp ./app/test-pmd/csumonly_backup.c ./app/test-pmd/csumonly.c ", "#")
> +        self.dut.send_expect("cp ./drivers/net/vhost/rte_eth_vhost-backup.c ./drivers/net/vhost/rte_eth_vhost.c ", "#")
> +        self.dut.send_expect("rm -rf ./app/test-pmd/csumonly_backup.c", "#")
> +        self.dut.send_expect("rm -rf ./drivers/net/vhost/rte_eth_vhost-backup.c", "#")
> +        self.dut.build_install_dpdk(self.dut.target)


-- 
David Marchand



More information about the dts mailing list