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] [day] [month] [year] [list]
Message-ID: <20210228114328.4909c805@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Sun, 28 Feb 2021 11:43:28 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
Cc:     netdev@...r.kernel.org, "Michael S. Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        virtualization@...ts.linux-foundation.org, bpf@...r.kernel.org
Subject: Re: [PATCH v3 net-next] virtio-net: support XDP_TX when not more
 queues

On Sun, 28 Feb 2021 16:22:47 +0800 Xuan Zhuo wrote:
> +static void virtnet_put_xdp_sq(struct virtnet_info *vi, struct send_queue *sq)
> +{
> +	struct netdev_queue *txq;
> +	unsigned int qp;
> +
> +	if (vi->curr_queue_pairs <= nr_cpu_ids) {
> +		qp = sq - vi->sq;
> +		txq = netdev_get_tx_queue(vi->dev, qp);
> +		__netif_tx_unlock(txq);
> +	}
> +}

Could we potentially avoid sparse warnings on this patch by adding the
right annotations?

I've seen this pattern used in a few places:

void maybe_take_some_lock() 
	__acquires(lock)
{
	if (condition) {
		lock(lock); /* really take the lock */
	} else {
		/* tell sparse we took the lock, but don't really take it */
		__acquire(lock);
	}
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ