!518 adapt rtc mode
From: @yinbin6 Reviewed-by: @jiangheng12 Signed-off-by: @jiangheng12
This commit is contained in:
commit
9065b13ede
241
0074-gazelle-offloads-are-registered-to-lwip.patch
Normal file
241
0074-gazelle-offloads-are-registered-to-lwip.patch
Normal file
@ -0,0 +1,241 @@
|
||||
From cc35c455bb52f78546d7b7216b30203863c017fb Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Tue, 24 Oct 2023 17:32:17 +0800
|
||||
Subject: [PATCH] gazelle offloads are registered to lwip
|
||||
|
||||
---
|
||||
src/core/ipv4/icmp.c | 2 +-
|
||||
src/core/ipv4/ip4.c | 6 +++---
|
||||
src/core/ipv4/ip4_frag.c | 4 ++--
|
||||
src/core/netif.c | 20 ++++++++++++++++++++
|
||||
src/core/tcp_in.c | 2 +-
|
||||
src/core/tcp_out.c | 6 +++---
|
||||
src/core/udp.c | 4 ++--
|
||||
src/include/dpdk_cksum.h | 2 --
|
||||
src/include/lwip/netif.h | 20 ++++++++++++++++++++
|
||||
9 files changed, 52 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/core/ipv4/icmp.c b/src/core/ipv4/icmp.c
|
||||
index 402ba69..c3a877c 100644
|
||||
--- a/src/core/ipv4/icmp.c
|
||||
+++ b/src/core/ipv4/icmp.c
|
||||
@@ -241,7 +241,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
||||
#if CHECKSUM_GEN_IP
|
||||
IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_GEN_IP) {
|
||||
#if CHECKSUM_GEN_IP_HW
|
||||
- if (get_eth_params_tx_ol() & DEV_TX_OFFLOAD_IPV4_CKSUM) {
|
||||
+ if (netif_get_txol_flags(inp) & DEV_TX_OFFLOAD_IPV4_CKSUM) {
|
||||
iph_cksum_set(p, hlen, 1);
|
||||
} else {
|
||||
iph_cksum_set(p, hlen, 0);
|
||||
diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c
|
||||
index 1b70bb5..1e3690f 100644
|
||||
--- a/src/core/ipv4/ip4.c
|
||||
+++ b/src/core/ipv4/ip4.c
|
||||
@@ -509,7 +509,7 @@ ip4_input(struct pbuf *p, struct netif *inp)
|
||||
IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_CHECK_IP) {
|
||||
#if CHECKSUM_CHECK_IP_HW
|
||||
u64_t ret;
|
||||
- if (get_eth_params_rx_ol() & DEV_RX_OFFLOAD_IPV4_CKSUM) {
|
||||
+ if (netif_get_rxol_flags(inp) & DEV_RX_OFFLOAD_IPV4_CKSUM) {
|
||||
ret = is_cksum_ipbad(p);
|
||||
} else {
|
||||
ret = (u64_t)inet_chksum(iphdr, iphdr_hlen);
|
||||
@@ -986,7 +986,7 @@ ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *d
|
||||
#if CHECKSUM_GEN_IP
|
||||
IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_IP) {
|
||||
#if CHECKSUM_GEN_IP_HW
|
||||
- if (get_eth_params_tx_ol() & DEV_TX_OFFLOAD_IPV4_CKSUM) {
|
||||
+ if (netif_get_txol_flags(netif) & DEV_TX_OFFLOAD_IPV4_CKSUM) {
|
||||
iph_cksum_set(p, ip_hlen, 1);
|
||||
} else {
|
||||
iph_cksum_set(p, ip_hlen, 0);
|
||||
@@ -1035,7 +1035,7 @@ ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *d
|
||||
#if IP_FRAG
|
||||
/* don't fragment if interface has mtu set to 0 [loopif] */
|
||||
#if GAZELLE_ENABLE
|
||||
- if (!(get_eth_params_tx_ol() & DEV_TX_OFFLOAD_TCP_TSO)) {
|
||||
+ if (!(netif_get_txol_flags(netif) & DEV_TX_OFFLOAD_TCP_TSO)) {
|
||||
#endif
|
||||
if (netif->mtu && (p->tot_len > netif->mtu)) {
|
||||
return ip4_frag(p, netif, dest);
|
||||
diff --git a/src/core/ipv4/ip4_frag.c b/src/core/ipv4/ip4_frag.c
|
||||
index e01ea51..f63a99e 100644
|
||||
--- a/src/core/ipv4/ip4_frag.c
|
||||
+++ b/src/core/ipv4/ip4_frag.c
|
||||
@@ -642,7 +642,7 @@ ip4_reass(struct pbuf *p)
|
||||
#if CHECKSUM_GEN_IP
|
||||
IF__NETIF_CHECKSUM_ENABLED(ip_current_input_netif(), NETIF_CHECKSUM_GEN_IP) {
|
||||
#if CHECKSUM_GEN_IP_HW
|
||||
- if (get_eth_params_tx_ol() & DEV_TX_OFFLOAD_IPV4_CKSUM) {
|
||||
+ if (netif_get_txol_flags(ip_current_input_netif()) & DEV_TX_OFFLOAD_IPV4_CKSUM) {
|
||||
iph_cksum_set(p, IP_HLEN, 1);
|
||||
} else {
|
||||
iph_cksum_set(p, IP_HLEN, 0);
|
||||
@@ -885,7 +885,7 @@ ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest)
|
||||
#if CHECKSUM_GEN_IP
|
||||
IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_IP) {
|
||||
#if CHECKSUM_GEN_IP_HW
|
||||
- if (get_eth_params_tx_ol() & DEV_TX_OFFLOAD_IPV4_CKSUM) {
|
||||
+ if (netif_get_txol_flags(netif) & DEV_TX_OFFLOAD_IPV4_CKSUM) {
|
||||
iph_cksum_set(p, IP_HLEN, 1);
|
||||
} else {
|
||||
iph_cksum_set(p, IP_HLEN, 0);
|
||||
diff --git a/src/core/netif.c b/src/core/netif.c
|
||||
index 86b74a0..eb59fbc 100644
|
||||
--- a/src/core/netif.c
|
||||
+++ b/src/core/netif.c
|
||||
@@ -1049,6 +1049,26 @@ netif_set_link_down(struct netif *netif)
|
||||
}
|
||||
}
|
||||
|
||||
+#if GAZELLE_ENABLE
|
||||
+void
|
||||
+netif_set_rtc_mode(struct netif *netif)
|
||||
+{
|
||||
+ if (!(netif->flags & NETIF_FLAG_RTC_MODE)) {
|
||||
+ netif_set_flags(netif, NETIF_FLAG_RTC_MODE);
|
||||
+ }
|
||||
+}
|
||||
+void
|
||||
+netif_set_rxol_flags(struct netif *netif, u64_t flags)
|
||||
+{
|
||||
+ netif->rxol_flags |= flags;
|
||||
+}
|
||||
+void
|
||||
+netif_set_txol_flags(struct netif *netif, u64_t flags)
|
||||
+{
|
||||
+ netif->txol_flags |= flags;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
#if LWIP_NETIF_LINK_CALLBACK
|
||||
/**
|
||||
* @ingroup netif
|
||||
diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c
|
||||
index 736845c..07203e5 100644
|
||||
--- a/src/core/tcp_in.c
|
||||
+++ b/src/core/tcp_in.c
|
||||
@@ -209,7 +209,7 @@ tcp_input(struct pbuf *p, struct netif *inp)
|
||||
/* Verify TCP checksum. */
|
||||
#if CHECKSUM_CHECK_TCP_HW
|
||||
u64_t ret;
|
||||
- if (get_eth_params_rx_ol() & DEV_RX_OFFLOAD_TCP_CKSUM) {
|
||||
+ if (netif_get_rxol_flags(inp) & DEV_RX_OFFLOAD_TCP_CKSUM) {
|
||||
ret = is_cksum_bad(p);
|
||||
} else {
|
||||
ret = (u64_t)ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len,
|
||||
diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c
|
||||
index 547d01e..e2c9d63 100644
|
||||
--- a/src/core/tcp_out.c
|
||||
+++ b/src/core/tcp_out.c
|
||||
@@ -1448,7 +1448,7 @@ tcp_output(struct tcp_pcb *pcb)
|
||||
|
||||
/* data available and window allows it to be sent? */
|
||||
#if GAZELLE_ENABLE
|
||||
- if ((get_eth_params_tx_ol() & DEV_TX_OFFLOAD_TCP_TSO) && pcb->need_tso_send) {
|
||||
+ if ((netif_get_txol_flags(netif) & DEV_TX_OFFLOAD_TCP_TSO) && pcb->need_tso_send) {
|
||||
uint16_t send_pkt = 0;
|
||||
|
||||
do {
|
||||
@@ -1831,7 +1831,7 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb, struct netif *netif
|
||||
#if CHECKSUM_GEN_TCP
|
||||
IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_TCP) {
|
||||
#if CHECKSUM_GEN_TCP_HW
|
||||
- if (get_eth_params_tx_ol() & DEV_TX_OFFLOAD_TCP_CKSUM) {
|
||||
+ if (netif_get_txol_flags(netif) & DEV_TX_OFFLOAD_TCP_CKSUM) {
|
||||
tcph_cksum_set(seg->p, TCPH_HDRLEN_BYTES(seg->tcphdr));
|
||||
seg->tcphdr->chksum = ip_chksum_pseudo_offload(IP_PROTO_TCP,seg->p->tot_len, &pcb->local_ip, &pcb->remote_ip);
|
||||
} else {
|
||||
@@ -2273,7 +2273,7 @@ tcp_output_control_segment(struct tcp_pcb *pcb, struct pbuf *p,
|
||||
IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_TCP) {
|
||||
struct tcp_hdr *tcphdr = (struct tcp_hdr *)p->payload;
|
||||
#if CHECKSUM_GEN_TCP_HW
|
||||
- if (get_eth_params_tx_ol() & DEV_TX_OFFLOAD_TCP_CKSUM) {
|
||||
+ if (netif_get_txol_flags(netif) & DEV_TX_OFFLOAD_TCP_CKSUM) {
|
||||
tcph_cksum_set(p, TCPH_HDRLEN_BYTES(tcphdr));
|
||||
tcphdr->chksum = ip_chksum_pseudo_offload(IP_PROTO_TCP, p->tot_len, src, dst);
|
||||
} else {
|
||||
diff --git a/src/core/udp.c b/src/core/udp.c
|
||||
index 5c6dadb..937a045 100644
|
||||
--- a/src/core/udp.c
|
||||
+++ b/src/core/udp.c
|
||||
@@ -414,7 +414,7 @@ udp_input(struct pbuf *p, struct netif *inp)
|
||||
if (udphdr->chksum != 0) {
|
||||
#if CHECKSUM_CHECK_UDP_HW
|
||||
u64_t ret = 0;
|
||||
- if (get_eth_params_rx_ol() & DEV_RX_OFFLOAD_UDP_CKSUM) {
|
||||
+ if (netif_get_txol_flags(inp) & DEV_RX_OFFLOAD_UDP_CKSUM) {
|
||||
ret = is_cksum_bad(p);
|
||||
} else {
|
||||
ret = ip_chksum_pseudo(p, IP_PROTO_UDP, p->tot_len,
|
||||
@@ -983,7 +983,7 @@ udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *d
|
||||
#endif /* LWIP_CHECKSUM_ON_COPY */
|
||||
{
|
||||
#if CHECKSUM_GEN_UDP_HW
|
||||
- if (get_eth_params_tx_ol() & DEV_TX_OFFLOAD_UDP_CKSUM) {
|
||||
+ if (netif_get_txol_flags(netif) & DEV_TX_OFFLOAD_UDP_CKSUM) {
|
||||
udph_cksum_set(q, UDP_HLEN);
|
||||
udpchksum = ip_chksum_pseudo_offload(IP_PROTO_UDP, q->tot_len, &pcb->local_ip, &pcb->remote_ip);
|
||||
} else {
|
||||
diff --git a/src/include/dpdk_cksum.h b/src/include/dpdk_cksum.h
|
||||
index 5b1b6f6..b8056f9 100644
|
||||
--- a/src/include/dpdk_cksum.h
|
||||
+++ b/src/include/dpdk_cksum.h
|
||||
@@ -45,8 +45,6 @@
|
||||
#include "lwip/pbuf.h"
|
||||
#endif
|
||||
|
||||
-extern uint64_t get_eth_params_rx_ol(void);
|
||||
-extern uint64_t get_eth_params_tx_ol(void);
|
||||
#if CHECKSUM_CHECK_IP_HW
|
||||
// for ip4_input
|
||||
static inline u64_t is_cksum_ipbad(struct pbuf *p) {
|
||||
diff --git a/src/include/lwip/netif.h b/src/include/lwip/netif.h
|
||||
index 057c51f..75f8d50 100644
|
||||
--- a/src/include/lwip/netif.h
|
||||
+++ b/src/include/lwip/netif.h
|
||||
@@ -106,6 +106,11 @@ extern "C" {
|
||||
* Set by the netif driver in its init function. */
|
||||
#define NETIF_FLAG_MLD6 0x40U
|
||||
|
||||
+#if GAZELLE_ENABLE
|
||||
+/** If set, use run to completion mode */
|
||||
+#define NETIF_FLAG_RTC_MODE 0x80U
|
||||
+#endif
|
||||
+
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -343,6 +348,10 @@ struct netif {
|
||||
u8_t hwaddr_len;
|
||||
/** flags (@see @ref netif_flags) */
|
||||
u8_t flags;
|
||||
+#if GAZELLE_ENABLE
|
||||
+ u64_t rxol_flags;
|
||||
+ u64_t txol_flags;
|
||||
+#endif
|
||||
/** descriptive abbreviation */
|
||||
char name[2];
|
||||
/** number of this interface. Used for @ref if_api and @ref netifapi_netif,
|
||||
@@ -464,6 +473,17 @@ void netif_set_down(struct netif *netif);
|
||||
*/
|
||||
#define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0)
|
||||
|
||||
+#if GAZELLE_ENABLE
|
||||
+#define netif_is_rtc_mode(netif) (((netif)->flags & NETIF_FLAG_RTC_MODE) ? (u8_t)1 : (u8_t)0)
|
||||
+#define netif_get_rxol_flags(netif) ((netif)->rxol_flags)
|
||||
+#define netif_get_txol_flags(netif) ((netif)->txol_flags)
|
||||
+
|
||||
+void netif_set_rtc_mode(struct netif *netif);
|
||||
+void netif_set_rxol_flags(struct netif *netif, u64_t flags);
|
||||
+void netif_set_txol_flags(struct netif *netif, u64_t flags);
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
#if LWIP_NETIF_STATUS_CALLBACK
|
||||
void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback);
|
||||
#endif /* LWIP_NETIF_STATUS_CALLBACK */
|
||||
--
|
||||
2.27.0
|
||||
|
||||
457
0075-adapt-read-write-for-rtc-mode.patch
Normal file
457
0075-adapt-read-write-for-rtc-mode.patch
Normal file
@ -0,0 +1,457 @@
|
||||
From be56e9eed8acf82a862d19ef4f890f309018ddde Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Sat, 28 Oct 2023 17:21:46 +0800
|
||||
Subject: [PATCH] adapt read/write for rtc mode
|
||||
|
||||
---
|
||||
src/api/api_msg.c | 14 ++--
|
||||
src/api/sockets.c | 21 ++---
|
||||
src/core/init.c | 2 +-
|
||||
src/core/pbuf.c | 7 ++
|
||||
src/core/tcp_out.c | 171 +++++++++++++++++++++++++++++++++--------
|
||||
src/core/udp.c | 2 +-
|
||||
src/include/lwip/tcp.h | 4 +
|
||||
src/include/lwipopts.h | 6 +-
|
||||
8 files changed, 174 insertions(+), 53 deletions(-)
|
||||
|
||||
diff --git a/src/api/api_msg.c b/src/api/api_msg.c
|
||||
index 3e982ab..d8b99ee 100644
|
||||
--- a/src/api/api_msg.c
|
||||
+++ b/src/api/api_msg.c
|
||||
@@ -1753,11 +1753,15 @@ lwip_netconn_do_writemore(struct netconn *conn WRITE_DELAYED_PARAM)
|
||||
write_more = 0;
|
||||
}
|
||||
#if GAZELLE_ENABLE
|
||||
- /* vector->ptr is private arg sock */
|
||||
- LWIP_UNUSED_ARG(dataptr);
|
||||
- write_more = 0;
|
||||
- err = tcp_write(conn->pcb.tcp, conn->current_msg->msg.w.vector->ptr, len, apiflags);
|
||||
- conn->current_msg->msg.w.len = len;
|
||||
+ if (netif_is_rtc_mode(netif_default)) {
|
||||
+ err = tcp_write(conn->pcb.tcp, dataptr, len, apiflags);
|
||||
+ } else {
|
||||
+ /* vector->ptr is private arg sock */
|
||||
+ LWIP_UNUSED_ARG(dataptr);
|
||||
+ write_more = 0;
|
||||
+ err = tcp_write_from_stack(conn->pcb.tcp, conn->current_msg->msg.w.vector->ptr, len, apiflags);
|
||||
+ conn->current_msg->msg.w.len = len;
|
||||
+ }
|
||||
conn->pcb.tcp->need_tso_send = 1;
|
||||
#else
|
||||
err = tcp_write(conn->pcb.tcp, dataptr, len, apiflags);
|
||||
diff --git a/src/api/sockets.c b/src/api/sockets.c
|
||||
index 8d573aa..e374f96 100644
|
||||
--- a/src/api/sockets.c
|
||||
+++ b/src/api/sockets.c
|
||||
@@ -1087,7 +1087,15 @@ lwip_recv_tcp(struct lwip_sock *sock, void *mem, size_t len, int flags)
|
||||
apiflags |= NETCONN_DONTBLOCK;
|
||||
}
|
||||
|
||||
-#if !GAZELLE_ENABLE
|
||||
+#if GAZELLE_ENABLE
|
||||
+ if (!netif_is_rtc_mode(netif_default)) {
|
||||
+ LWIP_UNUSED_ARG(recv_left);
|
||||
+ recvd = do_lwip_read_from_lwip(sock, flags, apiflags);
|
||||
+ if (recvd <= 0) {
|
||||
+ return recvd;
|
||||
+ }
|
||||
+ } else {
|
||||
+#endif
|
||||
do {
|
||||
struct pbuf *p;
|
||||
err_t err;
|
||||
@@ -1166,15 +1174,10 @@ lwip_recv_tcp(struct lwip_sock *sock, void *mem, size_t len, int flags)
|
||||
apiflags |= NETCONN_DONTBLOCK | NETCONN_NOFIN;
|
||||
/* @todo: do we need to support peeking more than one pbuf? */
|
||||
} while ((recv_left > 0) && !(flags & MSG_PEEK));
|
||||
-
|
||||
-lwip_recv_tcp_done:
|
||||
-#else /* GAZELLE_ENABLE */
|
||||
- LWIP_UNUSED_ARG(recv_left);
|
||||
- recvd = do_lwip_read_from_lwip(sock, flags, apiflags);
|
||||
- if (recvd <= 0) {
|
||||
- return recvd;
|
||||
+#if GAZELLE_ENABLE
|
||||
}
|
||||
-#endif /* GAZELLE_ENABLE */
|
||||
+#endif
|
||||
+lwip_recv_tcp_done:
|
||||
if (apiflags & NETCONN_NOAUTORCVD) {
|
||||
if ((recvd > 0) && !(flags & MSG_PEEK)) {
|
||||
/* ensure window update after copying all data */
|
||||
diff --git a/src/core/init.c b/src/core/init.c
|
||||
index 7b6214f..60e1c68 100644
|
||||
--- a/src/core/init.c
|
||||
+++ b/src/core/init.c
|
||||
@@ -306,7 +306,7 @@ PACK_STRUCT_END
|
||||
#if TCP_SNDLOWAT >= TCP_SND_BUF
|
||||
#error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must be less than TCP_SND_BUF. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
|
||||
#endif
|
||||
-#if TCP_SNDLOWAT >= (0xFFFFFFFF - (4 * TCP_MSS))
|
||||
+#if TCP_SNDLOWAT >= (0xFFFF - (4 * TCP_MSS))
|
||||
#error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must at least be 4*MSS below u16_t overflow!"
|
||||
#endif
|
||||
#if TCP_SNDQUEUELOWAT >= TCP_SND_QUEUELEN
|
||||
diff --git a/src/core/pbuf.c b/src/core/pbuf.c
|
||||
index 975e240..61690ff 100644
|
||||
--- a/src/core/pbuf.c
|
||||
+++ b/src/core/pbuf.c
|
||||
@@ -117,6 +117,7 @@ pbuf_skip_const(const struct pbuf *in, u16_t in_offset, u16_t *out_offset);
|
||||
volatile u8_t pbuf_free_ooseq_pending;
|
||||
#define PBUF_POOL_IS_EMPTY() pbuf_pool_is_empty()
|
||||
|
||||
+#if !GAZELLE_ENABLE
|
||||
/**
|
||||
* Attempt to reclaim some memory from queued out-of-sequence TCP segments
|
||||
* if we run out of pool pbufs. It's better to give priority to new packets
|
||||
@@ -176,6 +177,7 @@ pbuf_pool_is_empty(void)
|
||||
}
|
||||
#endif /* PBUF_POOL_FREE_OOSEQ_QUEUE_CALL */
|
||||
}
|
||||
+#endif /* GAZELLE_ENABLE */
|
||||
#endif /* !LWIP_TCP || !TCP_QUEUE_OOSEQ || !PBUF_POOL_FREE_OOSEQ */
|
||||
|
||||
/* Initialize members of struct pbuf after allocation */
|
||||
@@ -238,6 +240,10 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
|
||||
p = pbuf_alloc_reference(NULL, length, type);
|
||||
break;
|
||||
case PBUF_POOL: {
|
||||
+#if GAZELLE_ENABLE
|
||||
+ // alloc from pktmbuf pool, one pbuf is enough
|
||||
+ p = do_lwip_alloc_pbuf(layer, length, type);
|
||||
+#else
|
||||
struct pbuf *q, *last;
|
||||
u16_t rem_len; /* remaining length */
|
||||
p = NULL;
|
||||
@@ -273,6 +279,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
|
||||
rem_len = (u16_t)(rem_len - qlen);
|
||||
offset = 0;
|
||||
} while (rem_len > 0);
|
||||
+#endif /* GAZELLE_ENABLE */
|
||||
break;
|
||||
}
|
||||
case PBUF_RAM: {
|
||||
diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c
|
||||
index e2c9d63..073d989 100644
|
||||
--- a/src/core/tcp_out.c
|
||||
+++ b/src/core/tcp_out.c
|
||||
@@ -515,15 +515,18 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
|
||||
* pos records progress as data is segmented.
|
||||
*/
|
||||
|
||||
-#if !GAZELLE_ENABLE
|
||||
/* Find the tail of the unsent queue. */
|
||||
if (pcb->unsent != NULL) {
|
||||
u16_t space;
|
||||
u16_t unsent_optlen;
|
||||
|
||||
+#if GAZELLE_ENABLE
|
||||
+ last_unsent = pcb->last_unsent;
|
||||
+#else
|
||||
/* @todo: this could be sped up by keeping last_unsent in the pcb */
|
||||
for (last_unsent = pcb->unsent; last_unsent->next != NULL;
|
||||
last_unsent = last_unsent->next);
|
||||
+#endif
|
||||
|
||||
/* Usable space at the end of the last unsent segment */
|
||||
unsent_optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(last_unsent->flags, pcb);
|
||||
@@ -631,9 +634,6 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
|
||||
pcb->unsent_oversize == 0);
|
||||
#endif /* TCP_OVERSIZE */
|
||||
}
|
||||
-#else /* GAZELLE_ENABLE */
|
||||
- last_unsent = pcb->last_unsent;
|
||||
-#endif /* GAZELLE_ENABLE */
|
||||
|
||||
/*
|
||||
* Phase 3: Create new segments.
|
||||
@@ -651,7 +651,6 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
|
||||
u8_t chksum_swapped = 0;
|
||||
#endif /* TCP_CHECKSUM_ON_COPY */
|
||||
|
||||
-#if !GAZELLE_ENABLE
|
||||
if (apiflags & TCP_WRITE_FLAG_COPY) {
|
||||
/* If copy is set, memory should be allocated and data copied
|
||||
* into pbuf */
|
||||
@@ -698,13 +697,6 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
|
||||
/* Concatenate the headers and data pbufs together. */
|
||||
pbuf_cat(p/*header*/, p2/*data*/);
|
||||
}
|
||||
-#else /* GAZELLE_ENABLE */
|
||||
- p = do_lwip_get_from_sendring((struct lwip_sock *)arg, len - pos, &apiflags);
|
||||
- if (p == NULL) {
|
||||
- break;
|
||||
- }
|
||||
- seglen = p->tot_len;
|
||||
-#endif /* GAZELLE_ENABLE */
|
||||
|
||||
queuelen += pbuf_clen(p);
|
||||
|
||||
@@ -714,14 +706,7 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
|
||||
if (queuelen > LWIP_MIN(TCP_SND_QUEUELEN, TCP_SNDQUEUELEN_OVERFLOW)) {
|
||||
LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_write: queue too long %"U16_F" (%d)\n",
|
||||
queuelen, (int)TCP_SND_QUEUELEN));
|
||||
-#if GAZELLE_ENABLE
|
||||
- if (pos > 0) {
|
||||
- queuelen -= pbuf_clen(p);
|
||||
- break;
|
||||
- }
|
||||
-#else
|
||||
pbuf_free(p);
|
||||
-#endif
|
||||
goto memerr;
|
||||
}
|
||||
|
||||
@@ -730,12 +715,6 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
|
||||
#endif
|
||||
|
||||
if ((seg = tcp_create_segment(pcb, p, 0, pcb->snd_lbb + pos, optflags)) == NULL) {
|
||||
-#if GAZELLE_ENABLE
|
||||
- if (pos > 0) {
|
||||
- queuelen -= pbuf_clen(p);
|
||||
- break;
|
||||
- }
|
||||
-#endif
|
||||
goto memerr;
|
||||
}
|
||||
#if TCP_OVERSIZE_DBGCHECK
|
||||
@@ -763,9 +742,6 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
|
||||
lwip_ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg)));
|
||||
|
||||
pos += seglen;
|
||||
-#if GAZELLE_ENABLE
|
||||
- do_lwip_get_from_sendring_over((struct lwip_sock*)arg);
|
||||
-#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -855,12 +831,9 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
|
||||
if (queue) {
|
||||
pcb->last_unsent = prev_seg;
|
||||
}
|
||||
- pcb->snd_lbb += pos;
|
||||
- pcb->snd_buf -= pos;
|
||||
-#else
|
||||
+#endif
|
||||
pcb->snd_lbb += len;
|
||||
pcb->snd_buf -= len;
|
||||
-#endif
|
||||
pcb->snd_queuelen = queuelen;
|
||||
|
||||
LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_write: %"S16_F" (after enqueued)\n",
|
||||
@@ -880,14 +853,12 @@ memerr:
|
||||
tcp_set_flags(pcb, TF_NAGLEMEMERR);
|
||||
TCP_STATS_INC(tcp.memerr);
|
||||
|
||||
-#if !GAZELLE_ENABLE
|
||||
if (concat_p != NULL) {
|
||||
pbuf_free(concat_p);
|
||||
}
|
||||
if (queue != NULL) {
|
||||
tcp_segs_free(queue);
|
||||
}
|
||||
-#endif
|
||||
if (pcb->snd_queuelen != 0) {
|
||||
LWIP_ASSERT("tcp_write: valid queue length", pcb->unacked != NULL ||
|
||||
pcb->unsent != NULL);
|
||||
@@ -896,6 +867,137 @@ memerr:
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
+#if GAZELLE_ENABLE
|
||||
+err_t
|
||||
+tcp_write_from_stack(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
|
||||
+{
|
||||
+ struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL;
|
||||
+ u16_t pos = 0; /* position in 'arg' data */
|
||||
+ u16_t queuelen;
|
||||
+ u8_t optlen;
|
||||
+ u8_t optflags = 0;
|
||||
+ err_t err;
|
||||
+ u16_t mss_local;
|
||||
+
|
||||
+ /* don't allocate segments bigger than half the maximum window we ever received */
|
||||
+ mss_local = LWIP_MIN(pcb->mss, TCPWND_MIN16(pcb->snd_wnd_max / 2));
|
||||
+ mss_local = mss_local ? mss_local : pcb->mss;
|
||||
+
|
||||
+ err = tcp_write_checks(pcb, len);
|
||||
+ if (err != ERR_OK) {
|
||||
+ return err;
|
||||
+ }
|
||||
+ queuelen = pcb->snd_queuelen;
|
||||
+
|
||||
+ optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(0, pcb);
|
||||
+
|
||||
+ last_unsent = pcb->last_unsent;
|
||||
+
|
||||
+ /*
|
||||
+ * get pbuf from sendring and create new segments.
|
||||
+ */
|
||||
+ while (pos < len) {
|
||||
+ struct pbuf *p;
|
||||
+ u16_t left = len - pos;
|
||||
+ u16_t max_len = mss_local - optlen;
|
||||
+ u16_t seglen = LWIP_MIN(left, max_len);
|
||||
+
|
||||
+ p = do_lwip_get_from_sendring((struct lwip_sock *)arg, len - pos, &apiflags);
|
||||
+ if (p == NULL) {
|
||||
+ break;
|
||||
+ }
|
||||
+ seglen = p->tot_len;
|
||||
+
|
||||
+ queuelen += pbuf_clen(p);
|
||||
+
|
||||
+ /* Now that there are more segments queued, we check again if the
|
||||
+ * length of the queue exceeds the configured maximum or
|
||||
+ * overflows. */
|
||||
+ if (queuelen > LWIP_MIN(TCP_SND_QUEUELEN, TCP_SNDQUEUELEN_OVERFLOW)) {
|
||||
+ LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_write: queue too long %"U16_F" (%d)\n",
|
||||
+ queuelen, (int)TCP_SND_QUEUELEN));
|
||||
+ if (pos > 0) {
|
||||
+ queuelen -= pbuf_clen(p);
|
||||
+ break;
|
||||
+ }
|
||||
+ goto memerr;
|
||||
+ }
|
||||
+
|
||||
+ lstack_calculate_aggregate(2, p->tot_len);
|
||||
+
|
||||
+ if ((seg = tcp_create_segment(pcb, p, 0, pcb->snd_lbb + pos, optflags)) == NULL) {
|
||||
+ if (pos > 0) {
|
||||
+ queuelen -= pbuf_clen(p);
|
||||
+ break;
|
||||
+ }
|
||||
+ goto memerr;
|
||||
+ }
|
||||
+
|
||||
+ /* first segment of to-be-queued data? */
|
||||
+ if (queue == NULL) {
|
||||
+ queue = seg;
|
||||
+ } else {
|
||||
+ /* Attach the segment to the end of the queued segments */
|
||||
+ LWIP_ASSERT("prev_seg != NULL", prev_seg != NULL);
|
||||
+ prev_seg->next = seg;
|
||||
+ }
|
||||
+ /* remember last segment of to-be-queued data for next iteration */
|
||||
+ prev_seg = seg;
|
||||
+
|
||||
+ LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_TRACE, ("tcp_write: queueing %"U32_F":%"U32_F"\n",
|
||||
+ lwip_ntohl(seg->tcphdr->seqno),
|
||||
+ lwip_ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg)));
|
||||
+
|
||||
+ pos += seglen;
|
||||
+ do_lwip_get_from_sendring_over((struct lwip_sock*)arg);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Phase 3: Append queue to pcb->unsent. Queue may be NULL, but that
|
||||
+ * is harmless
|
||||
+ */
|
||||
+ if (last_unsent == NULL) {
|
||||
+ pcb->unsent = queue;
|
||||
+ } else {
|
||||
+ last_unsent->next = queue;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Finally update the pcb state.
|
||||
+ */
|
||||
+ if (queue) {
|
||||
+ pcb->last_unsent = prev_seg;
|
||||
+ }
|
||||
+ pcb->snd_lbb += pos;
|
||||
+ pcb->snd_buf -= pos;
|
||||
+ pcb->snd_queuelen = queuelen;
|
||||
+
|
||||
+ LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_write: %"S16_F" (after enqueued)\n",
|
||||
+ pcb->snd_queuelen));
|
||||
+ if (pcb->snd_queuelen != 0) {
|
||||
+ LWIP_ASSERT("tcp_write: valid queue length",
|
||||
+ pcb->unacked != NULL || pcb->unsent != NULL);
|
||||
+ }
|
||||
+
|
||||
+ /* Set the PSH flag in the last segment that we enqueued. */
|
||||
+ if (seg != NULL && seg->tcphdr != NULL && ((apiflags & TCP_WRITE_FLAG_MORE) == 0)) {
|
||||
+ TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
|
||||
+ }
|
||||
+
|
||||
+ return ERR_OK;
|
||||
+memerr:
|
||||
+ tcp_set_flags(pcb, TF_NAGLEMEMERR);
|
||||
+ TCP_STATS_INC(tcp.memerr);
|
||||
+
|
||||
+ if (pcb->snd_queuelen != 0) {
|
||||
+ LWIP_ASSERT("tcp_write: valid queue length", pcb->unacked != NULL ||
|
||||
+ pcb->unsent != NULL);
|
||||
+ }
|
||||
+ LWIP_DEBUGF(TCP_QLEN_DEBUG | LWIP_DBG_STATE, ("tcp_write: %"S16_F" (with mem err)\n", pcb->snd_queuelen));
|
||||
+ return ERR_MEM;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/**
|
||||
* Split segment on the head of the unsent queue. If return is not
|
||||
* ERR_OK, existing head remains intact
|
||||
@@ -2095,6 +2197,7 @@ tcp_rexmit(struct tcp_pcb *pcb)
|
||||
|
||||
/* Don't take any rtt measurements after retransmitting. */
|
||||
pcb->rttest = 0;
|
||||
+ pcb->need_tso_send = 1;
|
||||
|
||||
/* Do the actual retransmission. */
|
||||
MIB2_STATS_INC(mib2.tcpretranssegs);
|
||||
diff --git a/src/core/udp.c b/src/core/udp.c
|
||||
index 937a045..828a489 100644
|
||||
--- a/src/core/udp.c
|
||||
+++ b/src/core/udp.c
|
||||
@@ -414,7 +414,7 @@ udp_input(struct pbuf *p, struct netif *inp)
|
||||
if (udphdr->chksum != 0) {
|
||||
#if CHECKSUM_CHECK_UDP_HW
|
||||
u64_t ret = 0;
|
||||
- if (netif_get_txol_flags(inp) & DEV_RX_OFFLOAD_UDP_CKSUM) {
|
||||
+ if (netif_get_rxol_flags(inp) & DEV_RX_OFFLOAD_UDP_CKSUM) {
|
||||
ret = is_cksum_bad(p);
|
||||
} else {
|
||||
ret = ip_chksum_pseudo(p, IP_PROTO_UDP, p->tot_len,
|
||||
diff --git a/src/include/lwip/tcp.h b/src/include/lwip/tcp.h
|
||||
index e13099c..959df3e 100644
|
||||
--- a/src/include/lwip/tcp.h
|
||||
+++ b/src/include/lwip/tcp.h
|
||||
@@ -567,6 +567,10 @@ err_t tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx);
|
||||
|
||||
err_t tcp_write (struct tcp_pcb *pcb, const void *dataptr, u16_t len,
|
||||
u8_t apiflags);
|
||||
+#if GAZELLE_ENABLE
|
||||
+err_t tcp_write_from_stack (struct tcp_pcb *pcb, const void *dataptr, u16_t len,
|
||||
+ u8_t apiflags);
|
||||
+#endif
|
||||
|
||||
void tcp_setprio (struct tcp_pcb *pcb, u8_t prio);
|
||||
|
||||
diff --git a/src/include/lwipopts.h b/src/include/lwipopts.h
|
||||
index baf739e..fdd4f87 100644
|
||||
--- a/src/include/lwipopts.h
|
||||
+++ b/src/include/lwipopts.h
|
||||
@@ -208,8 +208,8 @@
|
||||
#define TCP_LISTEN_BACKLOG 1
|
||||
#define TCP_DEFAULT_LISTEN_BACKLOG 0xff
|
||||
|
||||
-#define TCP_OVERSIZE 0
|
||||
-#define LWIP_NETIF_TX_SINGLE_PBUF 0
|
||||
+#define TCP_OVERSIZE TCP_MSS
|
||||
+#define LWIP_NETIF_TX_SINGLE_PBUF 1
|
||||
|
||||
#define TCP_MSS (FRAME_MTU - IP_HLEN - TCP_HLEN)
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
|
||||
#define TCP_SND_QUEUELEN (8191)
|
||||
|
||||
-#define TCP_SNDLOWAT (TCP_SND_BUF / 5)
|
||||
+#define TCP_SNDLOWAT (32768)
|
||||
|
||||
#define TCP_SNDQUEUELOWAT (TCP_SND_QUEUELEN / 5)
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
38
0076-fix-recvmsg-return-EINVAL.patch
Normal file
38
0076-fix-recvmsg-return-EINVAL.patch
Normal file
@ -0,0 +1,38 @@
|
||||
From 92091a697ae8dac4026fd75a421ad9464aaa253e Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Wed, 25 Oct 2023 15:44:19 +0800
|
||||
Subject: [PATCH 76/77] fix recvmsg return EINVAL
|
||||
|
||||
---
|
||||
src/api/sockets.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/src/api/sockets.c b/src/api/sockets.c
|
||||
index b6c7b05..1d71427 100644
|
||||
--- a/src/api/sockets.c
|
||||
+++ b/src/api/sockets.c
|
||||
@@ -1492,9 +1492,21 @@ lwip_recvmsg(int s, struct msghdr *message, int flags)
|
||||
/* check for valid vectors */
|
||||
buflen = 0;
|
||||
for (i = 0; i < message->msg_iovlen; i++) {
|
||||
+#if GAZELLE_ENABLE
|
||||
+ /* msg_iov[i].iov_len == 0 dont return ERRVAL
|
||||
+ * According to the Single Unix Specification we should return EINVAL if an elment length is < 0
|
||||
+ * when cast to ssize_t
|
||||
+ */
|
||||
+ if ((message->msg_iov[i].iov_base == NULL) || ((ssize_t)message->msg_iov[i].iov_len < 0) ||
|
||||
+#else
|
||||
if ((message->msg_iov[i].iov_base == NULL) || ((ssize_t)message->msg_iov[i].iov_len <= 0) ||
|
||||
+#endif
|
||||
((size_t)(ssize_t)message->msg_iov[i].iov_len != message->msg_iov[i].iov_len) ||
|
||||
+#if GAZELLE_ENABLE
|
||||
+ ((ssize_t)(buflen + (ssize_t)message->msg_iov[i].iov_len) < 0)) {
|
||||
+#else
|
||||
((ssize_t)(buflen + (ssize_t)message->msg_iov[i].iov_len) <= 0)) {
|
||||
+#endif
|
||||
sock_set_errno(sock, err_to_errno(ERR_VAL));
|
||||
done_socket(sock);
|
||||
return -1;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
123
0077-adpat-event-for-rtc-mode.patch
Normal file
123
0077-adpat-event-for-rtc-mode.patch
Normal file
@ -0,0 +1,123 @@
|
||||
From e719fde7f90a1dff8daeb23170febb5ff38903c9 Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Fri, 27 Oct 2023 19:19:42 +0800
|
||||
Subject: [PATCH 77/77] adpat event for rtc mode
|
||||
|
||||
---
|
||||
src/api/api_msg.c | 8 ++------
|
||||
src/api/sockets.c | 33 ++++++++++++++++++++++++++++++---
|
||||
src/include/eventpoll.h | 4 ++++
|
||||
3 files changed, 36 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/api/api_msg.c b/src/api/api_msg.c
|
||||
index 9a8992a..5e09505 100644
|
||||
--- a/src/api/api_msg.c
|
||||
+++ b/src/api/api_msg.c
|
||||
@@ -293,11 +293,9 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p,
|
||||
#endif /* LWIP_SO_RCVBUF */
|
||||
#if GAZELLE_UDP_ENABLE
|
||||
do_lwip_add_recvlist(conn->socket);
|
||||
- LWIP_UNUSED_ARG(len);
|
||||
-#else /* GAZELLE_UDP_ENABLE */
|
||||
+#endif /* GAZELLE_UDP_ENABLE */
|
||||
/* Register event with callback */
|
||||
API_EVENT(conn, NETCONN_EVT_RCVPLUS, len);
|
||||
-#endif /* GAZELLE_UDP_ENABLE */
|
||||
}
|
||||
}
|
||||
#endif /* LWIP_UDP */
|
||||
@@ -357,11 +355,9 @@ recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
|
||||
#endif /* LWIP_SO_RCVBUF */
|
||||
#if GAZELLE_ENABLE
|
||||
do_lwip_add_recvlist(conn->socket);
|
||||
- LWIP_UNUSED_ARG(len);
|
||||
-#else
|
||||
+#endif
|
||||
/* Register event with callback */
|
||||
API_EVENT(conn, NETCONN_EVT_RCVPLUS, len);
|
||||
-#endif
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
diff --git a/src/api/sockets.c b/src/api/sockets.c
|
||||
index 1d71427..d62290d 100644
|
||||
--- a/src/api/sockets.c
|
||||
+++ b/src/api/sockets.c
|
||||
@@ -2744,29 +2744,56 @@ event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len)
|
||||
check_waiters = 0;
|
||||
}
|
||||
#if GAZELLE_ENABLE
|
||||
- if (conn->acceptmbox != NULL && !sys_mbox_empty(conn->acceptmbox)) {
|
||||
- add_sock_event(sock, POLLIN);
|
||||
+ if (netif_is_rtc_mode(netif_default)) {
|
||||
+ if (sock->rcvevent == 1) {
|
||||
+ add_sock_event_nolock(sock, POLLIN);
|
||||
+ }
|
||||
+ } else {
|
||||
+ if (conn->acceptmbox != NULL && !sys_mbox_empty(conn->acceptmbox)) {
|
||||
+ add_sock_event(sock, POLLIN);
|
||||
+ }
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case NETCONN_EVT_RCVMINUS:
|
||||
sock->rcvevent--;
|
||||
check_waiters = 0;
|
||||
+#if GAZELLE_ENABLE
|
||||
+ if (netif_is_rtc_mode(netif_default)) {
|
||||
+ if (sock->rcvevent == 0) {
|
||||
+ del_sock_event_nolock(sock, POLLIN);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
break;
|
||||
case NETCONN_EVT_SENDPLUS:
|
||||
if (sock->sendevent) {
|
||||
check_waiters = 0;
|
||||
}
|
||||
sock->sendevent = 1;
|
||||
+#if GAZELLE_ENABLE
|
||||
+ if (netif_is_rtc_mode(netif_default)) {
|
||||
+ add_sock_event_nolock(sock, POLLOUT);
|
||||
+ }
|
||||
+#endif
|
||||
break;
|
||||
case NETCONN_EVT_SENDMINUS:
|
||||
sock->sendevent = 0;
|
||||
check_waiters = 0;
|
||||
+#if GAZELLE_ENABLE
|
||||
+ if (netif_is_rtc_mode(netif_default)) {
|
||||
+ del_sock_event_nolock(sock, POLLOUT);
|
||||
+ }
|
||||
+#endif
|
||||
break;
|
||||
case NETCONN_EVT_ERROR:
|
||||
sock->errevent = 1;
|
||||
#if GAZELLE_ENABLE
|
||||
- add_sock_event(sock, EPOLLERR);
|
||||
+ if (netif_is_rtc_mode(netif_default)) {
|
||||
+ add_sock_event_nolock(sock, EPOLLERR);
|
||||
+ } else {
|
||||
+ add_sock_event(sock, EPOLLERR);
|
||||
+ }
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
diff --git a/src/include/eventpoll.h b/src/include/eventpoll.h
|
||||
index dd65a4d..5bc5206 100644
|
||||
--- a/src/include/eventpoll.h
|
||||
+++ b/src/include/eventpoll.h
|
||||
@@ -66,6 +66,10 @@ struct libos_epoll {
|
||||
|
||||
struct lwip_sock;
|
||||
extern void add_sock_event(struct lwip_sock *sock, uint32_t event);
|
||||
+extern void add_sock_event_nolock(struct lwip_sock *sock, uint32_t event);
|
||||
+extern void del_sock_event(struct lwip_sock *sock, uint32_t event);
|
||||
+extern void del_sock_event_nolock(struct lwip_sock *sock, uint32_t event);
|
||||
+
|
||||
extern int32_t lstack_epoll_close(int32_t);
|
||||
|
||||
#endif /* __EVENTPOLL_H__ */
|
||||
--
|
||||
2.27.0
|
||||
|
||||
12
lwip.spec
12
lwip.spec
@ -4,7 +4,7 @@
|
||||
Summary: lwip is a small independent implementation of the TCP/IP protocol suite
|
||||
Name: lwip
|
||||
Version: 2.1.3
|
||||
Release: 79
|
||||
Release: 80
|
||||
License: BSD
|
||||
URL: http://savannah.nongnu.org/projects/lwip/
|
||||
Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip
|
||||
@ -86,6 +86,10 @@ Patch9069: 0070-add-CHECKSUM_UDP-when-not-support-OFFLOAD_UDP_CHECKS.patch
|
||||
Patch9070: 0071-fix-pbuf-tot_len-incorrect-after-pbuf_split_64k-is-c.patch
|
||||
Patch9071: 0072-add-O_NONBLOCK-and-FIONBIO-when-not-defined.patch
|
||||
Patch9072: 0073-lstack_lwip-external-api-start-with-do_lwip_-prefix.patch
|
||||
Patch9073: 0074-gazelle-offloads-are-registered-to-lwip.patch
|
||||
Patch9074: 0075-adapt-read-write-for-rtc-mode.patch
|
||||
Patch9075: 0076-fix-recvmsg-return-EINVAL.patch
|
||||
Patch9076: 0077-adpat-event-for-rtc-mode.patch
|
||||
|
||||
BuildRequires: gcc-c++ dos2unix dpdk-devel
|
||||
|
||||
@ -116,6 +120,12 @@ cd %{_builddir}/%{name}-%{version}/src
|
||||
%{_libdir}/liblwip.a
|
||||
|
||||
%changelog
|
||||
* Fri Oct 27 2023 jiangheng <jiangheng14@huawei.com> - 2.1.3-80
|
||||
- adapt read/write for rtc mode
|
||||
- fix recvmsg return EINVAL
|
||||
- adapt event for rtc mode
|
||||
- gazelle offloads are registerd to lwip
|
||||
|
||||
* Fri Nov 3 2023 liyanan <liyanan61@h-parners.com> - 2.1.3-79
|
||||
- Adapt dpdk fallback
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user