From patchwork Thu Oct 29 23:21:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Medvedkin X-Patchwork-Id: 8278 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 081265A50; Fri, 30 Oct 2015 00:21:55 +0100 (CET) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by dpdk.org (Postfix) with ESMTP id 9A7675A4F for ; Fri, 30 Oct 2015 00:21:53 +0100 (CET) Received: by lfbn126 with SMTP id n126so25707404lfb.2 for ; Thu, 29 Oct 2015 16:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ouOgMf/HH9l+FyS9g4vE8D6An54wE0ZOcqXwfFH55ZM=; b=mm/MC4ZYS5OmUudxtLp/baDcI8qxBN92aArpdxq0kv7ajREqe/sHbIB0mQs1davfHd JzAlG7M+BEle7Tt36DtsikA7oraYpG/DeR9hl+78c4cN4+sZ/9N1QCo3YqL5nVNaiOxv ihZug+Die9EkBdzFLozk3t1EKIuu9shi1T6h8oo3hNvzN/PtSwzRK+QQG014soadm8A1 WffzaVsgd4qW0Fg4cvIlBkfzNQ8u7br1QF8WfydCgAPtedB98MP3EBTLvKpZU0JETYOX NKVz9G3337vOFAYvzMYiGw48+SeJKNWAFlsTg/eDV7l2XBXFGf73Gixd6BTvIvii1knp OMFA== MIME-Version: 1.0 X-Received: by 10.25.152.70 with SMTP id a67mr1531549lfe.100.1446160913301; Thu, 29 Oct 2015 16:21:53 -0700 (PDT) Received: by 10.114.199.4 with HTTP; Thu, 29 Oct 2015 16:21:53 -0700 (PDT) In-Reply-To: <56327945.3090804@gandi.net> References: <56327945.3090804@gandi.net> Date: Fri, 30 Oct 2015 02:21:53 +0300 Message-ID: From: Vladimir Medvedkin To: Nikita Kozlov X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Release of Packet Journey X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Nikita, First of all thank you for published your project. Please apply this patch below without it your project is not compiled. Further your app breaks with segment fault. I run it as follows root@war202:~/PKTJ/packet-journey# ./build/app/x86_64-native-linuxapp-gcc/app/pktj -l 0,1,2,3 -n 4 --socket-mem=4096 --log-level=4 -- --configfile /home/medved/PKTJ/packet-journey/tests/integration/lab00/pktj.conf PKTJ_ACL: IPv6 ACL entries 0: PKTJ_ACL: IPv4 ACL entries 1: PKTJ_ACL: 1:PKTJ_ACL: 0.0.0.0/0 PKTJ_ACL: 1.2.6.0/24 PKTJ_ACL: 0 : 65535 0 : 65535 0x0/0x0 PKTJ_ACL: 0xffffffff-0x0-0xf0000000 PKTJ_ACL: acl context @0x7fd3bf41aa80 socket_id=0 alg=3 max_rules=100000 rule_size=96 num_rules=1 num_categories=1 num_tries=1 ACL: allocation of 9600904 bytes on socket 1 for ACL_pktj-acl-ipv41-0 failed PKTJ_ACL: Failed to create ACL context PKTJ_ACL: setup_acl failed for ipv4 with socketid 1, keeping previous rules for that socket ACL: allocation of 9600904 bytes on socket 2 for ACL_pktj-acl-ipv42-0 failed PKTJ_ACL: Failed to create ACL context PKTJ_ACL: setup_acl failed for ipv4 with socketid 2, keeping previous rules for that socket ACL: allocation of 9600904 bytes on socket 3 for ACL_pktj-acl-ipv43-0 failed PKTJ_ACL: Failed to create ACL context PKTJ_ACL: setup_acl failed for ipv4 with socketid 3, keeping previous rules for that socket Address:90:E2:BA:39:2A:D8 port=0 tx_queueid=3 nb_txd=512 kni launching control thread for socketid 0 on lcore 0 CMDLINE1: symlink() failed Segmentation fault Regards, Vladimir 2015-10-29 22:53 GMT+03:00 Nikita Kozlov : > Hello, > > We have opensourced our dpdk-based project, Packet Journey > https://github.com/Gandi/packet-journey . > > Packet Journey is a combinationof Linux RT_NETLINK and severalparts > ofDPDK (rte_kni, rte_lpm, rte_acl, rte_cmdline) and is intended to > serveas an edge router. > > Our use case is: > - pktj starts several forwarding threads and a KNI thread per external port > - pktj launches a script which configures the KNI interface (MAC, IP, > VLAN) and launches a BGP daemon > - the host receives routes from the BGP daemon > - the BGP daemon injects the routes in Linux > - pktj receives the routes from NETLINK and put them in LPM in our > "control" threads > - pktj forwards packets to the KNI if the packets are > - for the KNI IP or > - if the neighbor is not known yet > - if ttl reaches 0 > - pktj filters packets if they match an ACLor if they exceed the rate > limit, kni output is also rate-limited > - pktj forwards packetsdirectly from the RXqueue to the TXqueue if the > neighbor is known > > -- > Nikita > diff --git a/app/acl.h b/app/acl.h index fb2f73a..74a1dd5 100644 --- a/app/acl.h +++ b/app/acl.h @@ -72,4 +72,21 @@ extern struct acl_parm acl_parm_config; extern struct rte_acl_ctx *ipv4_acx[NB_SOCKETS]; extern struct rte_acl_ctx *ipv6_acx[NB_SOCKETS]; +/* + * That effectively defines order of IPV4VLAN classifications: + * - PROTO + * - VLAN (TAG and DOMAIN) + * - SRC IP ADDRESS + * - DST IP ADDRESS + * - PORTS (SRC and DST) + */ +enum { + RTE_ACL_IPV4VLAN_PROTO, + RTE_ACL_IPV4VLAN_VLAN, + RTE_ACL_IPV4VLAN_SRC, + RTE_ACL_IPV4VLAN_DST, + RTE_ACL_IPV4VLAN_PORTS, + RTE_ACL_IPV4VLAN_NUM +}; + #endif