From mboxrd@z Thu Jan 1 00:00:00 1970 From: brouer@redhat.com (Jesper Dangaard Brouer) Date: Wed, 4 Oct 2017 17:07:55 +0200 Subject: [PATCH 0/1] XDP Program for Ip forward In-Reply-To: <1507016225-319-1-git-send-email-Christina.Jacob@cavium.com> References: <1507016225-319-1-git-send-email-Christina.Jacob@cavium.com> Message-ID: <20171004170755.4b1d8de4@redhat.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org First of all thank you for working on this. On Tue, 3 Oct 2017 13:07:04 +0530 cjacob wrote: > Usage: ./xdp3 [-S] > > -S to choose generic xdp implementation > [Default is driver xdp implementation] > ifindex - the index of the interface to which > the xdp program has to be attached. > in 4.14-rc3 kernel. I would prefer if we can name the program something more descriptive than "xdp3". What about "xdp_redirect_router" or "xdp_router_ipv4" ? I would also appreciate if we can stop using ifindex'es, and instead use normal device ifname's. And simply do the lookup to the ifindex in the program via if_nametoindex(ifname), see how in [1] and [2]. When adding more ifname's you can just use the same trick as with multiple --cpu options like [1] and [2]. [1] http://lkml.kernel.org/r/150711864538.9499.11712573036995600273.stgit at firesoul [2] https://github.com/netoptimizer/prototype-kernel/blob/master/kernel/samples/bpf/xdp_redirect_cpu_user.c -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752413AbdJDPIB (ORCPT ); Wed, 4 Oct 2017 11:08:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53516 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752242AbdJDPIA (ORCPT ); Wed, 4 Oct 2017 11:08:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ECA9E7EABE Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=brouer@redhat.com Date: Wed, 4 Oct 2017 17:07:55 +0200 From: Jesper Dangaard Brouer To: cjacob Cc: brouer@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 0/1] XDP Program for Ip forward Message-ID: <20171004170755.4b1d8de4@redhat.com> In-Reply-To: <1507016225-319-1-git-send-email-Christina.Jacob@cavium.com> References: <1507016225-319-1-git-send-email-Christina.Jacob@cavium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 04 Oct 2017 15:08:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org First of all thank you for working on this. On Tue, 3 Oct 2017 13:07:04 +0530 cjacob wrote: > Usage: ./xdp3 [-S] > > -S to choose generic xdp implementation > [Default is driver xdp implementation] > ifindex - the index of the interface to which > the xdp program has to be attached. > in 4.14-rc3 kernel. I would prefer if we can name the program something more descriptive than "xdp3". What about "xdp_redirect_router" or "xdp_router_ipv4" ? I would also appreciate if we can stop using ifindex'es, and instead use normal device ifname's. And simply do the lookup to the ifindex in the program via if_nametoindex(ifname), see how in [1] and [2]. When adding more ifname's you can just use the same trick as with multiple --cpu options like [1] and [2]. [1] http://lkml.kernel.org/r/150711864538.9499.11712573036995600273.stgit@firesoul [2] https://github.com/netoptimizer/prototype-kernel/blob/master/kernel/samples/bpf/xdp_redirect_cpu_user.c -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer