From patchwork Fri Feb 10 15:18:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rose, Gregory V" X-Patchwork-Id: 140669 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 E5C5BB6F13 for ; Sat, 11 Feb 2012 02:17:59 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753210Ab2BJPR6 (ORCPT ); Fri, 10 Feb 2012 10:17:58 -0500 Received: from mga14.intel.com ([143.182.124.37]:24715 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529Ab2BJPR5 (ORCPT ); Fri, 10 Feb 2012 10:17:57 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 10 Feb 2012 07:17:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="105465151" Received: from gitlad.jf.intel.com ([10.23.23.37]) by azsmga001.ch.intel.com with ESMTP; 10 Feb 2012 07:17:56 -0800 Received: from gitlad.jf.intel.com (gitlad.jf.intel.com [127.0.0.1]) by gitlad.jf.intel.com (8.14.2/8.14.2) with ESMTP id q1AFI5c4004204; Fri, 10 Feb 2012 07:18:05 -0800 From: Greg Rose Subject: [RFC PATCH] iproute2: Add flag to indicate extended dump info To: netdev@vger.kernel.org Cc: shemminger@vyatta.com, davem@davemloft.net Date: Fri, 10 Feb 2012 07:18:05 -0800 Message-ID: <20120210151804.4175.12859.stgit@gitlad.jf.intel.com> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add flag to the ip link dump command to indicate to the kernel that the application is requesting the extended interface information such as VFs. The kernel will take this flag as an implicit indication that the application has allocated a 16K or larger buffer, which is what the 'ip' command in fact does. Signed-off-by: Greg Rose --- include/linux/netlink.h | 1 + lib/libnetlink.c | 2 +- 2 files changed, 2 insertions(+), 1 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/include/linux/netlink.h b/include/linux/netlink.h index 5c4f087..f913797 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -59,6 +59,7 @@ struct nlmsghdr { #define NLM_F_MATCH 0x200 /* return all matching */ #define NLM_F_ATOMIC 0x400 /* atomic GET */ #define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH) +#define NLM_F_EXT 0x800 /* Get extended interface info such as VFs */ /* Modifiers to NEW request */ #define NLM_F_REPLACE 0x100 /* Override existing */ diff --git a/lib/libnetlink.c b/lib/libnetlink.c index c581e11..f29da3d 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -99,7 +99,7 @@ int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type) memset(&req, 0, sizeof(req)); req.nlh.nlmsg_len = sizeof(req); req.nlh.nlmsg_type = type; - req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST; + req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST|NLM_F_EXT; req.nlh.nlmsg_pid = 0; req.nlh.nlmsg_seq = rth->dump = ++rth->seq; req.g.rtgen_family = family;