1 Star 0 Fork 103

hos-learning/third_party_lwip

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
0087-support-vlan-offload.patch 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
Aurora 提交于 2023-12-07 03:26 . update lwip to 2.1.3-39.oe2203sp1
diff -Nur lwip-82/src/include/dpdk_version.h lwip-offload/src/include/dpdk_version.h
--- lwip-82/src/include/dpdk_version.h 2023-11-28 14:17:02.432481010 +0800
+++ lwip-offload/src/include/dpdk_version.h 2023-11-28 14:34:21.208481010 +0800
@@ -48,6 +48,7 @@
#define RTE_MBUF_F_TX_TCP_CKSUM PKT_TX_TCP_CKSUM
#define RTE_MBUF_F_TX_TCP_SEG PKT_TX_TCP_SEG
#define RTE_MBUF_F_TX_UDP_CKSUM PKT_TX_UDP_CKSUM
+#define RTE_MBUF_F_TX_VLAN PKT_TX_VLAN_PKT
#endif /* DPDK_VERSION_1911 */
diff -Nur lwip-82/src/include/lwip/pbuf.h lwip-offload/src/include/lwip/pbuf.h
--- lwip-82/src/include/lwip/pbuf.h 2023-11-28 14:17:02.408481010 +0800
+++ lwip-offload/src/include/lwip/pbuf.h 2023-11-28 14:41:31.580481010 +0800
@@ -240,6 +240,7 @@
struct pbuf *last;
pthread_spinlock_t pbuf_lock;
struct tcp_pcb *pcb;
+ u16_t vlan_tci;
#if GAZELLE_UDP_ENABLE
ip_addr_t addr;
u16_t port;
diff -Nur lwip-82/src/netif/ethernet.c lwip-offload/src/netif/ethernet.c
--- lwip-82/src/netif/ethernet.c 2023-11-28 14:17:02.440481010 +0800
+++ lwip-offload/src/netif/ethernet.c 2023-11-28 16:35:36.536481010 +0800
@@ -289,7 +289,12 @@
}
#else
if (netif->vlan_enable) {
- vlan_prio_vid = netif->vlan_tci;
+ if (netif->txol_flags & DEV_TX_OFFLOAD_VLAN_INSERT) {
+ p->ol_flags |= RTE_MBUF_F_TX_VLAN;
+ p->vlan_tci = netif->vlan_tci;
+ } else {
+ vlan_prio_vid = netif->vlan_tci;
+ }
}
#endif /* GAZELLE_ENABLE */
#endif
@@ -327,11 +332,11 @@
("ethernet_output: sending packet %p\n", (void *)p));
#if CHECKSUM_GEN_IP_HW || CHECKSUM_GEN_TCP_HW
-#if LWIP_VLAN_PCP
- ethh_cksum_set(p, sizeof(*ethhdr)+SIZEOF_VLAN_HDR);
-#else
- ethh_cksum_set(p, sizeof(*ethhdr));
-#endif
+ if (netif->vlan_enable && !(netif->txol_flags & DEV_TX_OFFLOAD_VLAN_INSERT)) {
+ ethh_cksum_set(p, sizeof(*ethhdr) + SIZEOF_VLAN_HDR);
+ } else {
+ ethh_cksum_set(p, sizeof(*ethhdr));
+ }
#endif
/* send the packet */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hos-learning/third_party_lwip.git
git@gitee.com:hos-learning/third_party_lwip.git
hos-learning
third_party_lwip
third_party_lwip
master

搜索帮助