All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/7]: ct_extend
@ 2007-05-07 12:00 Yasuyuki KOZAKAI
  2007-05-08  9:46 ` Patrick McHardy
  2007-05-30 23:43 ` Mohammad Mohsenzadeh
  0 siblings, 2 replies; 11+ messages in thread
From: Yasuyuki KOZAKAI @ 2007-05-07 12:00 UTC (permalink / raw)
  To: netfilter-devel; +Cc: rusty, kaber, pablo, kadlec


Hi all,

I'm re-writing ct_extend patchset. This patchset is a snapshot.
Like Rusty's original one, it allocates memory area by kmem_cache_alloc()
to store basic informations about a connection, but it uses kmalloc() to
allocate memory area for extension (currently helper and NAT).

Some concepts are following.
- 'struct ct_extend' keeps offsets to each area and the total size of them,
  instead of identifiers of extensions. This scheme can eliminate loops and
  make codes simple, but limits the total size of area to 256 bytes. Is it
  too small ? If so, we can be back to the original ct_extend.

- To add a new area, it reallocates ct_extend. To fix the pointer to it from
  other objects, the 'move' operation defined by extension is used.
  
- It does not have the operation to remove a memory area from
  ct_extend. Because it causes reallocating and restructuring ct_extend.
  It is complicated operation.  And removing extension from all conntracks
  would require heavy processing. I prefer to leave unused area.

- I added 'destroy' operation which is called in destroy_conntrack(). It
  can kill global operation 'nf_conntrack_destroyed' used by NAT.

The issues I noticed are following.
- This patchset does not consider locking. The places calling nfct_help() or
  nfct_nat() must be protected with new read-write lock. It will add
  some processing time and complexities.

- ct_extend_add() reallocates memory area for all extensions. All helpers
  and NAT codes are necessary to take care that the pointer nfct_help(ct)
  and nfct_nat(ct) might be changed. It would make difficult to find bugs
  caused by this issue.

And some improvements can be considered/are necessary.
- Introducing new locking
- 'move' operation might be better to have a argument 'struct nf_conn *ct'.
- Moving other stuff in 'struct nf_conn' to ct_extend
- Spliting nf_conn_nat into helper parts and others
- Fixes of function names (nf_ct_ext_, nfct_ext_, nf_cte_, or ?)

Comments are welcome.

-- Yasuyuki Kozakai

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-06-04 11:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-07 12:00 [RFC][PATCH 0/7]: ct_extend Yasuyuki KOZAKAI
2007-05-08  9:46 ` Patrick McHardy
2007-05-09 11:05   ` Yasuyuki KOZAKAI
     [not found]   ` <200705091105.l49B5DTu023689@toshiba.co.jp>
2007-05-10 12:34     ` Patrick McHardy
2007-05-11  1:51       ` Yasuyuki KOZAKAI
2007-05-30 23:43 ` Mohammad Mohsenzadeh
2007-05-31  4:38   ` Patrick McHardy
2007-05-31  9:02     ` Yasuyuki KOZAKAI
     [not found]     ` <200705310902.l4V9212d010654@toshiba.co.jp>
2007-06-01 15:33       ` Patrick McHardy
2007-06-04  0:45         ` Yasuyuki KOZAKAI
     [not found]         ` <200706040045.l540jnhh008964@toshiba.co.jp>
2007-06-04 11:58           ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.