From patchwork Fri Feb 26 13:59:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Garzik X-Patchwork-Id: 46331 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 C3123B7CFA for ; Sat, 27 Feb 2010 00:59:29 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936265Ab0BZN7Z (ORCPT ); Fri, 26 Feb 2010 08:59:25 -0500 Received: from mail-yw0-f197.google.com ([209.85.211.197]:40055 "EHLO mail-yw0-f197.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936288Ab0BZN7Y (ORCPT ); Fri, 26 Feb 2010 08:59:24 -0500 Received: by ywh35 with SMTP id 35so43577ywh.4 for ; Fri, 26 Feb 2010 05:59:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type; bh=/thJjLrVd1nA5wVbvFxVfzQNwH8iGMoCIwd4LftFz08=; b=KbxQ0H8p6WUJlFP3fSp31NWGrgmeoxkN7mFClGQEI+NspBZIhzRUBra7/yrtnjR76P 9FmDkMO77B/Qtg7u/9E1p8jkFu7ajNjKkNgtDuQU0PnFXVgC1Mc6Ejb5iIpM1ybkp4uE xDXabP9yb+oxAFXQTSHBHZWtm/SuJSCgZP9oE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; b=ix/zxIMloAG7+TgHanf1nk0HlZlSP81/R84lWhOWKRBXxqwRW6gO2wAUksMzQkfXYE YwVIrRacs1UtL8Do3orVySr5uZwSHFytWIrb8/GBvPHn7yJlSaHbBrNYoVwH4Z1s6n44 LBRgCA4LMBSto1r9DjcHDWNU5TBHBzgvMET0k= Received: by 10.101.145.27 with SMTP id x27mr656223ann.77.1267192763840; Fri, 26 Feb 2010 05:59:23 -0800 (PST) Received: from bd.yyz.us (cpe-069-134-158-197.nc.res.rr.com [69.134.158.197]) by mx.google.com with ESMTPS id 15sm78722gxk.2.2010.02.26.05.59.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 26 Feb 2010 05:59:23 -0800 (PST) Message-ID: <4B87D3BA.7050404@garzik.org> Date: Fri, 26 Feb 2010 08:59:22 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc11 Thunderbird/3.0.1 MIME-Version: 1.0 To: Jeff Kirsher CC: davem@davemloft.net, netdev@vger.kernel.org, gospo@redhat.com, Peter P Waskiewicz Jr Subject: Re: [net-next-2.6 PATCH] ethtool: Add n-tuple string length to drvinfo and return it References: <20100226115355.20213.59254.stgit@localhost.localdomain> <4B87D31B.4000001@garzik.org> In-Reply-To: <4B87D31B.4000001@garzik.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 02/26/2010 08:56 AM, Jeff Garzik wrote: > However, perhaps consider the following patch for returning n-tuple > count, for four reasons: > > 1) space in ethtool_drvinfo is limited > > 2) the patch below permits trivial string set addition, without > ABI changes beyond adding a new ETH_SS_xxx constant. > > 3) the patch below permits direct access to ops->get_sset_count(), > rather than implicit access via ethtool_drvinfo > > 4) ethtool_drvinfo interface does not permit indication of > ops->get_sset_count() failure, versus returning zero value. The > patch below does so, via output sset_mask. > > WARNING: this patch is compile-tested only. > > NOTE: I added a cosmetic fix to ETHTOOL_[GS]RXNTUPLE constants, making > their indentation consistent with the rest of the list of constants. > > Signed-off-by: Jeff Garzik With, perhaps, a note like the attached as a reminder to folks about future additions. diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 31b1edd..e376e8c 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -212,6 +212,9 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use info.cmd = ETHTOOL_GDRVINFO; ops->get_drvinfo(dev, &info); + /* this method of obtaining string set info is deprecated; + * consider using ETHTOOL_GSSET_INFO instead + */ if (ops->get_sset_count) { int rc;