net/hns3: support Rx descriptor advanced layout
authorChengwen Feng <fengchengwen@huawei.com>
Thu, 4 Mar 2021 07:44:49 +0000 (15:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 4 Mar 2021 14:07:14 +0000 (15:07 +0100)
commitfb5e90694022544507f9ff8ce002fd85c65620b3
tree4be29507fd7bb3996a0baa575aa2b2ea1dc1e346
parent2e4859f3b362fa2960d71dc70b77a13a24f5c228
net/hns3: support Rx descriptor advanced layout

Currently, the driver get packet type by parse the
L3_ID/L4_ID/OL3_ID/OL4_ID from Rx descriptor and then lookup multiple
tables, it's time consuming.

Now Kunpeng930 support advanced RXD layout, which:
1. Combine OL3_ID/OL4_ID to 8bit PTYPE filed, so the driver get packet
   type by lookup only one table.  Note: L3_ID/L4_ID become reserved
   fields.
2. The 1588 timestamp located at Rx descriptor instead of query from
   firmware.
3. The L3E/L4E/OL3E/OL4E will be zero when L3L4P is zero, so driver
   could optimize the good checksum calculations (when L3E/L4E is zero
   then mark PKT_RX_IP_CKSUM_GOOD/PKT_RX_L4_CKSUM_GOOD).

Considering compatibility, the firmware will report capability of
RXD advanced layout, the driver will identify and enable it by default.

This patch only provides basic function: identify and enable the RXD
advanced layout, and lookup ptype table if supported.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
drivers/net/hns3/hns3_cmd.c
drivers/net/hns3/hns3_cmd.h
drivers/net/hns3/hns3_ethdev.c
drivers/net/hns3/hns3_ethdev.h
drivers/net/hns3/hns3_ethdev_vf.c
drivers/net/hns3/hns3_regs.h
drivers/net/hns3/hns3_rxtx.c
drivers/net/hns3/hns3_rxtx.h