Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1390545

Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag
Date 2016-04-28 23:20 +0200
Message-ID <rt1vR-2uF-29@gated-at.bofh.it> (permalink)
References <rsyau-26F-7@gated-at.bofh.it> <rsyau-26F-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Elad Kanfi <eladkan@mellanox.com>
Date: Wed, 27 Apr 2016 16:18:29 +0300

> From: Elad Kanfi <eladkan@mellanox.com>
> 
> Below is a description of a possible problematic
> sequence. CPU-A is sending a frame and CPU-B handles
> the interrupt that indicates the frame was sent. CPU-B
> reads an invalid value of tx_packet_sent.
> 
> 	CPU-A				CPU-B
> 	-----				-----
> 	nps_enet_send_frame
> 	.
> 	.
> 	tx_packet_sent = true
> 	order HW to start tx
> 	.
> 	.
> 	HW complete tx
> 			    ------> 	get tx complete interrupt
> 					.
> 					.
> 					if(tx_packet_sent == true)
> 
> 	end memory transaction
> 	(tx_packet_sent actually
> 	 written)
> 
> Problem solution:
> 
> Add a memory barrier after setting tx_packet_sent,
> in order to make sure that it is written before
> the packet is sent.
> 
> Signed-off-by: Elad Kanfi <eladkan@mellanox.com>
> 
> Acked-by: Noam Camus <noamca@mellanox.com>

Please address the feedback about memory barrier pairing.

Also, for both patches, do not put empty lines between the various
tags at the end of the commit message.  They should all be together
in one continuous group.

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag David Miller <davem@davemloft.net> - 2016-04-28 23:20 +0200
  RE: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag Elad Kanfi <eladkan@mellanox.com> - 2016-05-02 13:00 +0200
    Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag Lino Sanfilippo <lsanfil@marvell.com> - 2016-05-02 13:20 +0200
      RE: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag Elad Kanfi <eladkan@mellanox.com> - 2016-05-08 16:00 +0200
        Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag Lino Sanfilippo <LinoSanfilippo@gmx.de> - 2016-05-10 20:40 +0200

csiph-web