Hi Andy, Thanks for your quick response! When looking at the header I observe that the protocol is listed as '0x0000', besides that the 'data field' in the Ethernet Frame is all 0s, but I think this is expected. Maybe some more context for my setup as is is needed. Currently I have set up two network namespaces on my Ubuntu machine, the XDP example is then attached to the receiving side of my setup. Before this I verify the routes are setup correctly using ping, this works as expected. When the network is setup, I use 'nping' from the 'nmap' package, using the following settings: nping $SERVER_IP --udp --source-ip $CLIENT_IP -p $TCPDUMP_PORT -g $TCPDUMP_PORT --data-length 1000 --rate 100 -c $NPING_SEND_COUNT --source-mac $CLIENT_MAC --dest-mac $SERVER_MAC I have added the source and dest mac parameters in the hopes this would fix the problem, but the same behavior occurs when disregarding these parameters. After I start the nping on the client side, I load the XDP program onto the receiving interface on the server side. I added some ' bpf_trace_printk' statements to verify the program was reaching certain areas but besides this it is exactly the same example file. (xdp2) The diff can be found below. For this experiment I ran my test using "-c 110", so 110 UDP packets should be sent using nping. This is for the server (receiving side) interface: https://www.diffchecker.com/2HLX9Y5t This is for the client (sending side) interface: https://www.diffchecker.com/TK7EncN5 In case the above links do not properly present the information I have included the output in the attachments. If you need any other information I am happy to supply this, thank you for your time so far! Kind regards, Jeffrey Panneman -----Original Message----- From: xdp-newbies-owner@xxxxxxxxxxxxxxx [mailto:xdp-newbies-owner@xxxxxxxxxxxxxxx] On Behalf Of Andy Gospodarek Sent: woensdag 31 mei 2017 18:34 To: Jeffrey Panneman <jeffrey.panneman@xxxxxxxxxxxxxx> Cc: xdp-newbies@xxxxxxxxxxxxxxx Subject: Re: Empty ethernet fram after XDP_TX On Wed, May 31, 2017 at 5:29 AM, Jeffrey Panneman <jeffrey.panneman@xxxxxxxxxxxxxx> wrote: > Hi all, > > I have recently started experimenting with XDP in regards to my master > thesis project. I have been playing around with some examples and had > a question regarding the following sample file from the linux kernel: > https://github.com/torvalds/linux/blob/master/samples/bpf/xdp2_kern.c > > I have setup a test environment on which I can monitor both my source > and destination port using Wireshark. I observe that when I run the > example, always returning XDP_PASS, packets go on normal but the MAC > swapping does not occur. When using the XDP_TX return code after > swapping I observe that I see Ethernet frames appear in wireshark with > a source and destination 00:00:00:00:00:00. The IP related headers are > gone and this is the only thing I am seeing. That is not what I would expect to see. I've run numerous tests with xdp2 on other hardware (Broadcom) and not seen this issue. Are only the source and destination MAC addresses all zeros or are other parts of the ethernet header also zero? > For some context, I am running on: 4.11.0-041100-generic x86_64 x86_64 > x86_64 GNU/Linux using ConnectX-4 Lx cards with the mlx5_core driver > (from lspci -v output). From "systool -vm" output I see my mlx5_core > version is "4.0-2.0.0" > > I was wondering if this behaviour was normal, and if anyone knows what > is going wrong here. I am happy to provide some more diagnostic > information if needed. Can you send the diff of the ethtool stats (ethtool -S <netdev>) from before and after your XDP_TX test to see if anything stands out? > Kind regards, > > Jeffrey This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. TNO accepts no liability for the content of this e-mail, for the manner in which you use it and for damage of any kind resulting from the risks inherent to the electronic transmission of messages.
NIC statistics: rx_packets: 116 rx_bytes: 113208 tx_packets: 125 tx_bytes: 116880 tx_tso_packets: 0 tx_tso_bytes: 0 tx_tso_inner_packets: 0 tx_tso_inner_bytes: 0 rx_lro_packets: 0 rx_lro_bytes: 0 rx_csum_unnecessary: 0 rx_csum_none: 110 rx_csum_complete: 6 rx_csum_unnecessary_inner: 0 rx_xdp_drop: 0 rx_xdp_tx: 0 rx_xdp_tx_full: 0 tx_csum_partial: 0 tx_csum_partial_inner: 0 tx_queue_stopped: 0 tx_queue_wake: 0 tx_queue_dropped: 0 tx_xmit_more: 0 rx_wqe_err: 0 rx_mpwqe_filler: 0 rx_buff_alloc_err: 0 rx_cqe_compress_blks: 0 rx_cqe_compress_pkts: 0 rx_page_reuse: 0 rx_cache_reuse: 0 rx_cache_alloc: 27328 rx_cache_full: 0 rx_cache_waive: 0 rx_cache_ext: 0 rx_cache_rdc: 0 link_down_events_phy: 0 rx_out_of_buffer: 0 rx_vport_unicast_packets: 226 rx_vport_unicast_bytes: 225976 tx_vport_unicast_packets: 230 tx_vport_unicast_bytes: 232108 rx_vport_multicast_packets: 389 rx_vport_multicast_bytes: 32319 tx_vport_multicast_packets: 20 tx_vport_multicast_bytes: 1712 rx_vport_broadcast_packets: 0 rx_vport_broadcast_bytes: 0 tx_vport_broadcast_packets: 2 tx_vport_broadcast_bytes: 120 rx_vport_rdma_unicast_packets: 0 rx_vport_rdma_unicast_bytes: 0 tx_vport_rdma_unicast_packets: 0 tx_vport_rdma_unicast_bytes: 0 rx_vport_rdma_multicast_packets: 0 rx_vport_rdma_multicast_bytes: 0 tx_vport_rdma_multicast_packets: 0 tx_vport_rdma_multicast_bytes: 0 tx_packets_phy: 252 rx_packets_phy: 615 rx_crc_errors_phy: 0 tx_bytes_phy: 234948 rx_bytes_phy: 260755 tx_multicast_phy: 20 tx_broadcast_phy: 2 rx_multicast_phy: 389 rx_broadcast_phy: 0 rx_in_range_len_errors_phy: 0 rx_out_of_range_len_phy: 0 rx_oversize_pkts_phy: 0 rx_symbol_err_phy: 0 tx_mac_control_phy: 0 rx_mac_control_phy: 0 rx_unsupported_op_phy: 0 rx_pause_ctrl_phy: 0 tx_pause_ctrl_phy: 0 rx_discards_phy: 0 tx_discards_phy: 0 tx_errors_phy: 0 rx_undersize_pkts_phy: 0 rx_fragments_phy: 0 rx_jabbers_phy: 0 rx_64_bytes_phy: 310 rx_65_to_127_bytes_phy: 61 rx_128_to_255_bytes_phy: 0 rx_256_to_511_bytes_phy: 28 rx_512_to_1023_bytes_phy: 0 rx_1024_to_1518_bytes_phy: 216 rx_1519_to_2047_bytes_phy: 0 rx_2048_to_4095_bytes_phy: 0 rx_4096_to_8191_bytes_phy: 0 rx_8192_to_10239_bytes_phy: 0 rx_pci_signal_integrity: 0 tx_pci_signal_integrity: 5 rx_prio0_bytes: 260755 rx_prio0_packets: 615 tx_prio0_bytes: 234948 tx_prio0_packets: 252 rx_prio1_bytes: 0 rx_prio1_packets: 0 tx_prio1_bytes: 0 tx_prio1_packets: 0 rx_prio2_bytes: 0 rx_prio2_packets: 0 tx_prio2_bytes: 0 tx_prio2_packets: 0 rx_prio3_bytes: 0 rx_prio3_packets: 0 tx_prio3_bytes: 0 tx_prio3_packets: 0 rx_prio4_bytes: 0 rx_prio4_packets: 0 tx_prio4_bytes: 0 tx_prio4_packets: 0 rx_prio5_bytes: 0 rx_prio5_packets: 0 tx_prio5_bytes: 0 tx_prio5_packets: 0 rx_prio6_bytes: 0 rx_prio6_packets: 0 tx_prio6_bytes: 0 tx_prio6_packets: 0 rx_prio7_bytes: 0 rx_prio7_packets: 0 tx_prio7_bytes: 0 tx_prio7_packets: 0 rx_global_pause: 0 rx_global_pause_duration: 0 tx_global_pause: 0 tx_global_pause_duration: 0 rx_global_pause_transition: 0 module_plug: 1 module_unplug: 0 module_pwr_budget_exd: 0 module_long_range: 0 module_bus_stuck: 0 module_no_eeprom: 0 module_enforce_part: 0 module_unknown_id: 0 module_high_temp: 0 module_bad_shorted: 0 module_unknown_status: 0
NIC statistics: rx_packets: 118 rx_bytes: 114340 tx_packets: 125 tx_bytes: 116880 tx_tso_packets: 0 tx_tso_bytes: 0 tx_tso_inner_packets: 0 tx_tso_inner_bytes: 0 rx_lro_packets: 0 rx_lro_bytes: 0 rx_csum_unnecessary: 0 rx_csum_none: 111 rx_csum_complete: 7 rx_csum_unnecessary_inner: 0 rx_xdp_drop: 0 rx_xdp_tx: 0 rx_xdp_tx_full: 0 tx_csum_partial: 0 tx_csum_partial_inner: 0 tx_queue_stopped: 0 tx_queue_wake: 0 tx_queue_dropped: 0 tx_xmit_more: 0 rx_wqe_err: 0 rx_mpwqe_filler: 0 rx_buff_alloc_err: 0 rx_cqe_compress_blks: 0 rx_cqe_compress_pkts: 0 rx_page_reuse: 0 rx_cache_reuse: 0 rx_cache_alloc: 27328 rx_cache_full: 0 rx_cache_waive: 0 rx_cache_ext: 0 rx_cache_rdc: 0 link_down_events_phy: 0 rx_out_of_buffer: 0 rx_vport_unicast_packets: 340 rx_vport_unicast_bytes: 340006 tx_vport_unicast_packets: 345 tx_vport_unicast_bytes: 348162 rx_vport_multicast_packets: 448 rx_vport_multicast_bytes: 37201 tx_vport_multicast_packets: 30 tx_vport_multicast_bytes: 2568 rx_vport_broadcast_packets: 0 rx_vport_broadcast_bytes: 0 tx_vport_broadcast_packets: 3 tx_vport_broadcast_bytes: 180 rx_vport_rdma_unicast_packets: 0 rx_vport_rdma_unicast_bytes: 0 tx_vport_rdma_unicast_packets: 0 tx_vport_rdma_unicast_bytes: 0 rx_vport_rdma_multicast_packets: 0 rx_vport_rdma_multicast_bytes: 0 tx_vport_rdma_multicast_packets: 0 tx_vport_rdma_multicast_bytes: 0 tx_packets_phy: 378 rx_packets_phy: 788 rx_crc_errors_phy: 0 tx_bytes_phy: 352422 rx_bytes_phy: 380359 tx_multicast_phy: 30 tx_broadcast_phy: 3 rx_multicast_phy: 448 rx_broadcast_phy: 0 rx_in_range_len_errors_phy: 0 rx_out_of_range_len_phy: 0 rx_oversize_pkts_phy: 0 rx_symbol_err_phy: 0 tx_mac_control_phy: 0 rx_mac_control_phy: 0 rx_unsupported_op_phy: 0 rx_pause_ctrl_phy: 0 tx_pause_ctrl_phy: 0 rx_discards_phy: 0 tx_discards_phy: 0 tx_errors_phy: 0 rx_undersize_pkts_phy: 0 rx_fragments_phy: 0 rx_jabbers_phy: 0 rx_64_bytes_phy: 347 rx_65_to_127_bytes_phy: 85 rx_128_to_255_bytes_phy: 0 rx_256_to_511_bytes_phy: 31 rx_512_to_1023_bytes_phy: 0 rx_1024_to_1518_bytes_phy: 325 rx_1519_to_2047_bytes_phy: 0 rx_2048_to_4095_bytes_phy: 0 rx_4096_to_8191_bytes_phy: 0 rx_8192_to_10239_bytes_phy: 0 rx_pci_signal_integrity: 0 tx_pci_signal_integrity: 5 rx_prio0_bytes: 380359 rx_prio0_packets: 788 tx_prio0_bytes: 352422 tx_prio0_packets: 378 rx_prio1_bytes: 0 rx_prio1_packets: 0 tx_prio1_bytes: 0 tx_prio1_packets: 0 rx_prio2_bytes: 0 rx_prio2_packets: 0 tx_prio2_bytes: 0 tx_prio2_packets: 0 rx_prio3_bytes: 0 rx_prio3_packets: 0 tx_prio3_bytes: 0 tx_prio3_packets: 0 rx_prio4_bytes: 0 rx_prio4_packets: 0 tx_prio4_bytes: 0 tx_prio4_packets: 0 rx_prio5_bytes: 0 rx_prio5_packets: 0 tx_prio5_bytes: 0 tx_prio5_packets: 0 rx_prio6_bytes: 0 rx_prio6_packets: 0 tx_prio6_bytes: 0 tx_prio6_packets: 0 rx_prio7_bytes: 0 rx_prio7_packets: 0 tx_prio7_bytes: 0 tx_prio7_packets: 0 rx_global_pause: 0 rx_global_pause_duration: 0 tx_global_pause: 0 tx_global_pause_duration: 0 rx_global_pause_transition: 0 module_plug: 1 module_unplug: 0 module_pwr_budget_exd: 0 module_long_range: 0 module_bus_stuck: 0 module_no_eeprom: 0 module_enforce_part: 0 module_unknown_id: 0 module_high_temp: 0 module_bad_shorted: 0 module_unknown_status: 0
NIC statistics: rx_packets: 1 rx_bytes: 60 tx_packets: 2 tx_bytes: 180 tx_tso_packets: 0 tx_tso_bytes: 0 tx_tso_inner_packets: 0 tx_tso_inner_bytes: 0 rx_lro_packets: 0 rx_lro_bytes: 0 rx_csum_unnecessary: 0 rx_csum_none: 1 rx_csum_complete: 0 rx_csum_unnecessary_inner: 0 rx_xdp_drop: 0 rx_xdp_tx: 0 rx_xdp_tx_full: 0 tx_csum_partial: 0 tx_csum_partial_inner: 0 tx_queue_stopped: 0 tx_queue_wake: 0 tx_queue_dropped: 0 tx_xmit_more: 0 rx_wqe_err: 0 rx_mpwqe_filler: 0 rx_buff_alloc_err: 0 rx_cqe_compress_blks: 0 rx_cqe_compress_pkts: 0 rx_page_reuse: 0 rx_cache_reuse: 0 rx_cache_alloc: 27328 rx_cache_full: 0 rx_cache_waive: 0 rx_cache_ext: 0 rx_cache_rdc: 0 link_down_events_phy: 0 rx_out_of_buffer: 0 rx_vport_unicast_packets: 230 rx_vport_unicast_bytes: 232108 tx_vport_unicast_packets: 232 tx_vport_unicast_bytes: 232228 rx_vport_multicast_packets: 374 rx_vport_multicast_bytes: 31047 tx_vport_multicast_packets: 36 tx_vport_multicast_bytes: 3104 rx_vport_broadcast_packets: 2 rx_vport_broadcast_bytes: 120 tx_vport_broadcast_packets: 0 tx_vport_broadcast_bytes: 0 rx_vport_rdma_unicast_packets: 0 rx_vport_rdma_unicast_bytes: 0 tx_vport_rdma_unicast_packets: 0 tx_vport_rdma_unicast_bytes: 0 rx_vport_rdma_multicast_packets: 0 rx_vport_rdma_multicast_bytes: 0 tx_vport_rdma_multicast_packets: 0 tx_vport_rdma_multicast_bytes: 0 tx_packets_phy: 268 rx_packets_phy: 606 rx_crc_errors_phy: 0 tx_bytes_phy: 236404 rx_bytes_phy: 265699 tx_multicast_phy: 36 tx_broadcast_phy: 0 rx_multicast_phy: 374 rx_broadcast_phy: 2 rx_in_range_len_errors_phy: 0 rx_out_of_range_len_phy: 0 rx_oversize_pkts_phy: 0 rx_symbol_err_phy: 0 tx_mac_control_phy: 0 rx_mac_control_phy: 0 rx_unsupported_op_phy: 0 rx_pause_ctrl_phy: 0 tx_pause_ctrl_phy: 0 rx_discards_phy: 0 tx_discards_phy: 0 tx_errors_phy: 0 rx_undersize_pkts_phy: 0 rx_fragments_phy: 0 rx_jabbers_phy: 0 rx_64_bytes_phy: 309 rx_65_to_127_bytes_phy: 47 rx_128_to_255_bytes_phy: 0 rx_256_to_511_bytes_phy: 28 rx_512_to_1023_bytes_phy: 0 rx_1024_to_1518_bytes_phy: 222 rx_1519_to_2047_bytes_phy: 0 rx_2048_to_4095_bytes_phy: 0 rx_4096_to_8191_bytes_phy: 0 rx_8192_to_10239_bytes_phy: 0 rx_pci_signal_integrity: 0 tx_pci_signal_integrity: 5 rx_prio0_bytes: 265699 rx_prio0_packets: 606 tx_prio0_bytes: 236404 tx_prio0_packets: 268 rx_prio1_bytes: 0 rx_prio1_packets: 0 tx_prio1_bytes: 0 tx_prio1_packets: 0 rx_prio2_bytes: 0 rx_prio2_packets: 0 tx_prio2_bytes: 0 tx_prio2_packets: 0 rx_prio3_bytes: 0 rx_prio3_packets: 0 tx_prio3_bytes: 0 tx_prio3_packets: 0 rx_prio4_bytes: 0 rx_prio4_packets: 0 tx_prio4_bytes: 0 tx_prio4_packets: 0 rx_prio5_bytes: 0 rx_prio5_packets: 0 tx_prio5_bytes: 0 tx_prio5_packets: 0 rx_prio6_bytes: 0 rx_prio6_packets: 0 tx_prio6_bytes: 0 tx_prio6_packets: 0 rx_prio7_bytes: 0 rx_prio7_packets: 0 tx_prio7_bytes: 0 tx_prio7_packets: 0 rx_global_pause: 0 rx_global_pause_duration: 0 tx_global_pause: 0 tx_global_pause_duration: 0 rx_global_pause_transition: 0 module_plug: 1 module_unplug: 0 module_pwr_budget_exd: 0 module_long_range: 0 module_bus_stuck: 0 module_no_eeprom: 0 module_enforce_part: 0 module_unknown_id: 0 module_high_temp: 0 module_bad_shorted: 0 module_unknown_status: 0
NIC statistics: rx_packets: 1 rx_bytes: 60 tx_packets: 3 tx_bytes: 250 tx_tso_packets: 0 tx_tso_bytes: 0 tx_tso_inner_packets: 0 tx_tso_inner_bytes: 0 rx_lro_packets: 0 rx_lro_bytes: 0 rx_csum_unnecessary: 0 rx_csum_none: 1 rx_csum_complete: 0 rx_csum_unnecessary_inner: 0 rx_xdp_drop: 0 rx_xdp_tx: 0 rx_xdp_tx_full: 0 tx_csum_partial: 0 tx_csum_partial_inner: 0 tx_queue_stopped: 0 tx_queue_wake: 0 tx_queue_dropped: 0 tx_xmit_more: 0 rx_wqe_err: 0 rx_mpwqe_filler: 0 rx_buff_alloc_err: 0 rx_cqe_compress_blks: 0 rx_cqe_compress_pkts: 0 rx_page_reuse: 0 rx_cache_reuse: 0 rx_cache_alloc: 27328 rx_cache_full: 0 rx_cache_waive: 0 rx_cache_ext: 0 rx_cache_rdc: 0 link_down_events_phy: 0 rx_out_of_buffer: 0 rx_vport_unicast_packets: 345 rx_vport_unicast_bytes: 348162 tx_vport_unicast_packets: 348 tx_vport_unicast_bytes: 348342 rx_vport_multicast_packets: 425 rx_vport_multicast_bytes: 35233 tx_vport_multicast_packets: 55 tx_vport_multicast_bytes: 4726 rx_vport_broadcast_packets: 3 rx_vport_broadcast_bytes: 180 tx_vport_broadcast_packets: 0 tx_vport_broadcast_bytes: 0 rx_vport_rdma_unicast_packets: 0 rx_vport_rdma_unicast_bytes: 0 tx_vport_rdma_unicast_packets: 0 tx_vport_rdma_unicast_bytes: 0 rx_vport_rdma_multicast_packets: 0 rx_vport_rdma_multicast_bytes: 0 tx_vport_rdma_multicast_packets: 0 tx_vport_rdma_multicast_bytes: 0 tx_packets_phy: 403 rx_packets_phy: 773 rx_crc_errors_phy: 0 tx_bytes_phy: 354680 rx_bytes_phy: 386667 tx_multicast_phy: 55 tx_broadcast_phy: 0 rx_multicast_phy: 425 rx_broadcast_phy: 3 rx_in_range_len_errors_phy: 0 rx_out_of_range_len_phy: 0 rx_oversize_pkts_phy: 0 rx_symbol_err_phy: 0 tx_mac_control_phy: 0 rx_mac_control_phy: 0 rx_unsupported_op_phy: 0 rx_pause_ctrl_phy: 0 tx_pause_ctrl_phy: 0 rx_discards_phy: 0 tx_discards_phy: 0 tx_errors_phy: 0 rx_undersize_pkts_phy: 0 rx_fragments_phy: 0 rx_jabbers_phy: 0 rx_64_bytes_phy: 346 rx_65_to_127_bytes_phy: 63 rx_128_to_255_bytes_phy: 0 rx_256_to_511_bytes_phy: 31 rx_512_to_1023_bytes_phy: 0 rx_1024_to_1518_bytes_phy: 333 rx_1519_to_2047_bytes_phy: 0 rx_2048_to_4095_bytes_phy: 0 rx_4096_to_8191_bytes_phy: 0 rx_8192_to_10239_bytes_phy: 0 rx_pci_signal_integrity: 0 tx_pci_signal_integrity: 5 rx_prio0_bytes: 386667 rx_prio0_packets: 773 tx_prio0_bytes: 354680 tx_prio0_packets: 403 rx_prio1_bytes: 0 rx_prio1_packets: 0 tx_prio1_bytes: 0 tx_prio1_packets: 0 rx_prio2_bytes: 0 rx_prio2_packets: 0 tx_prio2_bytes: 0 tx_prio2_packets: 0 rx_prio3_bytes: 0 rx_prio3_packets: 0 tx_prio3_bytes: 0 tx_prio3_packets: 0 rx_prio4_bytes: 0 rx_prio4_packets: 0 tx_prio4_bytes: 0 tx_prio4_packets: 0 rx_prio5_bytes: 0 rx_prio5_packets: 0 tx_prio5_bytes: 0 tx_prio5_packets: 0 rx_prio6_bytes: 0 rx_prio6_packets: 0 tx_prio6_bytes: 0 tx_prio6_packets: 0 rx_prio7_bytes: 0 rx_prio7_packets: 0 tx_prio7_bytes: 0 tx_prio7_packets: 0 rx_global_pause: 0 rx_global_pause_duration: 0 tx_global_pause: 0 tx_global_pause_duration: 0 rx_global_pause_transition: 0 module_plug: 1 module_unplug: 0 module_pwr_budget_exd: 0 module_long_range: 0 module_bus_stuck: 0 module_no_eeprom: 0 module_enforce_part: 0 module_unknown_id: 0 module_high_temp: 0 module_bad_shorted: 0 module_unknown_status: 0