In the "Raw Ethernet Programming: Basic Introduction - Code Example" post, the code uses IBV_QPT_RAW_PACKET and a steering rule to filter each packet. Will this reduce the bandwidth?

In my test setup, I am using two MCX515A-CCAT NICs. They are installed in two linux computers which are connected by a single cable (no switch). Previously, when I was running tests like ib_send_bw or ib_write_bw and using UD, UC, or RC transport mode, I was seeing bandwidths ~90Gbps or higher. With the example in Raw Ethernet Programming: Basic introduction, after adding some code to count packets and measure time, I am seeing bandwidths around 10 Gbps. I have been playing with different parameters such as MTU, packet size, or IBV_SEND_INLINE. I am wondering if the reduction in bandwidth is due to the packet filtering being done by the steering rule and the use of IBV_QPT_RAW_PACKET? Or should I expect to see similar bandwidths (~90 Gbps) as in my earlier tests and the problem is one of lack of optimization of my setup?

Thanks for any help you can provide.

It may because the code you add affect the performance. Could you share the code you added or provide a demo code you used? Thanks.