On Thu, Jan 02, 2003 at 01:53:53PM -0500, Andrew Gallatin wrote: > I'm just tuning up my driver now to catch up to the "recent" interface > changes. While there, I went to add a ref count for my driver managed > M_EXT clusters. However, m_extadd() does not take a parameter for > assignment into mp->m_ext.ref_cnt Eg, I cannot call m_extadd() if I > want to use my own refcounter. > > Is there any chance this could be fixed? O/w, I'll have to > avoid calling m_extadd()..
I dunno. I hate the whole story behind the reference counters in the mbuf code and I don't know what the correct approach here would be. A long long while back I think m_extadd (or its equivalent) did allow something like this. Then, we changed it so that counters would be allocated by the mbuf code 'transparently' (i.e., so that the Rest Of The World didn't have to worry about it). However, not long ago, I changed the way reference counters were allocated for mbuf clusters so that it would be faster. Counters for other objects are allocated with malloc(). The only 'correct' (half-assed) solution I can see is to allow m_extadd() to take a 'refcount' argument (again?) - perhaps leave a backwards-compatible m_extadd() and add a m_addext() or something - and only call malloc() for the counter if refcnt_provided == NULL. To be honest, I don't really like the idea but I don't see a better solution. Right now, ref counting for regular mbuf clusters works fine and is pretty damn fast, but I don't know how I could make it happen for other external buffer types other than the way I just described. > Thanks, > > Drew -- Bosko Milekic * [EMAIL PROTECTED] * [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message