From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-2.mimecast.com ([207.211.31.81]:46968 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725855AbgFCLHL (ORCPT ); Wed, 3 Jun 2020 07:07:11 -0400 Received: by mail-ed1-f70.google.com with SMTP id x11so903216edj.21 for ; Wed, 03 Jun 2020 04:07:07 -0700 (PDT) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: XDP_REDIRECT with xsks_map and dev_map In-Reply-To: <20200603104833.GA14391@ranger.igk.intel.com> References: <87d06hzvr8.fsf@toke.dk> <877dwpmp7f.fsf@toke.dk> <87lfl4l8zu.fsf@toke.dk> <20200603104833.GA14391@ranger.igk.intel.com> Date: Wed, 03 Jun 2020 13:07:05 +0200 Message-ID: <87ftbcl86e.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Sender: xdp-newbies-owner@vger.kernel.org List-ID: Content-Transfer-Encoding: 8bit To: Maciej Fijalkowski Cc: maharishi bhargava , xdp-newbies@vger.kernel.org Maciej Fijalkowski writes: > On Wed, Jun 03, 2020 at 12:49:25PM +0200, Toke Høiland-Jørgensen wrote: >> maharishi bhargava writes: >> >> > On Tue, Jun 2, 2020 at 9:31 PM Toke Høiland-Jørgensen wrote: >> >> >> >> maharishi bhargava writes: >> >> >> >> > On Tue 2 Jun, 2020, 14:31 Toke Høiland-Jørgensen, wrote: >> >> >> >> >> >> maharishi bhargava writes: >> >> >> >> >> >> > Hi, in my XDP program, I want to redirect some packets using AF_XDP >> >> >> > and redirect other packets directly from driver space. >> >> >> > Redirection through AF_XDP works fine, but redirection through dev map >> >> >> > stops after some packets are processed. >> >> >> >> >> >> Do you mean it stops even if you are *only* redirecting to a devmap, or >> >> >> if you are first redirecting a few packets to AF_XDP, then to devmap? >> >> >> >> >> >> Also, which driver(s) are the physical NICs you're redirecting to/from >> >> >> using, and which kernel version are you on? >> >> >> >> >> >> -Toke >> >> > >> >> > >> >> > >> >> > Currently, I'm trying to redirect packets only using devmap. But also >> >> > have code for redirection using AF_XDP(only when a given condition is >> >> > satisfied). A DPDK program is running in userspace which will receive >> >> > packets from AF_XDP. >> >> >> >> Right, so it's just devmap redirect that breaks. What do you mean >> >> 'redirection stops', exactly? How are you seeing this? Does xdp_monitor >> >> (from samples/bpf) report any exceptions? >> >> >> >> -Toke >> >> >> > So, In my setup, there are three systems, Let's Assume A, B, C. System >> > B is acting as a forwarder between A and C. So I can see the number of >> > packets received at system C. To be specific, only 1024 packets are >> > received. If I remove the xsks_map part from the code and don't run >> > DPDK in userspace. This problem does not occur. Also if I forward all >> > the packets using AF_XDP, there is no such issue. >> >> I thought you said you were seeing the problem when only redirecting to >> a devmap? So why does the xsk_map code impact this? I think you may have >> to share some code... > > Isn't the case here that either xsk_map or dev_map consumes the frame and > therefore the latter doesn't see it? so cloning might be needed here? Yeah, certainly you can't redirect *the same packet* to both xsk_map and devmap - but that wasn't what I understood was the use case here? -Toke