]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: xdpsock: Add Dest and Src MAC setting for Tx-only operation
authorOng Boon Leong <boon.leong.ong@intel.com>
Thu, 30 Dec 2021 03:54:42 +0000 (11:54 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 6 Jan 2022 01:53:24 +0000 (17:53 -0800)
commit29baf9583f08586022ff70d8f789e0f7b9138bbd
treeb279c1eb7b9e20eb0e5af5bf205798ad99b8e616
parentafe908b8b1c0c9b11283e0030f268d14c71db628
samples/bpf: xdpsock: Add Dest and Src MAC setting for Tx-only operation

To set Dest MAC address (-G|--tx-dmac) only:
 $ xdpsock -i eth0 -t -N -z -G aa:bb:cc:dd:ee:ff

To set Source MAC address (-H|--tx-smac) only:
 $ xdpsock -i eth0 -t -N -z -H 11:22:33:44:55:66

To set both Dest and Source MAC address:
 $ xdpsock -i eth0 -t -N -z -G aa:bb:cc:dd:ee:ff \
   -H 11:22:33:44:55:66

The default Dest and Source MAC address remain the same as before.

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Link: https://lore.kernel.org/bpf/20211230035447.523177-3-boon.leong.ong@intel.com
samples/bpf/xdpsock_user.c