gve: Add support for DQO RX PTYPE map
authorBailey Forrest <bcf@google.com>
Thu, 24 Jun 2021 18:06:24 +0000 (11:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Jun 2021 19:47:37 +0000 (12:47 -0700)
commitc4b87ac87635879ecf0d26807dc00df9bb7eb508
tree0877f05da7446d744ec16edaa039ee41c97b94f2
parent5ca2265eefc0bdfc80d4cbe9f70a81c40c41ae60
gve: Add support for DQO RX PTYPE map

Unlike GQI, DQO RX descriptors do not contain the L3 and L4 type of the
packet. L3 and L4 types are necessary in order to set the hash and csum
on RX SKBs correctly.

DQO RX descriptors instead contain a 10 bit PTYPE index. The PTYPE map
enables the device to tell the driver how to map from PTYPE index to
L3/L4 type.

The device doesn't provide any guarantees about the range of possible
PTYPEs, so we just use a 1024 entry array to implement a fast mapping
structure.

Signed-off-by: Bailey Forrest <bcf@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/google/gve/gve.h
drivers/net/ethernet/google/gve/gve_adminq.c
drivers/net/ethernet/google/gve/gve_adminq.h
drivers/net/ethernet/google/gve/gve_main.c