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, 30 Aug 2022 13:18:15 +0200
From:   Paolo Abeni <pabeni@...hat.com>
To:     Suman Ghosh <sumang@...vell.com>, sgoutham@...vell.com,
        lcherian@...vell.com, gakula@...vell.com, jerinj@...vell.com,
        hkelam@...vell.com, sbhatta@...vell.com, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, netdev@...r.kernel.org
Subject: Re: [net-next PATCH V5] octeontx2-pf: Add egress PFC support

Hello,

Just a couple of minor nit, see below.

On Fri, 2022-08-26 at 13:27 +0530, Suman Ghosh wrote:
[...]
> +int otx2_pfc_txschq_update(struct otx2_nic *pfvf)
> +{
> +	u8 pfc_en = pfvf->pfc_en, pfc_bit_set;
> +	struct mbox *mbox = &pfvf->mbox;
> +	bool if_up = netif_running(pfvf->netdev);

please, respect the reverse x-mas tree in variables declaration.

[...]
> @@ -1853,6 +1880,32 @@ static netdev_tx_t otx2_xmit(struct sk_buff *skb, struct net_device *netdev)
>  	return NETDEV_TX_OK;
>  }
>  
> +static u16 otx2_select_queue(struct net_device *netdev, struct sk_buff *skb,
> +			     struct net_device *sb_dev)
> +{
> +	struct otx2_nic *pf = netdev_priv(netdev);
> +#ifdef CONFIG_DCB
> +	u8 vlan_prio;
> +#endif
> +	int txq;
> +
> +#ifdef CONFIG_DCB
> +	if (!skb->vlan_present)
> +		goto pick_tx;
> +
> +	vlan_prio = skb->vlan_tci >> 13;
> +	if ((vlan_prio > pf->hw.tx_queues - 1) ||
> +	    !pf->pfc_alloc_status[vlan_prio])
> +		goto pick_tx;
> +
> +	return vlan_prio;
> +
> +pick_tx:
> +#endif
> +	txq = netdev_pick_tx(netdev, skb, NULL);
> +	return txq;

You can just
	return netdev_pick_tx(netdev, skb, NULL);

and avoid declaring txq.

Cheers,

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ