)]}'
{
  "commit": "d17792ebdf90289c9fd1bce888076d3d60ecd53b",
  "tree": "5b649c673b00d159c1a571387fead761cef570fe",
  "parents": [
    "723b2f57ad83ee7087acf9a95e8e289414b1f521"
  ],
  "author": {
    "name": "Jeff Garzik",
    "email": "jeff@garzik.org",
    "time": "Thu Mar 04 08:21:53 2010 +0000"
  },
  "committer": {
    "name": "David S. Miller",
    "email": "davem@davemloft.net",
    "time": "Fri Mar 05 14:00:17 2010 -0800"
  },
  "message": "ethtool: Add direct access to ops-\u003eget_sset_count\n\nOn 03/04/2010 09:26 AM, Ben Hutchings wrote:\n\u003e On Thu, 2010-03-04 at 00:51 -0800, Jeff Kirsher wrote:\n\u003e\u003e From: Jeff Garzik\u003cjgarzik@redhat.com\u003e\n\u003e\u003e\n\u003e\u003e This patch is an alternative approach for accessing string\n\u003e\u003e counts, vs. the drvinfo indirect approach.  This way the drvinfo\n\u003e\u003e space doesn\u0027t run out, and we don\u0027t break ABI later.\n\u003e [...]\n\u003e\u003e --- a/net/core/ethtool.c\n\u003e\u003e +++ b/net/core/ethtool.c\n\u003e\u003e @@ -214,6 +214,10 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use\n\u003e\u003e   \tinfo.cmd \u003d ETHTOOL_GDRVINFO;\n\u003e\u003e   \tops-\u003eget_drvinfo(dev,\u0026info);\n\u003e\u003e\n\u003e\u003e +\t/*\n\u003e\u003e +\t * this method of obtaining string set info is deprecated;\n\u003e\u003e +\t * consider using ETHTOOL_GSSET_INFO instead\n\u003e\u003e +\t */\n\u003e\n\u003e This comment belongs on the interface (ethtool.h) not the\n\u003e implementation.\n\nDebatable -- the current comment is located at the callsite of\nops-\u003eget_sset_count(), which is where an implementor might think to add\na new call.  Not all the numeric fields in ethtool_drvinfo are obtained\nfrom -\u003eget_sset_count().\n\nHence the \"some\" in the attached patch to include/linux/ethtool.h,\naddressing your comment.\n\n\u003e [...]\n\u003e\u003e +static noinline int ethtool_get_sset_info(struct net_device *dev,\n\u003e\u003e +                                          void __user *useraddr)\n\u003e\u003e +{\n\u003e [...]\n\u003e\u003e +\t/* calculate size of return buffer */\n\u003e\u003e +\tfor (i \u003d 0; i\u003c  64; i++)\n\u003e\u003e +\t\tif (sset_mask\u0026  (1ULL\u003c\u003c  i))\n\u003e\u003e +\t\t\tn_bits++;\n\u003e [...]\n\u003e\n\u003e We have a function for this:\n\u003e\n\u003e \tn_bits \u003d hweight64(sset_mask);\n\nAgreed.\n\nI\u0027ve attached a follow-up patch, which should enable my/Jeff\u0027s kernel\npatch to be applied, followed by this one.\n\nSigned-off-by: Jeff Garzik \u003cjgarzik@redhat.com\u003e\nSigned-off-by: David S. Miller \u003cdavem@davemloft.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f6f961fefbe53c6f7c3a97e65d9aa47806dccb71",
      "old_mode": 33188,
      "old_path": "include/linux/ethtool.h",
      "new_id": "b33f316bb92e0f984c5ed593ed48e845fb242cba",
      "new_mode": 33188,
      "new_path": "include/linux/ethtool.h"
    },
    {
      "type": "modify",
      "old_id": "70075c47ada82beeaa5ca59046787fefeeee89cb",
      "old_mode": 33188,
      "old_path": "net/core/ethtool.c",
      "new_id": "33d2ded50f84d282c37e30c520b9745733a872eb",
      "new_mode": 33188,
      "new_path": "net/core/ethtool.c"
    }
  ]
}
