mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Matt Mackall <mpm@selenic.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: netconsole hangs w/ alt-sysrq-t
Date: Mon, 28 Jun 2004 10:48:41 -0400	[thread overview]
Message-ID: <16608.12233.39964.940020@segfault.boston.redhat.com> (raw)
In-Reply-To: <20040625232711.GE25826@waste.org>

==> Regarding Re: netconsole hangs w/ alt-sysrq-t; Matt Mackall <mpm@selenic.com> adds:

[snip]

mpm> Huh. I'm not sure if that covers everything.

mpm> We want to:

mpm> a) push stuff through netpoll_rx() iff rx is enabled b) drop packets
mpm> when netpoll_rx() says to c) drop packets when we're trapped for
mpm> debugging/netdump d) drop packets when we manually call dev->poll e)
mpm> keep as little overhead as possible

mpm> The above breaks (a) when we're not trapped (consider breaking in with
mpm> debugger) and (b) in any case.

mpm> My current thought is we want to get this down to a single test in the
mpm> fastpath by replacing netpoll_rx in skb->dev with a flag that is equal
mpm> to netpoll_trapped() | dev->netpoll_rx, which we manipulate when call
dev-> poll within netpoll.

mpm> How's that sound?

That sounds fine.  So, in the netif_receive_skb function, we'd now have
something like:

	if (skb->dev->netpoll_rx && netpoll_rx(skb)) {
		kfree_skb(skb);
		return NET_RX_DROP;
	}

I removed the test for skb->dev->poll, since this is the NAPI code path, I
think it should always be present, right?

And then at the top of the netpoll_rx routine:

	if (!(skb->dev->netpoll_rx & NETPOLL_RX_ENABLED))
		goto out;

The routine, as before, returns the value of trapped.  And now,
netpoll_poll would do this:

	if(np->dev->poll && test_bit(__LINK_STATE_RX_SCHED, &np->dev->state)) {
		np->dev->netpoll_rx |= NETPOLL_RX_TRAPPED;
		if (trapped)
			np->dev->poll(np->dev, &budget);
		else {
			trapped = 1;
			np->dev->poll(np->dev, &budget);
			trapped = 0;
		}
		np->dev->netpoll_rx &= ~NETPOLL_RX_TRAPPED;
	}

Is this more in line with what you had in mind?  One thing I would consider
changing, here, is having netpoll_set_trap take a struct netpoll argument.
That way, we could have netpoll_set_trap manipulate the NETPOLL_RX_TRAPPED
bit.  This would make the trap specific to each interface, but I think that
may be desirable.

-Jeff

  reply	other threads:[~2004-06-28 14:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-22 15:29 Jeff Moyer
2004-04-25 19:15 ` Matt Mackall
2004-04-28 12:44   ` Jeff Moyer
2004-04-28 14:03     ` Matt Mackall
2004-04-28 14:07       ` Jeff Moyer
2004-04-28 14:27         ` Matt Mackall
2004-04-28 18:23           ` Jeff Moyer
2004-05-20  2:20             ` klogd, netconsole without /dev/console? Tom Oehser
2004-06-25 15:50             ` netconsole hangs w/ alt-sysrq-t Jeff Moyer
2004-06-25 23:27               ` Matt Mackall
2004-06-28 14:48                 ` Jeff Moyer [this message]
2004-06-28 15:19                   ` Matt Mackall
2004-06-28 16:58                     ` Jeff Moyer
2004-06-29 12:36                       ` Jeff Moyer
2004-07-01 16:52                       ` Matt Mackall
2004-07-01 16:54                         ` Jeff Moyer
2004-07-01 17:05                           ` Matt Mackall
2004-07-01 17:53                             ` Jeff Moyer

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=16608.12233.39964.940020@segfault.boston.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.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

all inboxes | Powered by JetHome®