summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiuwen Lu <[email protected]>2020-06-09 15:44:51 +0800
committerQiuwen Lu <[email protected]>2020-06-09 15:44:51 +0800
commit26314ca06c238d85debf6d08d5a38acb93e5a017 (patch)
tree7f0d395e68ee853da3aae2acdac819630ef5b6f4
parent48d9b554785bd3b8c8ce08644c678dd3f4978fac (diff)
增加读入硬件CRC剥离的开关并在网卡初始化时设置。v4.3.21-20200610
-rw-r--r--service/include/sc_phydev.h5
-rw-r--r--service/src/phydev.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/service/include/sc_phydev.h b/service/include/sc_phydev.h
index 1fe7644..4795626 100644
--- a/service/include/sc_phydev.h
+++ b/service/include/sc_phydev.h
@@ -64,7 +64,7 @@ struct phydev_info
unsigned int en_promisc;
/* VLAN选项 */
- unsigned int en_vlan_strip;;
+ unsigned int en_vlan_strip;
unsigned int en_vlan_filter;
unsigned int en_drop;
@@ -72,6 +72,9 @@ struct phydev_info
enum pvidmode pvidmode;
unsigned int pvid;
+ /* CRC Strip */
+ unsigned int en_hw_strip_crc;
+
/* VLAN Filter详细配置 */
unsigned int nr_vlan_filter_allow_ids;
unsigned int nr_vlan_filter_deny_ids;
diff --git a/service/src/phydev.c b/service/src/phydev.c
index f9fbc6b..350ffca 100644
--- a/service/src/phydev.c
+++ b/service/src/phydev.c
@@ -191,6 +191,8 @@ static int gen_phydev_ethconf(struct phydev * dev, struct rte_eth_conf * out_eth
// 配置VLAN相关功能
eth_conf.rxmode.hw_vlan_filter = dev->info.en_vlan_filter;
eth_conf.rxmode.hw_vlan_strip = dev->info.en_vlan_strip;
+ eth_conf.rxmode.hw_strip_crc = dev->info.en_hw_strip_crc;
+
dev->en_vlan_strip = eth_conf.rxmode.hw_vlan_strip;
dev->en_vlan_filter = eth_conf.rxmode.hw_vlan_filter;
@@ -574,6 +576,8 @@ void phydev_config_by_g_cfg(struct phydev * phydev, const char * cfg)
MESA_load_profile_uint_def(cfg, str_section, "max_rx_pkt_len", &phydev_info->max_rx_pkt_len, 0);
// Clear Flags
MESA_load_profile_uint_def(cfg, str_section, "clear_tx_flags", &phydev_info->clear_tx_flags, 0);
+ // 硬件CRC剥离
+ MESA_load_profile_uint_def(cfg, str_section, "hw_strip_crc", &phydev_info->en_hw_strip_crc, 0);
// 读MTU,网卡自适应。
MESA_load_profile_short_def(cfg, str_section, "mtu", (short *) &phydev->mtu, (short) phydev->mtu);
// 读混杂模式