[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1265861913.4501.6.camel@localhost>
Date: Wed, 10 Feb 2010 20:18:33 -0800
From: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@...el.com>
To: David Miller <davem@...emloft.net>
Cc: "Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"gospo@...hat.com" <gospo@...hat.com>
Subject: Re: [net-next-2.6 PATCH v5 0/3] Introduce n-tuple ethtool support
On Wed, 2010-02-10 at 19:54 -0800, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> Date: Wed, 10 Feb 2010 18:07:18 -0800
>
> > One more round of fixes, based on feedback from Patrick McHardy
> >
> > 1) Change the list count to an unsigned value
> > 2) Fix a memory leak
> > 3) Removed an unnecessary list traversal in the ethtool core
> > 4) Moved all list destruction to a helper function, allowing the driver
> > to control when it clears the list (aside from when free_netdev() kills
> > the cached list).
>
> All applied, thanks.
>
> Pj, can you look a shoring up the behavior of one more thing for me?
>
> When rules get added, it first installs the filter by calling into
> the driver.
>
> _Then_ is tries to add the software copy of the rule to the device
> list. This does an allocation which may fail.
>
> If it does fail, we return -ENOMEM but we left the device configured
> with the new rule.
>
> Probably better to do it something like:
>
> p = NULL;
> if (need_sw_rule_list)
> p = alloc_rule();
> if (!p)
> return -ENOMEM;
> }
>
> ret = op->install_rule();
> if (ret) {
> kfree(p);
> return ret;
> }
>
> if (need_sw_rule_list)
> sw_rule_insert(dev, p);
>
> You get the idea, we can do the kfree() unconditonally because kfree(NULL)
> is OK, etc.
No problem. I'll get a patch together asap for 2.6.34.
Also, probably for 2.6.35, I'm going to try and add a remove capability.
Cheers,
-PJ
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists