From patchwork Tue Feb 24 23:40:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 23645 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 249E9DDD04 for ; Wed, 25 Feb 2009 10:41:03 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757569AbZBXXk6 (ORCPT ); Tue, 24 Feb 2009 18:40:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757511AbZBXXk6 (ORCPT ); Tue, 24 Feb 2009 18:40:58 -0500 Received: from qmta08.westchester.pa.mail.comcast.net ([76.96.62.80]:59542 "EHLO QMTA08.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757317AbZBXXk5 (ORCPT ); Tue, 24 Feb 2009 18:40:57 -0500 Received: from OMTA10.westchester.pa.mail.comcast.net ([76.96.62.28]) by QMTA08.westchester.pa.mail.comcast.net with comcast id KzE41b0090cZkys58zgv9g; Tue, 24 Feb 2009 23:40:55 +0000 Received: from lost.foo-projects.org ([63.64.152.142]) by OMTA10.westchester.pa.mail.comcast.net with comcast id Kzge1b00Z34bfcX3Wzghqf; Tue, 24 Feb 2009 23:40:53 +0000 From: Jeff Kirsher Subject: [net-next PATCH 1/2] ixgbe: Move ring features into an enum, allowing easier future maintenance To: davem@davemloft.net Cc: netdev@vger.kernel.org, gospo@redhat.com, Peter P Waskiewicz Jr , Jeff Kirsher Date: Tue, 24 Feb 2009 15:40:37 -0800 Message-ID: <20090224234037.29312.54427.stgit@lost.foo-projects.org> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Shannon Nelson The ring_feature member of ixgbe_adapter is statically allocated based on the supported features of the device. When a new feature is added, we need to manually update the static allocation. This patch makes the feature list an enum, eliminating the need for multiple updates to the code when adding a new feature. Signed-off-by: Peter P Waskiewicz Jr Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe.h | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index e98ace8..c0e56aa 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -148,9 +148,15 @@ struct ixgbe_ring { u16 rx_buf_len; }; -#define RING_F_DCB 0 -#define RING_F_VMDQ 1 -#define RING_F_RSS 2 +enum ixgbe_ring_f_enum { + RING_F_NONE = 0, + RING_F_DCB, + RING_F_VMDQ, + RING_F_RSS, + + RING_F_ARRAY_SIZE /* must be last in enum set */ +}; + #define IXGBE_MAX_DCB_INDICES 8 #define IXGBE_MAX_RSS_INDICES 16 #define IXGBE_MAX_VMDQ_INDICES 16 @@ -249,7 +255,7 @@ struct ixgbe_adapter { u64 non_eop_descs; int num_msix_vectors; int max_msix_q_vectors; /* true count of q_vectors for device */ - struct ixgbe_ring_feature ring_feature[3]; + struct ixgbe_ring_feature ring_feature[RING_F_ARRAY_SIZE]; struct msix_entry *msix_entries; u64 rx_hdr_split;