public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: David Miller <davem@davemloft.net>,
	bhaskie@gmail.com, bhutchings@solarflare.com,
	netdev@vger.kernel.org
Subject: Re: TCP-MD5 checksum failure on x86_64 SMP
Date: Fri, 07 May 2010 23:40:46 +0200	[thread overview]
Message-ID: <1273268446.2325.53.camel@edumazet-laptop> (raw)
In-Reply-To: <20100507103639.4f1a51fa@nehalam>

Le vendredi 07 mai 2010 à 10:36 -0700, Stephen Hemminger a écrit :
> On Fri, 07 May 2010 19:21:33 +0200
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
> 
> > Le vendredi 07 mai 2010 à 10:14 -0700, Stephen Hemminger a écrit :
> > 
> > > Forget the per cpu data; the pool should just be scrapped.
> > > 
> > > The only reason the pool exists is that the crypto hash state which
> > > should just be moved into the md5_info (88 bytes).  The pseudo
> > > header can just be generated on the stack before passing to the crypto
> > > code.
> > 
> > 
> > Sure, but I'm afraid there is no generic API do do that (if we want to
> > reuse crypto/md5.c code).
> 
> It looks like the pool is just an optimization to avoid opening too
> many crypto API connections.  This should only be an issue if offloading
> MD5.

You mean we could allocate two contexts per socket, one for tx path, one
for rx path, but TCP-MD5 implementors chose to use percpu allocations to
factorize them. They should have allocated two contexts per cpu (one for
process context, preemption disabled, one for BH context)

As you said, this could be allocated on stack, with some changes to
crypto API I guess. Since TCP is not a module, md5 is also static, so
there is no module loading involved.

struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32
type,u32 mask)

-->

struct crypto_tfm *__crypto_alloc_tfm_onstack(struct crypto_alg *alg,
u32 type, u32 mask, void *storage, size_t storage_max_length)


Or a direct plug to crypto/md5.c functions and hand crafted context.




  reply	other threads:[~2010-05-07 21:40 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <i2h571fb4001005031027y4a58c4dtfd28ddcdc08d8401@mail.gmail.com>
2010-05-04  3:30 ` TCP-MD5 checksum failure on x86_64 SMP Bhaskar Dutta
2010-05-04 11:32   ` Ben Hutchings
2010-05-04 14:28     ` Bhaskar Dutta
2010-05-04 16:12       ` Stephen Hemminger
2010-05-04 17:08         ` Bhaskar Dutta
2010-05-04 17:13           ` Stephen Hemminger
2010-05-05 18:03             ` Bhaskar Dutta
2010-05-05 18:53               ` Eric Dumazet
2010-05-06 11:55                 ` Bhaskar Dutta
2010-05-06 12:06                   ` Eric Dumazet
2010-05-07  5:04                     ` David Miller
2010-05-07  5:32                       ` Eric Dumazet
2010-05-07 17:14                         ` Stephen Hemminger
2010-05-07 17:21                           ` Eric Dumazet
2010-05-07 17:36                             ` Stephen Hemminger
2010-05-07 21:40                               ` Eric Dumazet [this message]
2010-05-10 14:55                                 ` Bijay Singh
2010-05-10 15:18                                   ` Eric Dumazet
2010-05-10 17:27                                     ` Bijay Singh
2010-05-11  4:08                                     ` Bijay Singh
2010-05-11  6:27                                       ` Eric Dumazet
2010-05-11  8:23                                         ` Bijay Singh
2010-05-11 20:50                                       ` Eric Dumazet
2010-05-12  3:20                                         ` Eric Dumazet
2010-05-12 22:22                                           ` Stephen Hemminger
2010-05-12 22:24                                             ` David Miller
2010-05-16 19:53                                               ` Eric Dumazet
2010-05-16 20:48                                         ` Eric Dumazet
2010-05-17  3:49                                           ` Bijay Singh
2010-05-17  5:03                                             ` Eric Dumazet
2010-05-17 17:22                                               ` Stephen Hemminger
2010-05-17 20:42                                               ` Stephen Hemminger
2010-05-17 21:04                                                 ` [PATCH] tcp: tcp_synack_options() fix Eric Dumazet
2010-05-18  5:35                                                   ` David Miller
2010-05-16  7:30                               ` TCP-MD5 checksum failure on x86_64 SMP David Miller
2010-05-07  8:46                     ` Lars Eggert
2010-05-07  8:55                       ` Eric Dumazet
2010-05-07  9:12                       ` David Miller
2010-05-07  5:39                   ` Eric Dumazet
2010-05-07  8:00                     ` Eric Dumazet
2010-05-07  8:59                       ` Bhaskar Dutta
2010-05-07  9:37                         ` Eric Dumazet
2010-05-07 10:50                           ` Bhaskar Dutta
2010-05-07 15:18                             ` Eric Dumazet
2010-05-07 15:44                               ` Eric Dumazet
2010-05-07 21:18                                 ` Eric Dumazet
2010-05-16  7:37                                   ` David Miller
2010-05-16  7:35                       ` David Miller

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=1273268446.2325.53.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=bhaskie@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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