All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Lomovtsev <vlomovtsev@marvell.com>
To: "sgoutham@cavium.com" <sgoutham@cavium.com>,
	"rric@kernel.org" <rric@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "dnelson@redhat.com" <dnelson@redhat.com>
Subject: Re: [PATCH 0/8] nic: thunderx: fix communication races betwen VF & PF
Date: Wed, 6 Feb 2019 14:18:19 +0000	[thread overview]
Message-ID: <20190206141818.GA17226@localhost.localdomain> (raw)
In-Reply-To: <20190206101351.16744-1-vlomovtsev@marvell.com>

self-NACK here, some emails get's corrupted for some reasons,
along with some typos found.

sorry for inconvenience.

Vadim

On Wed, Feb 06, 2019 at 10:13:54AM +0000, Vadim Lomovtsev wrote:
> The ThunderX CN88XX NIC Virtual Function driver uses mailbox interface 
> to communicate to physical function driver. Each of VF has it's own pair
> of mailbox registers to read from and write to. The mailbox registers
> has no protection from possible races, so it has to be implemented
> at software side.
> 
> After long term testing by loop of 'ip link set <ifname> up/down'
> command it was found that there are two possible scenarios when
> race condition appears:
>  1. VF receives link change message from PF and VF send RX mode
> configuration message to PF in the same time from separate thread.
>  2. PF receives RX mode configuration from VF and in the same time,
> in separate thread PF detects link status change and sends appropriate
> message to particular VF.
> 
> Both cases leads to mailbox data to be rewritten, NIC VF messaging control
> data to be updated incorrectly and communication sequence gets broken.
> 
> This patch series is to address race condition with VF & PF communication.
> 
> Vadim Lomovtsev (8):
>   net: thunderx: correct typo in macro name
>   net: thunderx: replace global nicvf_rx_mode_wq work queue for all VFs
>     to private for each of them.
>   net: thunderx: make CFG_DONE message to run through generic send-ack
>     sequence
>   net: thunderx: add nicvf_send_msg_to_pf result check for
>     set_rx_mode_task
>   net: thunderx: rework xcast message structure to make it fit into 64
>     bit
>   net: thunderx: add mutex to protect mailbox from concurrent calls for
>     same VF
>   net: thunderx: implement helpers to read mailbox IRQ status
>   net: thunderx: check status of mailbox IRQ before sending a message
> 
>  drivers/net/ethernet/cavium/thunder/nic.h     | 12 +--
>  .../net/ethernet/cavium/thunder/nic_main.c    | 58 +++++++------
>  .../net/ethernet/cavium/thunder/nicvf_main.c  | 82 +++++++++++++------
>  .../ethernet/cavium/thunder/nicvf_queues.c    | 14 ++++
>  .../ethernet/cavium/thunder/nicvf_queues.h    |  1 +
>  .../net/ethernet/cavium/thunder/thunder_bgx.c |  2 +-
>  .../net/ethernet/cavium/thunder/thunder_bgx.h |  2 +-
>  7 files changed, 112 insertions(+), 59 deletions(-)
> 
> -- 
> 2.17.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Vadim Lomovtsev <vlomovtsev@marvell.com>
To: "sgoutham@cavium.com" <sgoutham@cavium.com>,
	"rric@kernel.org" <rric@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "dnelson@redhat.com" <dnelson@redhat.com>
Subject: Re: [PATCH 0/8] nic: thunderx: fix communication races betwen VF & PF
Date: Wed, 6 Feb 2019 14:18:19 +0000	[thread overview]
Message-ID: <20190206141818.GA17226@localhost.localdomain> (raw)
In-Reply-To: <20190206101351.16744-1-vlomovtsev@marvell.com>

self-NACK here, some emails get's corrupted for some reasons,
along with some typos found.

sorry for inconvenience.

Vadim

On Wed, Feb 06, 2019 at 10:13:54AM +0000, Vadim Lomovtsev wrote:
> The ThunderX CN88XX NIC Virtual Function driver uses mailbox interface 
> to communicate to physical function driver. Each of VF has it's own pair
> of mailbox registers to read from and write to. The mailbox registers
> has no protection from possible races, so it has to be implemented
> at software side.
> 
> After long term testing by loop of 'ip link set <ifname> up/down'
> command it was found that there are two possible scenarios when
> race condition appears:
>  1. VF receives link change message from PF and VF send RX mode
> configuration message to PF in the same time from separate thread.
>  2. PF receives RX mode configuration from VF and in the same time,
> in separate thread PF detects link status change and sends appropriate
> message to particular VF.
> 
> Both cases leads to mailbox data to be rewritten, NIC VF messaging control
> data to be updated incorrectly and communication sequence gets broken.
> 
> This patch series is to address race condition with VF & PF communication.
> 
> Vadim Lomovtsev (8):
>   net: thunderx: correct typo in macro name
>   net: thunderx: replace global nicvf_rx_mode_wq work queue for all VFs
>     to private for each of them.
>   net: thunderx: make CFG_DONE message to run through generic send-ack
>     sequence
>   net: thunderx: add nicvf_send_msg_to_pf result check for
>     set_rx_mode_task
>   net: thunderx: rework xcast message structure to make it fit into 64
>     bit
>   net: thunderx: add mutex to protect mailbox from concurrent calls for
>     same VF
>   net: thunderx: implement helpers to read mailbox IRQ status
>   net: thunderx: check status of mailbox IRQ before sending a message
> 
>  drivers/net/ethernet/cavium/thunder/nic.h     | 12 +--
>  .../net/ethernet/cavium/thunder/nic_main.c    | 58 +++++++------
>  .../net/ethernet/cavium/thunder/nicvf_main.c  | 82 +++++++++++++------
>  .../ethernet/cavium/thunder/nicvf_queues.c    | 14 ++++
>  .../ethernet/cavium/thunder/nicvf_queues.h    |  1 +
>  .../net/ethernet/cavium/thunder/thunder_bgx.c |  2 +-
>  .../net/ethernet/cavium/thunder/thunder_bgx.h |  2 +-
>  7 files changed, 112 insertions(+), 59 deletions(-)
> 
> -- 
> 2.17.2

  parent reply	other threads:[~2019-02-06 14:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 10:13 [PATCH 0/8] nic: thunderx: fix communication races betwen VF & PF Vadim Lomovtsev
2019-02-06 10:13 ` Vadim Lomovtsev
2019-02-06 10:13 ` [PATCH 1/8] net: thunderx: correct typo in macro name Vadim Lomovtsev
2019-02-06 10:13   ` Vadim Lomovtsev
2019-02-06 10:13 ` [PATCH 4/8] net: thunderx: add nicvf_send_msg_to_pf result check for set_rx_mode_task Vadim Lomovtsev
2019-02-06 10:13   ` Vadim Lomovtsev
2019-02-06 10:13 ` [PATCH 3/8] net: thunderx: make CFG_DONE message to run through generic send-ack sequence Vadim Lomovtsev
2019-02-06 10:13   ` Vadim Lomovtsev
2019-02-06 10:13 ` [PATCH 2/8] net: thunderx: replace global nicvf_rx_mode_wq work queue for all VFs to private for each of them Vadim Lomovtsev
2019-02-06 10:13   ` Vadim Lomovtsev
2019-02-06 10:13 ` [PATCH 5/8] net: thunderx: rework xcast message structure to make it fit into 64 bit Vadim Lomovtsev
2019-02-06 10:13   ` Vadim Lomovtsev
2019-02-06 10:13 ` [PATCH 7/8] net: thunderx: implement helpers to read mailbox IRQ status Vadim Lomovtsev
2019-02-06 10:13   ` Vadim Lomovtsev
2019-02-06 10:13 ` [PATCH 6/8] net: thunderx: add mutex to protect mailbox from concurrent calls for same VF Vadim Lomovtsev
2019-02-06 10:13   ` Vadim Lomovtsev
2019-02-06 10:13 ` [PATCH 8/8] net: thunderx: check status of mailbox IRQ before sending a message Vadim Lomovtsev
2019-02-06 10:13   ` Vadim Lomovtsev
2019-02-06 14:18 ` Vadim Lomovtsev [this message]
2019-02-06 14:18   ` [PATCH 0/8] nic: thunderx: fix communication races betwen VF & PF Vadim Lomovtsev

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=20190206141818.GA17226@localhost.localdomain \
    --to=vlomovtsev@marvell.com \
    --cc=davem@davemloft.net \
    --cc=dnelson@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rric@kernel.org \
    --cc=sgoutham@cavium.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 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.