netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahide NAKAMURA <nakam@linux-ipv6.org>
To: David Miller <davem@davemloft.net>
Cc: yoshfuji@linux-ipv6.org, anttit@tcs.hut.fi, vnuorval@tcs.hut.fi,
	netdev@vger.kernel.org, usagi-core@linux-ipv6.org
Subject: Re: [PATCH 7/23] [PATCH] [XFRM] STATE: Add a hook to find where to be inserted header in outbound.
Date: Wed, 02 Aug 2006 11:20:30 +0900	[thread overview]
Message-ID: <44D00BEE.8090504@linux-ipv6.org> (raw)
In-Reply-To: <20060801.170916.21925105.davem@davemloft.net>

David Miller wrote:
> From: Masahide NAKAMURA <nakam@linux-ipv6.org>
> Date: Sat, 29 Jul 2006 18:30:23 +0900
> 
>> @@ -270,6 +270,7 @@ struct xfrm_type
>>  	void			(*destructor)(struct xfrm_state *);
>>  	int			(*input)(struct xfrm_state *, struct sk_buff *skb);
>>  	int			(*output)(struct xfrm_state *, struct sk_buff *pskb);
>> +	int			(*place_find)(struct xfrm_state *, struct sk_buff *, u8 **);
>>  	/* Estimate maximal size of result of transformation of a dgram */
>>  	u32			(*get_max_size)(struct xfrm_state *, int size);
>>  };
> 
> I see a dangerous pattern of adding many, many, many methods
> to the xfrm_type structure which are only used by ipv6.
> But I cannot suggest another method.

Sometimes this is a difficult point for me to design.


> There are frequent calls of the form:
> 
> 	if (x->type->op != NULL)
> 		x->type->op(x, y, z);
> 	else
> 		foo(y, z);
> 
> it might be nicer to hide all of this behind carefully crafted
> inline functions.

I'll fix it. James gave me this comment, too.

BTW he also gave me another point:

> Maybe also change the naming of ->place_find to ->hdr_offset

I'll use this idea, too.

Thank you.

-- 
Masahide NAKAMURA

  reply	other threads:[~2006-08-02  2:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-29  9:30 [PATCH 7/23] [PATCH] [XFRM] STATE: Add a hook to find where to be inserted header in outbound Masahide NAKAMURA
2006-07-30 23:31 ` James Morris
2006-08-02  0:09 ` David Miller
2006-08-02  2:20   ` Masahide NAKAMURA [this message]
2006-08-02  4:11     ` David Miller
2006-08-02  8:31       ` Masahide NAKAMURA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44D00BEE.8090504@linux-ipv6.org \
    --to=nakam@linux-ipv6.org \
    --cc=anttit@tcs.hut.fi \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=usagi-core@linux-ipv6.org \
    --cc=vnuorval@tcs.hut.fi \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).