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: <IA1PR11MB6266430ED759770807768D4EE4E89@IA1PR11MB6266.namprd11.prod.outlook.com>
Date:   Thu, 22 Dec 2022 22:57:19 +0000
From:   "Mogilappagari, Sudheer" <sudheer.mogilappagari@...el.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "mkubecek@...e.cz" <mkubecek@...e.cz>,
        "andrew@...n.ch" <andrew@...n.ch>,
        "corbet@....net" <corbet@....net>,
        "Samudrala, Sridhar" <sridhar.samudrala@...el.com>,
        "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>
Subject: RE: [PATCH ethtool-next v2 2/2] netlink: add netlink handler for get
 rss (-x)



> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>

> >     "RSS hash Key": "be:c3:13:a6:59:9a:c3:c5:d8:60:75:2b:4c:
> 
> again, better key name, and please use an array of ints:
> "hash-key": [ 190, 195, 19, ...
> (Or binary encoded string (if it's compliant with JSON):
> "hash-key": "\xbe\xc3\x13\xa6...
> but I think array is easier to deal with.)

Will use "RSS hash-key' as key name and array. 

Output in hex bytes like [ be,c3,13,... ] will be better
I fell but it needs below changes. Without below changes
output looks ["be", "c3", "13"...].  Will send out 
v3 (with below changes as additional patch) unless there 
is an objection. 

+++ b/json_print.c
void print_hex(enum output_type type, unsigned int hex)
 {
        if (_IS_JSON_CONTEXT(type)) {
-               SPRINT_BUF(b1);
-               snprintf(b1, sizeof(b1), "%x", hex);
                if (key)
-                       jsonw_string_field(_jw, key, b1);
+                       jsonw_xint_field(_jw, key, hex);
                else
-                       jsonw_string(_jw, b1);
+                       jsonw_xint(_jw, hex);
        } else if (_IS_FP_CONTEXT(type)) {
                fprintf(stdout, fmt, hex);
        }


> >     "RSS hash function": {
> >             "toeplitz": "on",
> >             "xor": "off",
> >             "crc32": "off"
> 
> Please use true / false.

ack

> > +	if (rss->indir_size) {
> > +		indir_str = calloc(1, indir_bytes * 3);
> > +		if (!indir_str) {
> 
> where is this used?

My bad. This was from my initial implementation before finding json_array op. 
 
> > +		print_string(PRINT_JSON, "RSS indirection table", NULL,
> > +			     "not supported");
> 
> Why not skip the field? In non-JSON output I think we use "n/a" when
> not supported.

non-json output prints "not supported". So used the same here too. 
Will skip the <key,value> pair in v3 as you suggested. 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ