All of lore.kernel.org
 help / color / mirror / Atom feed
From: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
To: David Woodhouse <dwmw2@infradead.org>
Cc: David Laight <David.Laight@ACULAB.COM>,
	Krzysztof Mazur <krzysiek@podlesie.net>,
	davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, nathan@traverse.com.au
Subject: Re: [PATCH v2 3/3] pppoatm: protect against freeing of vcc
Date: Thu, 29 Nov 2012 11:11:22 -0500	[thread overview]
Message-ID: <20121129111122.0c3698e1@thirdoffive.cmf.nrl.navy.mil> (raw)
In-Reply-To: <1354204748.21562.180.camel@shinybook.infradead.org>

On Thu, 29 Nov 2012 15:59:08 +0000
David Woodhouse <dwmw2@infradead.org> wrote:

> On Thu, 2012-11-29 at 10:37 -0500, chas williams - CONTRACTOR wrote:
> > you shouldnt clear ATM_VF_ADDR until the vpi/vci is actually closed and
> > ready for reuse.  at this point, it isnt.
> 
> So I should always wait for the completion of my PKT_CLOSE and only
> clear ATM_VF_ADDR when it's actually done?
> 
> But can you define 'ready for reuse'? From the moment I clear
> ATM_VF_ADDR, another CPU may enter my popen() function to set up another
> VCC with the same parameters, and everything should work fine. The
> PKT_POPEN will end up on the queue *after* my PKT_PCLOSE for the old
> VCC. Any received packets will be dropped until the new VCC gets
> ATM_VF_READY set (by the popen function).
> 
> What's the actual failure mode, caused by me clearing ATM_VF_ADDR "too
> early"?

there may not be one (due to serialization from other parts of the
atm stack) but you "shouldn't" clear ATM_VF_ADDR until the vpi/vci pair
is ready for reuse.  by reuse, i mean that any previous rx/tx data in
the vpi/vci segmentation hardware has been removed/cleared.

> >  ATM_VF_READY should already be clear at this point but you should set
> > it before you queue your PKT_CLOSE. 
> 
> I should *set* it? Do you mean clear it? Yes, I see it's cleared by

sorry, i did mean clear it.

> vcc_destroy_socket()... but all the other ATM drivers also seem to clear
> it for themselves, and that would appear to be harmless.

yeah, like i said, it is spuriously cleared in the drivers and should
probably just be moved to under the control of the next layer up
completely.  drivers/atm should just handle the hardware side, not the
software side.

> > checking for ATM_VF_READY in find_vcc() is probably going to give you
> > grief as well since ATM_VF_READY isnt entirely under your control. 
> 
> That's fine. If *anyone* has cleared ATM_VF_READY, I stop sending
> packets up it. Or, more to the point, I stop using the damn thing at
> all. See commit 1f6ea6e511e5ec730d8e88651da1b7b6e8fd1333.
> 
> >  you need to be able to find the vcc until after pclose() is finished since
> > your tasklet might have a few packets it is still processing?
> 
> The whole point of that check is that the tasklet *won't* be able to
> find it any more, and it'll just discard incoming packets for the
> obsolescent VCC.

that's fine as long as you understand this.  in the case of the he, i
needed to be able to find the vcc until close() is finished so that i
can wakeup the sleeper in the close() routine that is waiting for the
reassembly queue to be cleared/reset.  also, i still needed to find the
vcc for the tx side during close() since i still might need to pop()
skb's that are being sent during the close() while i am still trying to
get the hardware to shutdown the transmit dma engine.


  reply	other threads:[~2012-11-29 16:11 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 17:14 [PATCH v2 1/3] pppoatm: don't send frames to destroyed vcc Krzysztof Mazur
2012-10-22 17:14 ` [PATCH v2 2/3] pppoatm: fix race condition with destroying of vcc Krzysztof Mazur
2012-10-30  9:37   ` David Woodhouse
2012-10-30 19:07     ` Krzysztof Mazur
2012-10-30 19:52       ` Krzysztof Mazur
2012-10-31 10:16         ` David Woodhouse
2012-10-31 11:30           ` Krzysztof Mazur
2012-10-31 11:52             ` David Woodhouse
2012-10-30 14:26   ` Chas Williams (CONTRACTOR)
2012-10-30 18:20     ` Krzysztof Mazur
2012-10-31  9:41       ` Krzysztof Mazur
2012-10-31 10:22         ` Krzysztof Mazur
2012-10-31 20:03         ` chas williams - CONTRACTOR
2012-10-31 22:04           ` Krzysztof Mazur
2012-11-01 14:26             ` chas williams - CONTRACTOR
2012-11-02  9:40               ` Krzysztof Mazur
2012-11-02 10:54                 ` Krzysztof Mazur
2012-10-22 17:14 ` [PATCH v2 3/3] pppoatm: protect against freeing " Krzysztof Mazur
2012-10-30  9:39   ` David Woodhouse
2012-10-30 19:26     ` Krzysztof Mazur
2012-11-27 17:16   ` David Woodhouse
2012-11-27 17:39     ` Krzysztof Mazur
2012-11-27 18:02       ` David Woodhouse
2012-11-27 18:28         ` Krzysztof Mazur
2012-11-28 20:18           ` Krzysztof Mazur
2012-11-28 20:44             ` David Woodhouse
2012-11-28 21:24               ` Krzysztof Mazur
2012-11-28 21:20             ` chas williams - CONTRACTOR
2012-11-28 21:45               ` [PATCH] atm: introduce vcc_pop() Krzysztof Mazur
2012-11-28 21:59                 ` chas williams - CONTRACTOR
2012-11-28 22:10                   ` Krzysztof Mazur
2012-11-28 22:33                     ` [PATCH] atm: introduce vcc_pop_skb() Krzysztof Mazur
2012-12-03 13:22                       ` David Woodhouse
2012-12-03 20:11                         ` Krzysztof Mazur
2012-11-27 18:39         ` [PATCH v2 3/3] pppoatm: protect against freeing of vcc Krzysztof Mazur
2012-11-27 18:54         ` chas williams - CONTRACTOR
2012-11-27 22:36           ` [PATCH] solos-pci: Wait for pending TX to complete when releasing vcc David Woodhouse
2012-11-27 23:28             ` [PATCH] br2684: don't send frames on not-ready vcc David Woodhouse
2012-11-27 23:51               ` Krzysztof Mazur
2012-11-28  0:54                 ` David Woodhouse
2012-11-28  8:08                   ` Krzysztof Mazur
2012-11-28  9:58                     ` David Woodhouse
2012-11-28 16:41               ` David Miller
2012-11-28 17:01                 ` David Woodhouse
2012-11-28 17:04                   ` David Miller
2012-11-28 17:09                     ` David Woodhouse
2012-11-28 17:11                       ` David Miller
2012-11-30  1:18                       ` Nathan Williams
2012-11-30  1:34                         ` David Woodhouse
2012-11-28  9:21           ` [PATCH v2 3/3] pppoatm: protect against freeing of vcc David Laight
2012-11-28 10:04             ` Krzysztof Mazur
2012-11-28 10:24               ` David Woodhouse
2012-11-28 15:18                 ` chas williams - CONTRACTOR
2012-11-28 22:18             ` David Woodhouse
2012-11-29 10:57               ` Krzysztof Mazur
2012-11-29 11:55                 ` David Woodhouse
2012-11-29 12:43                   ` [PATCH] solos-pci: don't call vcc->pop() after pclose() Krzysztof Mazur
2012-11-29 12:57                     ` David Woodhouse
2012-11-29 13:20                       ` Krzysztof Mazur
2012-11-29 14:42                         ` David Woodhouse
2012-11-29 14:55                           ` Krzysztof Mazur
2012-11-29 14:41                     ` chas williams - CONTRACTOR
2012-11-29 14:29                 ` [PATCH v2 3/3] pppoatm: protect against freeing of vcc chas williams - CONTRACTOR
2012-11-29 15:09               ` Krzysztof Mazur
2012-11-29 15:47                 ` David Woodhouse
2012-11-29 15:59                   ` chas williams - CONTRACTOR
2012-11-29 16:24                     ` David Woodhouse
2012-11-29 17:17                       ` chas williams - CONTRACTOR
2012-11-29 18:11                         ` David Woodhouse
2012-11-29 18:29                           ` chas williams - CONTRACTOR
2012-11-29 22:17                             ` David Woodhouse
2012-11-30  1:38                               ` Chas Williams (CONTRACTOR)
2012-11-30  1:57                                 ` David Woodhouse
2012-11-30  8:25                                   ` David Woodhouse
2012-11-30  9:53                                     ` Krzysztof Mazur
2012-11-30 12:10                                       ` David Woodhouse
2012-11-30 16:23                                         ` David Woodhouse
2012-11-30 17:00                                           ` Krzysztof Mazur
2012-11-30 18:33                                             ` David Woodhouse
2012-11-30 17:12                                           ` chas williams - CONTRACTOR
2012-11-30 17:39                                             ` Krzysztof Mazur
2012-11-29 16:28                   ` Krzysztof Mazur
2012-11-29 15:37               ` chas williams - CONTRACTOR
2012-11-29 15:59                 ` David Woodhouse
2012-11-29 16:11                   ` chas williams - CONTRACTOR [this message]
2012-10-23  6:52 ` [PATCH v2 1/3] pppoatm: don't send frames to destroyed vcc David Miller
2012-10-23  8:12   ` David Woodhouse
2012-10-30  9:35 ` David Woodhouse
2012-10-30 20:19   ` Krzysztof Mazur

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=20121129111122.0c3698e1@thirdoffive.cmf.nrl.navy.mil \
    --to=chas@cmf.nrl.navy.mil \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=krzysiek@podlesie.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@traverse.com.au \
    --cc=netdev@vger.kernel.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.