Re: [PATCH net-next 0/6] net: qualcomm: rmnet: stop using C bit-fields

From: Alex Elder
Date: Thu Mar 04 2021 - 23:52:56 EST


On 3/4/21 9:44 PM, subashab@xxxxxxxxxxxxxx wrote:

Can you share what all tests have been done with these patches

I'm testing with all of them applied and "it works." On
the first three I think they're simple enough that you
can see by inspection they should be OK. For the rest
I tested more carefully.

For runtime testing, I have used them on IPA v3.5.1 and
IPA v4.2 platforms, running repeated ping and other network
traffic tests over an rmnet connection.

For unit testing, I did essentially the following. I'll
use the MAP header structure as an example, but I did
this on all structures I modified.

struct rmnet_map_header_new new;
struct rmnet_map_header *old = (void *)&new;
u8 val;

val = u8_encode_bits(1, MAP_CMD_FMASK);
val |= u8_encode_bits(0x23, MAP_PAD_LEN_FMASK);
new.flags = val;
new.mux_id = 0x45;
new.pkt_len = htons(0x6789);

printk("pad_len: 0x%x (want 0x23)\n", old->pad_len);
printk("reserved_bit: 0x%x (want 0x0)\n", old->reserved_bit);
printk("cd_bit: 0x%x (want 0x1)\n", old->cd_bit);
printk("mux_id: 0x%x (want 0x45)\n", old->mux_id);
printk("pkt_len: 0x%x (want 0x6789)\n", ntohs(old->pkt_len));

I didn't do *exactly* or *only* this, but basically the
process was manipulating the values assigned using the
old structure then verifying it has the same representation
in the new structure using the new access methods (and vice
versa).

I suspect you have a much better ability to test than
I do, and I would really prefer to see this get tested
rigorously if possible.

-Alex