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: <YX2JJSQBRFjhmQsx@lunn.ch>
Date:   Sat, 30 Oct 2021 20:04:21 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Guangbin Huang <huangguangbin2@...wei.com>
Cc:     davem@...emloft.net, kuba@...nel.org, mkubecek@...e.cz,
        amitc@...lanox.com, idosch@...sch.org, danieller@...dia.com,
        jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com,
        jdike@...toit.com, richard@....at, anton.ivanov@...bridgegreys.com,
        netanel@...zon.com, akiyano@...zon.com, gtzalik@...zon.com,
        saeedb@...zon.com, chris.snook@...il.com,
        ulli.kroll@...glemail.com, linus.walleij@...aro.org,
        jeroendb@...gle.com, csully@...gle.com, awogbemila@...gle.com,
        jdmason@...zu.us, rain.1986.08.12@...il.com, zyjzyj2000@...il.com,
        kys@...rosoft.com, haiyangz@...rosoft.com, mst@...hat.com,
        jasowang@...hat.com, doshir@...are.com, pv-drivers@...are.com,
        jwi@...ux.ibm.com, kgraul@...ux.ibm.com, hca@...ux.ibm.com,
        gor@...ux.ibm.com, johannes@...solutions.net,
        netdev@...r.kernel.org, lipeng321@...wei.com,
        chenhao288@...ilicon.com, linux-s390@...r.kernel.org
Subject: Re: [PATCH V5 net-next 5/6] net: hns3: add support to set/get rx buf
 len via ethtool for hns3 driver

>  static int hns3_check_ringparam(struct net_device *ndev,
> -				struct ethtool_ringparam *param)
> +				struct ethtool_ringparam *param,
> +				struct kernel_ethtool_ringparam *kernel_param)
>  {
> +#define RX_BUF_LEN_2K 2048
> +#define RX_BUF_LEN_4K 4096

include/linux/size.h

#define SZ_2K                           0x00000800
#define SZ_4K                           0x00001000


>  	if (hns3_nic_resetting(ndev))
>  		return -EBUSY;
>  
>  	if (param->rx_mini_pending || param->rx_jumbo_pending)
>  		return -EINVAL;
>  
> +	if (kernel_param->rx_buf_len != RX_BUF_LEN_2K &&
> +	    kernel_param->rx_buf_len != RX_BUF_LEN_4K) {
> +		netdev_err(ndev, "Rx buf len only support 2048 and 4096\n");
> +		return -EINVAL;

Same question i asked in the cover note. MTU is 4K, i set rx buf len
to 2K. What happens? Should there be an EINVAL here?

   Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ