1 Star 0 Fork 48

zhangyulongkylinos/lwip

forked from src-openEuler/lwip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0121-add-vlan-filter.patch 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
diff --git a/src/include/dpdk_version.h b/src/include/dpdk_version.h
index df3adb5..bf03d98 100644
--- a/src/include/dpdk_version.h
+++ b/src/include/dpdk_version.h
@@ -56,6 +56,7 @@
#define RTE_ETH_RX_OFFLOAD_UDP_CKSUM DEV_RX_OFFLOAD_UDP_CKSUM
#define RTE_ETH_RX_OFFLOAD_IPV4_CKSUM DEV_RX_OFFLOAD_IPV4_CKSUM
#define RTE_ETH_RX_OFFLOAD_VLAN_STRIP DEV_RX_OFFLOAD_VLAN_STRIP
+#define RTE_ETH_RX_OFFLOAD_VLAN_FILTER DEV_RX_OFFLOAD_VLAN_FILTER
#define RTE_ETH_TX_OFFLOAD_IPV4_CKSUM DEV_TX_OFFLOAD_IPV4_CKSUM
#define RTE_ETH_TX_OFFLOAD_VLAN_INSERT DEV_TX_OFFLOAD_VLAN_INSERT
diff --git a/src/netif/ethernet.c b/src/netif/ethernet.c
index 0d8652b..d0d68b3 100644
--- a/src/netif/ethernet.c
+++ b/src/netif/ethernet.c
@@ -122,6 +122,11 @@ ethernet_input(struct pbuf *p, struct netif *netif)
MIB2_STATS_NETIF_INC(netif, ifinerrors);
goto free_and_return;
}
+#if GAZELLE_ENABLE
+ if (netif->vlan_enable && !(netif->txol_flags & RTE_ETH_RX_OFFLOAD_VLAN_FILTER) && VLAN_ID(vlan) != netif->vlan_tci) {
+ goto free_and_return;
+ }
+#endif
#if defined(LWIP_HOOK_VLAN_CHECK) || defined(ETHARP_VLAN_CHECK) || defined(ETHARP_VLAN_CHECK_FN) /* if not, allow all VLANs */
#ifdef LWIP_HOOK_VLAN_CHECK
if (!LWIP_HOOK_VLAN_CHECK(netif, ethhdr, vlan)) {
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangyulongkylinos/lwip.git
git@gitee.com:zhangyulongkylinos/lwip.git
zhangyulongkylinos
lwip
lwip
master

搜索帮助