From patchwork Fri Mar 6 05:21:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Feldman X-Patchwork-Id: 447023 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 866A81400DD for ; Fri, 6 Mar 2015 16:20:54 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=AWonUYUx; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754774AbbCFFUs (ORCPT ); Fri, 6 Mar 2015 00:20:48 -0500 Received: from mail-pd0-f178.google.com ([209.85.192.178]:35789 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754167AbbCFFUp (ORCPT ); Fri, 6 Mar 2015 00:20:45 -0500 Received: by pdbfp1 with SMTP id fp1so21277489pdb.2 for ; Thu, 05 Mar 2015 21:20:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=8vl5SAQUCaX2Zv50Z39L/7MHZx5Ull3VM7LHlkm8Sj0=; b=AWonUYUxVvkrj1QlF51ALzFGkZj1IqlaPMyZwDJDDvwsENUiF31czBA9m8+LR1HYM4 0zAkj9h+NnrPDwZLCj0AWxx9qsDmikTEqF1cj+hDLvOFdnLYjSdGjnEZ1GhLi0lSnKIL /OcP7lpl41gIyK/FdQVZgaNIVf4cwYkKaG+ljT5XH/GmNpK9Kd774k23ts1hCxT3OLFn uNQV77VgqBQ47AYZVg+bcgVqEf+xmNxKK6thxRvnGe0jJkSkcP02ffHlUS7d2Evrh2R4 0I31N+HJJGIwApBZekVX96Y26h2hCCDTrc6H1lR+5haYV5qJhLaa1MaddERDxXhvvOE1 i0xw== X-Received: by 10.68.135.72 with SMTP id pq8mr22481069pbb.160.1425619244089; Thu, 05 Mar 2015 21:20:44 -0800 (PST) Received: from rocker1.home (static-50-53-122-54.bvtn.or.frontiernet.net. [50.53.122.54]) by mx.google.com with ESMTPSA id f8sm8435073pdm.68.2015.03.05.21.20.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 21:20:43 -0800 (PST) From: sfeldma@gmail.com To: netdev@vger.kernel.org, davem@davemloft.net, jiri@resnulli.us, roopa@cumulusnetworks.com, alexander.h.duyck@redhat.com Subject: [PATCH net-next v4 6/8] ipv4: add net bool fib_offload_disabled Date: Thu, 5 Mar 2015 21:21:18 -0800 Message-Id: <1425619280-27492-7-git-send-email-sfeldma@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1425619280-27492-1-git-send-email-sfeldma@gmail.com> References: <1425619280-27492-1-git-send-email-sfeldma@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Scott Feldman If something goes wrong with IPv4 FIB offload, mark entire net offload disabled. This is brute force policy to basically shut down IPv4 FIB offload permanently if there is a problem offloading any route to an external device. We can refine the policy in the future, to handle failures on a per-device or per-route basis, but for now, this policy is per-net. What we're trying to avoid is an inconsistent split between the kernel's FIB and the offload device's FIB. We don't want the device to fwd a pkt inconsitent with what the kernel would do. An example of a split is if device has 10.0.0.0/16 and kernel has 10.0.0.0/16 and 10.0.0.0/24, the device wouldn't see the longest prefix 10.0.0.0/24 and potentially forward pkts incorrectly. Limited capacity or limited capability are two ways a route may fail to install to the offload device. We'll not differentiate between failures at this time, and treat any failure as fatal and mark the net as fib_offload_disabled. Signed-off-by: Scott Feldman --- include/net/netns/ipv4.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index db1db15..1085e12f 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -47,6 +47,7 @@ struct netns_ipv4 { int fib_num_tclassid_users; #endif struct hlist_head *fib_table_hash; + bool fib_offload_disabled; struct sock *fibnl; struct sock * __percpu *icmp_sk;