From patchwork Wed Oct 28 14:15:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 37110 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.176.167]) by ozlabs.org (Postfix) with ESMTP id DD6C9B7BF1 for ; Thu, 29 Oct 2009 01:16:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753981AbZJ1OPp (ORCPT ); Wed, 28 Oct 2009 10:15:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753977AbZJ1OPo (ORCPT ); Wed, 28 Oct 2009 10:15:44 -0400 Received: from xenbox.codefidence.com ([92.48.73.16]:58555 "EHLO xenbox.codefidence.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753923AbZJ1OPc (ORCPT ); Wed, 28 Oct 2009 10:15:32 -0400 Received: by xenbox.codefidence.com (Postfix, from userid 56) id 3B09924635; Wed, 28 Oct 2009 10:15:37 -0400 (EDT) Received: (nullmailer pid 11602 invoked by uid 1000); Wed, 28 Oct 2009 14:15:27 -0000 From: Gilad Ben-Yossef To: netdev@vger.kernel.org Cc: ori@comsleep.com Subject: [PATCHv4 3/7] Add dst_feature to query route entry features Date: Wed, 28 Oct 2009 16:15:23 +0200 Message-Id: <1256739327-11576-4-git-send-email-gilad@codefidence.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1256739327-11576-1-git-send-email-gilad@codefidence.com> References: <1256739327-11576-1-git-send-email-gilad@codefidence.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Adding an accessor to existing dst_entry feautres field and refactor the only supported feature (allfrag) to use it. Signed-off-by: Gilad Ben-Yossef Sigend-off-by: Ori Finkelman Sigend-off-by: Yony Amit --- include/net/dst.h | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/include/net/dst.h b/include/net/dst.h index 5a900dd..b562be3 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -111,6 +111,12 @@ dst_metric(const struct dst_entry *dst, int metric) return dst->metrics[metric-1]; } +static inline u32 +dst_feature(const struct dst_entry *dst, u32 feature) +{ + return dst_metric(dst, RTAX_FEATURES) & feature; +} + static inline u32 dst_mtu(const struct dst_entry *dst) { u32 mtu = dst_metric(dst, RTAX_MTU); @@ -136,7 +142,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, static inline u32 dst_allfrag(const struct dst_entry *dst) { - int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG; + int ret = dst_feature(dst, RTAX_FEATURE_ALLFRAG); /* Yes, _exactly_. This is paranoia. */ barrier(); return ret;