netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dong.menglong@zte.com.cn
Cc: petrm@mellanox.com, jiri@mellanox.com, gustavo@embeddedor.com,
	liuhangbin@gmail.com, ap420073@gmail.com, jwi@linux.ibm.com,
	mcroce@redhat.com, tglx@linutronix.de, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn,
	wang.yi59@zte.com.cn, jiang.xuexin@zte.com.cn
Subject: Re: [PATCH v2] macvlan: schedule bc_work even if error
Date: Mon, 25 Nov 2019 10:55:01 -0800 (PST)	[thread overview]
Message-ID: <20191125.105501.735127676571709693.davem@davemloft.net> (raw)
In-Reply-To: <1574672289-26255-1-git-send-email-dong.menglong@zte.com.cn>

From: Menglong Dong <dong.menglong@zte.com.cn>
Date: Mon, 25 Nov 2019 16:58:09 +0800

> While enqueueing a broadcast skb to port->bc_queue, schedule_work()
> is called to add port->bc_work, which processes the skbs in
> bc_queue, to "events" work queue. If port->bc_queue is full, the
> skb will be discarded and schedule_work(&port->bc_work) won't be
> called. However, if port->bc_queue is full and port->bc_work is not
> running or pending, port->bc_queue will keep full and schedule_work()
> won't be called any more, and all broadcast skbs to macvlan will be
> discarded. This case can happen:
> 
> macvlan_process_broadcast() is the pending function of port->bc_work,
> it moves all the skbs in port->bc_queue to the queue "list", and
> processes the skbs in "list". During this, new skbs will keep being
> added to port->bc_queue in macvlan_broadcast_enqueue(), and
> port->bc_queue may already full when macvlan_process_broadcast()
> return. This may happen, especially when there are a lot of real-time
> threads and the process is preempted.
> 
> Fix this by calling schedule_work(&port->bc_work) even if
> port->bc_work is full in macvlan_broadcast_enqueue().
> 
> Fixes: 412ca1550cbe ("macvlan: Move broadcasts into a work queue")
> Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>

Applied and queued up for -stable, thanks.

      reply	other threads:[~2019-11-25 18:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25  8:58 [PATCH v2] macvlan: schedule bc_work even if error Menglong Dong
2019-11-25 18:55 ` David Miller [this message]

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=20191125.105501.735127676571709693.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ap420073@gmail.com \
    --cc=dong.menglong@zte.com.cn \
    --cc=gustavo@embeddedor.com \
    --cc=jiang.xuexin@zte.com.cn \
    --cc=jiri@mellanox.com \
    --cc=jwi@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=mcroce@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.com \
    --cc=tglx@linutronix.de \
    --cc=wang.yi59@zte.com.cn \
    --cc=xue.zhihong@zte.com.cn \
    /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).