From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: rte_lpm with larger nexthops or another method? Date: Mon, 22 Jun 2015 23:51:02 -0400 Message-ID: <20150622235102.41c3619a@uryu.home.lan> References: <5A3882CB-0DE0-43DB-8DCA-051D561AA943@mhcomputing.net> <20150622175302.GA15788@mhcomputing.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "" To: Matthew Hall Return-path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by dpdk.org (Postfix) with ESMTP id AFCF1C74E for ; Tue, 23 Jun 2015 05:51:07 +0200 (CEST) Received: by paceq1 with SMTP id eq1so122917007pac.3 for ; Mon, 22 Jun 2015 20:51:07 -0700 (PDT) In-Reply-To: <20150622175302.GA15788@mhcomputing.net> 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" In order to make Vyatta/Brocade router work with LPM code I ended up redoing the layout. It is: /** Tbl24 entry structure. */ struct rte_lpm_tbl24_entry { /* Using single uint8_t to store 3 values. */ uint8_t valid :1; /**< Validation flag. */ uint8_t ext_entry :1; /**< external entry? */ uint8_t depth; /**< Rule depth. */ /* Stores Next hop or group index (i.e. gindex)into tbl8. */ union { uint16_t next_hop; uint16_t tbl8_gindex; }; }; /** Tbl8 entry structure. */ struct rte_lpm_tbl8_entry { uint16_t next_hop; /**< next hop. */ uint8_t depth; /**< Rule depth. */ uint8_t valid :1; /**< Validation flag. */ uint8_t valid_group :1; /**< Group validation flag. */ }; And also several other scalability improvements (plus IPv6) and the correct handling of /32. Unfortunately, this is such a big binary change that I was reluctant to break any tests or applications using existing code and therefore never submitted the patches.