Project

General

Profile

Actions

Optimization #3127

open

Unable to set XDP on 'ens2f0': Invalid argument (-22) - Mellanox cards and Intel cards with jumbo frames

Added by Srijan Nandi over 4 years ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Target version:
Effort:
Difficulty:
Label:

Description

I am getting this error. I thought this was fixed.

xdp-mode: driver
xdp-filter-file: /etc/suricata/ebpf/xdp_filter.bpf

[20473] 26/8/2019 -- 19:33:58 - (suricata.c:1071) <Notice> (LogVersion) -- This is Suricata version 5.0.0-dev (f43584661 2019-08-23) running in SYSTEM mode

[20474] 26/8/2019 -- 19:33:58 - (runmode-af-packet.c:272) <Info> (ParseAFPConfig) -- AF_PACKET IPS mode activated ens2f0->ens2f1
[20474] 26/8/2019 -- 19:33:58 - (util-ebpf.c:465) <Info> (EBPFLoadFile) -- Successfully loaded eBPF file '/etc/suricata/ebpf/xdp_filter.bpf' on 'ens2f0'
[20474] 26/8/2019 -- 19:33:58 - (util-ebpf.c:492) <Error> (EBPFSetupXDP) -- [ERRCODE: SC_ERR_INVALID_VALUE(130)] - Unable to set XDP on 'ens2f0': Invalid argument (-22)

-=Srijan Nandi


Files

suricata.txt (33.6 KB) suricata.txt suricata yaml Srijan Nandi, 08/26/2019 01:50 PM
Actions #1

Updated by Srijan Nandi over 4 years ago

Attached suricata.yaml file

Actions #2

Updated by Srijan Nandi over 4 years ago

    int err = bpf_set_link_xdp_fd(ifindex, fd, flags);
    if (err != 0) {
        char buf[129];
        libbpf_strerror(err, buf, sizeof(buf));
        SCLogError(SC_ERR_INVALID_VALUE, "Unable to set XDP on '%s': %s (%d)",
                iface, buf, err);
        return -1;
Actions #3

Updated by Srijan Nandi over 4 years ago

Removing mtu 9000 from /etc/network/interfaces, resolved the issue.

Actions #4

Updated by Peter Manev over 4 years ago

I don't think XDP supports 9k jumbo frames - https://www.spinics.net/lists/xdp-newbies/msg00525.html

Actions #5

Updated by Srijan Nandi over 4 years ago

Thank you, Peter.

Actions #6

Updated by Victor Julien over 4 years ago

  • Tracker changed from Support to Optimization
  • Subject changed from Unable to set XDP on 'ens2f0': Invalid argument (-22) - Mellanox cards and Intel cards to Unable to set XDP on 'ens2f0': Invalid argument (-22) - Mellanox cards and Intel cards with jumbo frames
  • Status changed from New to Assigned
  • Assignee set to Eric Leblond
  • Priority changed from Urgent to Normal
  • Target version set to TBD

@Eric Leblond, as we check the MTU we should be able to refuse to start in XDP mode in this case, right? With a helpful error message of course.

Actions #7

Updated by Victor Julien over 1 year ago

  • Status changed from Assigned to New
  • Assignee changed from Eric Leblond to Community Ticket
Actions

Also available in: Atom PDF