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]
Message-ID: <5ddc169b-f837-e478-43d9-4d6cf587aa05@marvell.com>
Date:   Wed, 6 May 2020 09:51:35 +0300
From:   Igor Russkikh <irusskikh@...vell.com>
To:     Bhupesh Sharma <bhsharma@...hat.com>, <netdev@...r.kernel.org>
CC:     <bhupesh.linux@...il.com>, <kexec@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, Ariel Elior <aelior@...vell.com>,
        GR-everest-linux-l2 <GR-everest-linux-l2@...vell.com>,
        Manish Chopra <manishc@...vell.com>, <davem@...emloft.net>,
        Alok Prasad <palok@...vell.com>
Subject: Re: [EXT] [PATCH 1/2] net: qed*: Reduce RX and TX default ring count
 when running inside kdump kernel



>  #include <linux/compiler.h>
> +#include <linux/crash_dump.h>
>  #include <linux/version.h>
>  #include <linux/workqueue.h>
>  #include <linux/netdevice.h>
> @@ -574,13 +575,13 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev,
> __be16 proto,
>  #define RX_RING_SIZE		((u16)BIT(RX_RING_SIZE_POW))
>  #define NUM_RX_BDS_MAX		(RX_RING_SIZE - 1)
>  #define NUM_RX_BDS_MIN		128
> -#define NUM_RX_BDS_DEF		((u16)BIT(10) - 1)
> +#define NUM_RX_BDS_DEF		((is_kdump_kernel()) ? ((u16)BIT(6) - 1) :
> ((u16)BIT(10) - 1))
>  
>  #define TX_RING_SIZE_POW	13
>  #define TX_RING_SIZE		((u16)BIT(TX_RING_SIZE_POW))
>  #define NUM_TX_BDS_MAX		(TX_RING_SIZE - 1)
>  #define NUM_TX_BDS_MIN		128
> -#define NUM_TX_BDS_DEF		NUM_TX_BDS_MAX
> +#define NUM_TX_BDS_DEF		((is_kdump_kernel()) ? ((u16)BIT(6) - 1) :
> NUM_TX_BDS_MAX)
>  

Hi Bhupesh,

Thanks for looking into this. We are also analyzing how to reduce qed* memory
usage even more.

Patch is good, but may I suggest not to introduce conditional logic into the
defines but instead just add two new defines like NUM_[RT]X_BDS_MIN and check
for is_kdump_kernel() in the code explicitly?

if (is_kdump_kernel()) {
	edev->q_num_rx_buffers = NUM_RX_BDS_MIN;
	edev->q_num_tx_buffers = NUM_TX_BDS_MIN;
} else {
	edev->q_num_rx_buffers = NUM_RX_BDS_DEF;
	edev->q_num_tx_buffers = NUM_TX_BDS_DEF;
}

This may make configuration logic more explicit. If future we may want adding
more specific configs under this `if`.

Regards
  Igor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ