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:   Tue, 07 Feb 2023 13:48:11 +0100
From:   Paolo Abeni <pabeni@...hat.com>
To:     Hariprasad Kelam <hkelam@...vell.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     kuba@...nel.org, davem@...emloft.net, edumazet@...gle.com,
        sgoutham@...vell.com, lcherian@...vell.com, gakula@...vell.com,
        jerinj@...vell.com, sbhatta@...vell.com, jhs@...atatu.com,
        xiyou.wangcong@...il.com, jiri@...nulli.us, saeedm@...dia.com,
        richardcochran@...il.com, tariqt@...dia.com,
        linux-rdma@...r.kernel.org, maxtram95@...il.com,
        naveenm@...vell.com, hariprasad.netdev@...il.com
Subject: Re: [net-next PATCH V3 4/4] octeontx2-pf: Add support for HTB
 offload

On Mon, 2023-02-06 at 11:16 +0530, Hariprasad Kelam wrote:
> +static int otx2_qos_txschq_alloc(struct otx2_nic *pfvf,
> +				 struct otx2_qos_cfg *cfg)
> +{
> +	struct nix_txsch_alloc_req *req;
> +	struct nix_txsch_alloc_rsp *rsp;
> +	struct mbox *mbox = &pfvf->mbox;
> +	int lvl, rc, schq;
> +
> +	mutex_lock(&mbox->lock);
> +	req = otx2_mbox_alloc_msg_nix_txsch_alloc(&pfvf->mbox);
> +	if (!req)
> +		return -ENOMEM;

This does not releases the mbox->lock mutex on error (another
occurrence below).

[...]


> +static int otx2_qos_txschq_update_config(struct otx2_nic *pfvf,
> +					 struct otx2_qos_node *node,
> +					 struct otx2_qos_cfg *cfg)
> +{
> +	int ret = 0;
> +
> +	otx2_qos_txschq_fill_cfg(pfvf, node, cfg);
> +	ret = otx2_qos_txschq_push_cfg(pfvf, node, cfg);
> +
> +	return ret;

I personally find the plain:

	return <function>

more easy to read - more instances below.

[...]

> +static void otx2_reset_qdisc(struct net_device *dev, u16 qid)
> +{
> +	struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, qid);
> +	struct Qdisc *qdisc = dev_queue->qdisc_sleeping;
> +
> +	if (!qdisc)
> +		return;
> +
> +	spin_lock_bh(qdisc_lock(qdisc));
> +	qdisc_reset(qdisc);
> +	spin_unlock_bh(qdisc_lock(qdisc));
> +}

The above looks like a possible shared helper, as mlx code implements a
quite identical function.

Cheers,

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ