Skip to content

Commit 7966407

Browse files
Huazhong Tandavem330
authored andcommitted
net: hns3: support RXD advanced layout
Currently, the driver gets packet type by parsing the L3_ID/L4_ID/OL3_ID/OL4_ID from RX descriptor, it's time-consuming. Now some new devices support RXD advanced layout, which combines previous OL3_ID/OL4_ID to 8bit ptype field, so the driver gets packet type by looking up only one table, and L3_ID/L4_ID become reserved fields. Considering compatibility, the firmware will report capability of RXD advanced layout, the driver will identify and enable it by default. This patch provides basic function: identify and enable the RXD advanced layout, and refactor out hns3_rx_checksum() by using ptype table to handle RX checksum if supported. Signed-off-by: Huazhong Tan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fc25f9f commit 7966407

File tree

12 files changed

+393
-26
lines changed

12 files changed

+393
-26
lines changed

drivers/net/ethernet/hisilicon/hns3/hnae3.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ enum HNAE3_DEV_CAP_BITS {
9191
HNAE3_DEV_SUPPORT_STASH_B,
9292
HNAE3_DEV_SUPPORT_UDP_TUNNEL_CSUM_B,
9393
HNAE3_DEV_SUPPORT_PAUSE_B,
94+
HNAE3_DEV_SUPPORT_RXD_ADV_LAYOUT_B,
9495
};
9596

9697
#define hnae3_dev_fd_supported(hdev) \
@@ -141,6 +142,9 @@ enum HNAE3_DEV_CAP_BITS {
141142
#define hnae3_ae_dev_tqp_txrx_indep_supported(ae_dev) \
142143
test_bit(HNAE3_DEV_SUPPORT_TQP_TXRX_INDEP_B, (ae_dev)->caps)
143144

145+
#define hnae3_ae_dev_rxd_adv_layout_supported(ae_dev) \
146+
test_bit(HNAE3_DEV_SUPPORT_RXD_ADV_LAYOUT_B, (ae_dev)->caps)
147+
144148
#define ring_ptr_move_fw(ring, p) \
145149
((ring)->p = ((ring)->p + 1) % (ring)->desc_num)
146150
#define ring_ptr_move_bw(ring, p) \

drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ static void hns3_dbg_dev_caps(struct hnae3_handle *h)
367367
"yes" : "no");
368368
dev_info(&h->pdev->dev, "support imp-controlled PHY: %s\n",
369369
test_bit(HNAE3_DEV_SUPPORT_PHY_IMP_B, caps) ? "yes" : "no");
370+
dev_info(&h->pdev->dev, "support rxd advanced layout: %s\n",
371+
test_bit(HNAE3_DEV_SUPPORT_RXD_ADV_LAYOUT_B, caps) ?
372+
"yes" : "no");
370373
}
371374

372375
static void hns3_dbg_dev_specs(struct hnae3_handle *h)

0 commit comments

Comments
 (0)