lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 5 Jan 2015 17:30:54 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Govindarajulu Varadarajan' <_govind@....com>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"sassmann@...hat.com" <sassmann@...hat.com>
CC:	"ssujith@...co.com" <ssujith@...co.com>,
	"benve@...co.com" <benve@...co.com>
Subject: RE: [PATCH net-next 1/3] enic: make vnic_wq_buf doubly linked

> This patch makes vnic_wq_buf doubly liked list. This is needed for dma_mapping
> error check, in case some frag's dma map fails, we need to move back and remove
> previously queued buffers.

I can't see any code that keeps the back-pointers valid when items are removed.
Maybe they aren't needed, but I'd like to be convinced.

If errors are really unlikely, and the list likely to be short,
then just traverse the entire list forwards in the error path.

	David

> 
> Signed-off-by: Govindarajulu Varadarajan <_govind@....com>
> ---
>  drivers/net/ethernet/cisco/enic/vnic_wq.c | 3 +++
>  drivers/net/ethernet/cisco/enic/vnic_wq.h | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cisco/enic/vnic_wq.c b/drivers/net/ethernet/cisco/enic/vnic_wq.c
> index 3e6b8d5..b5a1c93 100644
> --- a/drivers/net/ethernet/cisco/enic/vnic_wq.c
> +++ b/drivers/net/ethernet/cisco/enic/vnic_wq.c
> @@ -47,11 +47,14 @@ static int vnic_wq_alloc_bufs(struct vnic_wq *wq)
>  				wq->ring.desc_size * buf->index;
>  			if (buf->index + 1 == count) {
>  				buf->next = wq->bufs[0];
> +				buf->next->prev = buf;
>  				break;
>  			} else if (j + 1 == VNIC_WQ_BUF_BLK_ENTRIES(count)) {
>  				buf->next = wq->bufs[i + 1];
> +				buf->next->prev = buf;
>  			} else {
>  				buf->next = buf + 1;
> +				buf->next->prev = buf;
>  				buf++;
>  			}
>  		}
> diff --git a/drivers/net/ethernet/cisco/enic/vnic_wq.h b/drivers/net/ethernet/cisco/enic/vnic_wq.h
> index 816f1ad..2961543 100644
> --- a/drivers/net/ethernet/cisco/enic/vnic_wq.h
> +++ b/drivers/net/ethernet/cisco/enic/vnic_wq.h
> @@ -62,6 +62,7 @@ struct vnic_wq_buf {
>  	uint8_t cq_entry; /* Gets completion event from hw */
>  	uint8_t desc_skip_cnt; /* Num descs to occupy */
>  	uint8_t compressed_send; /* Both hdr and payload in one desc */
> +	struct vnic_wq_buf *prev;
>  };
> 
>  /* Break the vnic_wq_buf allocations into blocks of 32/64 entries */
> --
> 2.2.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ