Skip to content

Commit 09b4719

Browse files
tianx666NipaLocal
authored andcommitted
xsc: Init net device
Initialize network device: 1. Prepare xsc_eth_params, set up the network parameters such as MTU, number of channels, and RSS configuration 2. Configure netdev, Set the MTU, features 3. Set mac addr to hardware, and attach netif Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent b210e38 commit 09b4719

File tree

8 files changed

+725
-1
lines changed

8 files changed

+725
-1
lines changed

drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <linux/pci.h>
1010
#include <linux/auxiliary_bus.h>
11+
#include <linux/if_vlan.h>
1112

1213
#include "common/xsc_cmdq.h"
1314

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (C) 2021-2025, Shanghai Yunsilicon Technology Co., Ltd.
3+
* All rights reserved.
4+
*/
5+
6+
#ifndef __XSC_DEVICE_H
7+
#define __XSC_DEVICE_H
8+
9+
enum xsc_traffic_types {
10+
XSC_TT_IPV4,
11+
XSC_TT_IPV4_TCP,
12+
XSC_TT_IPV4_UDP,
13+
XSC_TT_IPV6,
14+
XSC_TT_IPV6_TCP,
15+
XSC_TT_IPV6_UDP,
16+
XSC_TT_IPV4_IPSEC_AH,
17+
XSC_TT_IPV6_IPSEC_AH,
18+
XSC_TT_IPV4_IPSEC_ESP,
19+
XSC_TT_IPV6_IPSEC_ESP,
20+
XSC_TT_ANY,
21+
XSC_NUM_TT,
22+
};
23+
24+
#define XSC_NUM_INDIR_TIRS XSC_NUM_TT
25+
26+
enum {
27+
XSC_L3_PROT_TYPE_IPV4 = BIT(0),
28+
XSC_L3_PROT_TYPE_IPV6 = BIT(1),
29+
};
30+
31+
enum {
32+
XSC_L4_PROT_TYPE_TCP = BIT(0),
33+
XSC_L4_PROT_TYPE_UDP = BIT(1),
34+
};
35+
36+
struct xsc_tirc_config {
37+
u8 l3_prot_type;
38+
u8 l4_prot_type;
39+
u32 rx_hash_fields;
40+
};
41+
42+
#endif
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (C) 2021-2025, Shanghai Yunsilicon Technology Co., Ltd.
3+
* All rights reserved.
4+
*/
5+
6+
#ifndef __XSC_PP_H
7+
#define __XSC_PP_H
8+
9+
enum {
10+
XSC_HASH_FIELD_SEL_SRC_IP = BIT(0),
11+
XSC_HASH_FIELD_SEL_PROTO = BIT(1),
12+
XSC_HASH_FIELD_SEL_DST_IP = BIT(2),
13+
XSC_HASH_FIELD_SEL_SPORT = BIT(3),
14+
XSC_HASH_FIELD_SEL_DPORT = BIT(4),
15+
XSC_HASH_FIELD_SEL_SRC_IPV6 = BIT(5),
16+
XSC_HASH_FIELD_SEL_DST_IPV6 = BIT(6),
17+
XSC_HASH_FIELD_SEL_SPORT_V6 = BIT(7),
18+
XSC_HASH_FIELD_SEL_DPORT_V6 = BIT(8),
19+
};
20+
21+
#define XSC_HASH_IP (XSC_HASH_FIELD_SEL_SRC_IP |\
22+
XSC_HASH_FIELD_SEL_DST_IP |\
23+
XSC_HASH_FIELD_SEL_PROTO)
24+
#define XSC_HASH_IP_PORTS (XSC_HASH_FIELD_SEL_SRC_IP |\
25+
XSC_HASH_FIELD_SEL_DST_IP |\
26+
XSC_HASH_FIELD_SEL_SPORT |\
27+
XSC_HASH_FIELD_SEL_DPORT |\
28+
XSC_HASH_FIELD_SEL_PROTO)
29+
#define XSC_HASH_IP6 (XSC_HASH_FIELD_SEL_SRC_IPV6 |\
30+
XSC_HASH_FIELD_SEL_DST_IPV6 |\
31+
XSC_HASH_FIELD_SEL_PROTO)
32+
#define XSC_HASH_IP6_PORTS (XSC_HASH_FIELD_SEL_SRC_IPV6 |\
33+
XSC_HASH_FIELD_SEL_DST_IPV6 |\
34+
XSC_HASH_FIELD_SEL_SPORT_V6 |\
35+
XSC_HASH_FIELD_SEL_DPORT_V6 |\
36+
XSC_HASH_FIELD_SEL_PROTO)
37+
38+
#endif /* __XSC_PP_H */

0 commit comments

Comments
 (0)