From: Tinggong Wang <wangtinggong@gmail.com>
To: Simon Horman <horms@verge.net.au>
Cc: Wensong Zhang <wensong@linux-vs.org>,
lvs-devel@vger.kernel.org,
Hans Schillstrom <hans@schillstrom.com>,
Julian Anastasov <ja@ssi.bg>
Subject: Re: [PATCH 2/3] ipvs: check data validation before local_bh_disable
Date: Mon, 13 Dec 2010 11:44:38 +0800 [thread overview]
Message-ID: <20101213034438.GA3814@wangtg> (raw)
In-Reply-To: <20101212214806.GF7914@verge.net.au>
on Mon, 13 Dec 2010 06:48:06AM +0900 Simon Horman (horms@verge.net.au) wrote:
> [ CCed Hans Schillstrom and Julian Anastasov ]
>
> On Sun, Dec 12, 2010 at 07:42:29PM +0800, Tinggong Wang wrote:
> > Signed-off-by: Tinggong Wang <wangtinggong@gmail.com>
> > ---
> > net/netfilter/ipvs/ip_vs_sync.c | 13 ++++++++-----
> > 1 files changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
> > index 7632a17..2b6b0cb 100644
> > --- a/net/netfilter/ipvs/ip_vs_sync.c
> > +++ b/net/netfilter/ipvs/ip_vs_sync.c
> > @@ -315,11 +315,6 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
> > char *p;
> > int i;
> >
> > - if (buflen < SYNC_MESG_HEADER_LEN) {
> > - IP_VS_ERR_RL("sync message header too short\n");
> > - return;
> > - }
> > -
> > /* Convert size back to host byte order */
> > m->size = ntohs(m->size);
> >
> > @@ -823,6 +818,14 @@ static int sync_thread_backup(void *data)
> > break;
> > }
> >
> > + /* throw invalid data before local_bh_disable,
> > + * so performance won't be downgraded by it
> > + */
> > + if (len < SYNC_MESG_HEADER_LEN) {
> > + IP_VS_ERR_RL("sync message header too short\n");
> > + continue;
> > + }
> > +
> > /* disable bottom half, because it accesses the data
> > shared by softirq while getting/creating conns */
> > local_bh_disable();
> > --
> > 1.7.2.3
> >
>
> Could you explain the motivation for this change?
in my opinion, before local_bh_disable, should ensure packets are look
like more resonable.
local_bh_disable will disable all bottom-half processing on local cpu,
if the multicast group flood of packets containing bad sync message,
local cpu will be busy doing local_bh_disable and local_bh_enable.
if the backup pc has only one cpu, all other tasks will be pending until
the flood finished.
next prev parent reply other threads:[~2010-12-13 3:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-12 11:41 [PATCH 1/3] ipvs: use SYNC_MESG_HEADER_LEN instead of explicit header length Tinggong Wang
2010-12-12 11:42 ` [PATCH 2/3] ipvs: check data validation before local_bh_disable Tinggong Wang
2010-12-12 11:43 ` [PATCH 3/3] ipvs: fix get_curr_sync_buff Tinggong Wang
2010-12-12 21:49 ` Simon Horman
2010-12-13 9:21 ` Hans Schillstrom
2010-12-13 23:32 ` Julian Anastasov
2010-12-14 3:00 ` Tinggong Wang
2010-12-14 8:28 ` Julian Anastasov
2010-12-15 8:28 ` Simon Horman
2010-12-12 21:48 ` [PATCH 2/3] ipvs: check data validation before local_bh_disable Simon Horman
2010-12-13 3:44 ` Tinggong Wang [this message]
2010-12-13 6:29 ` Simon Horman
2010-12-13 8:53 ` Hans Schillstrom
2010-12-13 10:49 ` Tinggong Wang
2010-12-13 18:06 ` Tinggong Wang
2010-12-12 21:46 ` [PATCH 1/3] ipvs: use SYNC_MESG_HEADER_LEN instead of explicit header length Simon Horman
2010-12-13 8:16 ` Hans Schillstrom
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=20101213034438.GA3814@wangtg \
--to=wangtinggong@gmail.com \
--cc=hans@schillstrom.com \
--cc=horms@verge.net.au \
--cc=ja@ssi.bg \
--cc=lvs-devel@vger.kernel.org \
--cc=wensong@linux-vs.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 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.