From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CCBAA0093; Fri, 23 Dec 2022 10:46:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A9E540A7F; Fri, 23 Dec 2022 10:46:47 +0100 (CET) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mails.dpdk.org (Postfix) with ESMTP id 204DB40698 for ; Fri, 23 Dec 2022 10:46:45 +0100 (CET) Received: by mail-ej1-f53.google.com with SMTP id fc4so10807160ejc.12 for ; Fri, 23 Dec 2022 01:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2x6ahFrxBy4xsJc34Hh1AdMn4JaHH5DT7WfmAVooS1k=; b=TiJyKoSONCba0MfZPPyNK4pLmOdsozQZs6spLoHt88hhqTb82Jyys+ZzZcjO4RckoX j2gsjBCS0WxctdWyfL5XLEYqj4AotvT0Z3YyUjDhylwdR+FDSEYhjOZHsheJAI2V93Rt va4rjO6O8KkZFP07/cKlKDRE7DYSWGlIE1zRAudf+4oPSyOiHCPevOD0cvhfgjJhbjxG iO367uNJSsfIgRa6fCjQAjog19Yc31ivZ/YVu+nRJoygksq6QazxS00waLwRBHsrNgZ4 z3RBOhtxBSUMQTkTNVWB3pwUhH//6qefnEEkdqd4nscukWAz5slqkbUyPy0Moxb+5Vw6 S5IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2x6ahFrxBy4xsJc34Hh1AdMn4JaHH5DT7WfmAVooS1k=; b=18JvrgqZbgZ+pxebtqoHybx3PZJFX19mqe+iq9sQj0KknQiQTySd0PllKAn35pBzU2 BxY25bPMUuwhF8Nk0ZHcgjkLYeL1kjmYxAh+tk49w4bU1DcK8tgc7ew2cLF6qNxeYrsi jY7Vg9cjtfNdL/TXOMZJ1uBSDcNFJj9JzFdz6pjqcmY10V5mZRp3dnJoeSoasYI1rnjE wq9cZENbSeXTgm20XuAHNowmlUvEX9CEnTFLu/zbtZq7k3P6/S3LN1aGGMvdZ3XGZAaO GwLbZaWycEVw60dIFPcSVA6YQtvZinmNEI88iupqPbggGP/HL/h9rbEzOGq8rVlg5Ln4 QMsA== X-Gm-Message-State: AFqh2koYIjQlOhU8ANWOXkgLjlFsujtWH35yDE/t2aQdautjV3KPyGrt Spdm1qO8cYH7Vb4amotEu5GONqp4hYmRI0pA1LGQbtkS/DJLhA== X-Google-Smtp-Source: AMrXdXuJ6DHt7Apmlp0Vr5Cn7FOgis83BXwGdypRDhLnTA5X/f1cm7Mi9FW/K02W42Uhoa8cXPdKAOP1fepymmHmEkk= X-Received: by 2002:a17:906:3989:b0:7c1:1f28:afed with SMTP id h9-20020a170906398900b007c11f28afedmr782925eje.678.1671788804423; Fri, 23 Dec 2022 01:46:44 -0800 (PST) MIME-Version: 1.0 From: Kamaraj P Date: Fri, 23 Dec 2022 15:16:33 +0530 Message-ID: Subject: DPDK - AF_XDP mode running as non-root privilege's To: dev Cc: Bruce Richardson , "Burakov, Anatoly" , Stephen Hemminger , sagarperuvaje@gmail.com, "ashck@cisco.com" Content-Type: multipart/alternative; boundary="000000000000d3c61805f07ba939" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --000000000000d3c61805f07ba939 Content-Type: text/plain; charset="UTF-8" Hi Team, Currently we are exploring our DPDK application using af_xdp in a non-root mode. When the DPDK application invokes AF_XDP, it calls xsk_umem__create() and thus requires CAP_IPC_LOCK capability to be enabled. if the application does not provide CAP_IPC_LOCK capability, it fails in the buffer allocation. Looks like the kernel is reporting ENOBUFS when xsk_umem__create() is invoked without CAP_IPC_LOCK. Can we use AF_XDP without any capability( to run as non-root mode) in our dpdk application ? Please advise us. Please see the code pointers. DPDK logs show eth_rx_queue_setup in rte_eth_af_xdp.c https://elixir.bootlin.com/dpdk/v21.11/source/drivers/net/af_xdp/rte_eth_af_xdp.c#L1346 https://elixir.bootlin.com/dpdk/v21.11/source/drivers/net/af_xdp/rte_eth_af_xdp.c#L1380 https://elixir.bootlin.com/dpdk/v21.11/source/drivers/net/af_xdp/rte_eth_af_xdp.c#L1257 https://elixir.bootlin.com/dpdk/v21.11/source/drivers/net/af_xdp/rte_eth_af_xdp.c#L1065 Please see the below DPDK logs: 12-23-2022 08:40:42.401426 EAL: Restoring previous memory policy: 0 12-23-2022 08:40:42.401443 EAL: request: mp_malloc_sync 12-23-2022 08:40:42.401447 EAL: No shared files mode enabled, IPC is disabled 12-23-2022 08:40:42.401451 EAL: Heap on socket 0 was expanded by 32MB 12-23-2022 08:40:42.402929 eth_rx_queue_setup(): Set up rx queue, rx queue id: 0, xsk queue id: 0 12-23-2022 08:40:42.402973 xdp_umem_configure(): Failed to create umem 12-23-2022 08:40:42.402980 xdp_umem_configure(): ret, error number and string -105, 105, No buffer space available 12-23-2022 08:40:42.402986 eth_rx_queue_setup(): Failed to configure xdp socket 12-23-2022 08:40:42.403013 eth_rx_queue_setup(): Set up rx queue, rx queue id: 0, xsk queue id: 0 12-23-2022 08:40:42.403030 xdp_umem_configure(): Failed to create umem 12-23-2022 08:40:42.403037 xdp_umem_configure(): ret, error number and string -105, 105, No buffer space available 12-23-2022 08:40:42.403042 eth_rx_queue_setup(): Failed to configure xdp socket 12-23-2022 08:40:42.403065 eth_rx_queue_setup(): Set up rx queue, rx queue id: 0, xsk queue id: 0 12-23-2022 08:40:42.403080 xdp_umem_configure(): Failed to create umem 12-23-2022 08:40:42.403085 xdp_umem_configure(): ret, error number and string -105, 105, No buffer space available Thanks, Kamaraj --000000000000d3c61805f07ba939 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team,

Currently we are exploring= our DPDK application=C2=A0using af_xdp in a non-root mode.
When = the DPDK application invokes AF_XDP, it calls=C2=A0xsk_umem__create() and t= hus requires CAP_IPC_LOCK capability=C2=A0to be enabled. if the application= does not provide=C2=A0CAP_IPC_LOCK capability, it fails in the buffer allo= cation.=C2=A0

Looks like the kernel is reporting E= NOBUFS when xsk_umem__create() is invoked without CAP_IPC_LOCK.
C= an we use AF_XDP without any capability( to run as non-root mode) in our dp= dk application ?=C2=A0
Please=C2=A0advise us.=C2=A0
Please see the code pointers.=C2=A0
DPDK logs show et= h_rx_queue_setup in rte_eth_af_xdp.c

Please see the below=C2=A0DPDK logs:=C2= =A0
12-23-2022 =C2=A008:40:42.401426 EAL: Restoring previous memo= ry policy: 0
12-23-2022 =C2=A008:40:42.401443 EAL: request: mp_malloc_sy= nc
12-23-2022 =C2=A008:40:42.401447 EAL: No shared files mode enabled, I= PC is disabled
12-23-2022 =C2=A008:40:42.401451 EAL: Heap on socket 0 wa= s expanded by 32MB
12-23-2022 =C2=A008:40:42.402929 eth_rx_queue_setup()= : Set up rx queue, rx queue id: 0, xsk queue id: 0
12-23-2022 =C2=A008:4= 0:42.402973 xdp_umem_configure(): Failed to create umem
12-23-2022 =C2= =A008:40:42.402980 xdp_umem_configure(): ret, error number and string -105,= 105, No buffer space available
12-23-2022 =C2=A008:40:42.402986 eth_rx_= queue_setup(): Failed to configure xdp socket
12-23-2022 =C2=A008:40:42.= 403013 eth_rx_queue_setup(): Set up rx queue, rx queue id: 0, xsk queue id:= 0
12-23-2022 =C2=A008:40:42.403030 xdp_umem_configure(): Failed to crea= te umem
12-23-2022 =C2=A008:40:42.403037 xdp_umem_configure(): ret, erro= r number and string -105, 105, No buffer space available
12-23-2022 =C2= =A008:40:42.403042 eth_rx_queue_setup(): Failed to configure xdp socket
= 12-23-2022 =C2=A008:40:42.403065 eth_rx_queue_setup(): Set up rx queue, rx = queue id: 0, xsk queue id: 0
12-23-2022 =C2=A008:40:42.403080 xdp_umem_c= onfigure(): Failed to create umem
12-23-2022 =C2=A008:40:42.403085 xdp_u= mem_configure(): ret, error number and string -105, 105, No buffer space av= ailable

Thanks,
Kamaraj
--000000000000d3c61805f07ba939--