Skip to content

Commit a8630bb

Browse files
committed
SMSTCPIP: do not use op-completion signalling if TCPIP core locking is used, as it is redundant.
1 parent 7df4cdd commit a8630bb

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

modules/network/SMSTCPIP/api_msg.c

+15-15
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ do_newconn(struct api_msg_msg *msg)
283283
/* This "new" connection already has a PCB allocated. */
284284
/* Is this an error condition? Should it be deleted?
285285
We currently just are happy and return. */
286-
sys_mbox_post(msg->conn->mbox, NULL);
286+
TCPIP_APIMSG_ACK(msg->conn->mbox);
287287
return;
288288
}
289289

@@ -340,7 +340,7 @@ do_newconn(struct api_msg_msg *msg)
340340
}
341341

342342

343-
sys_mbox_post(msg->conn->mbox, NULL);
343+
TCPIP_APIMSG_ACK(msg->conn->mbox);
344344
}
345345

346346

@@ -392,7 +392,7 @@ do_delconn(struct api_msg_msg *msg)
392392
}
393393

394394
if (msg->conn->mbox != SYS_MBOX_NULL) {
395-
sys_mbox_post(msg->conn->mbox, NULL);
395+
TCPIP_APIMSG_ACK(msg->conn->mbox);
396396
}
397397
}
398398

@@ -455,7 +455,7 @@ do_bind(struct api_msg_msg *msg)
455455
default:
456456
break;
457457
}
458-
sys_mbox_post(msg->conn->mbox, NULL);
458+
TCPIP_APIMSG_ACK(msg->conn->mbox);
459459
}
460460
#if LWIP_TCP
461461

@@ -495,7 +495,7 @@ do_connect(struct api_msg_msg *msg)
495495
msg->conn->pcb.udp = udp_new();
496496
if (msg->conn->pcb.udp == NULL) {
497497
msg->conn->err = ERR_MEM;
498-
sys_mbox_post(msg->conn->mbox, NULL);
498+
TCPIP_APIMSG_ACK(msg->conn->mbox);
499499
return;
500500
}
501501
udp_setflags(msg->conn->pcb.udp, UDP_FLAGS_UDPLITE);
@@ -505,7 +505,7 @@ do_connect(struct api_msg_msg *msg)
505505
msg->conn->pcb.udp = udp_new();
506506
if (msg->conn->pcb.udp == NULL) {
507507
msg->conn->err = ERR_MEM;
508-
sys_mbox_post(msg->conn->mbox, NULL);
508+
TCPIP_APIMSG_ACK(msg->conn->mbox);
509509
return;
510510
}
511511
udp_setflags(msg->conn->pcb.udp, UDP_FLAGS_NOCHKSUM);
@@ -515,7 +515,7 @@ do_connect(struct api_msg_msg *msg)
515515
msg->conn->pcb.udp = udp_new();
516516
if (msg->conn->pcb.udp == NULL) {
517517
msg->conn->err = ERR_MEM;
518-
sys_mbox_post(msg->conn->mbox, NULL);
518+
TCPIP_APIMSG_ACK(msg->conn->mbox);
519519
return;
520520
}
521521
udp_recv(msg->conn->pcb.udp, recv_udp, msg->conn);
@@ -526,7 +526,7 @@ do_connect(struct api_msg_msg *msg)
526526
msg->conn->pcb.tcp = tcp_new();
527527
if (msg->conn->pcb.tcp == NULL) {
528528
msg->conn->err = ERR_MEM;
529-
sys_mbox_post(msg->conn->mbox, NULL);
529+
TCPIP_APIMSG_ACK(msg->conn->mbox);
530530
return;
531531
}
532532
#endif
@@ -538,7 +538,7 @@ do_connect(struct api_msg_msg *msg)
538538
#if LWIP_RAW
539539
case NETCONN_RAW:
540540
raw_connect(msg->conn->pcb.raw, msg->msg.bc.ipaddr);
541-
sys_mbox_post(msg->conn->mbox, NULL);
541+
TCPIP_APIMSG_ACK(msg->conn->mbox);
542542
break;
543543
#endif
544544
#if LWIP_UDP
@@ -548,7 +548,7 @@ do_connect(struct api_msg_msg *msg)
548548
/* FALLTHROUGH */
549549
case NETCONN_UDP:
550550
udp_connect(msg->conn->pcb.udp, msg->msg.bc.ipaddr, msg->msg.bc.port);
551-
sys_mbox_post(msg->conn->mbox, NULL);
551+
TCPIP_APIMSG_ACK(msg->conn->mbox);
552552
break;
553553
#endif
554554
#if LWIP_TCP
@@ -589,7 +589,7 @@ do_disconnect(struct api_msg_msg *msg)
589589
default:
590590
break;
591591
}
592-
sys_mbox_post(msg->conn->mbox, NULL);
592+
TCPIP_APIMSG_ACK(msg->conn->mbox);
593593
}
594594

595595

@@ -633,7 +633,7 @@ do_listen(struct api_msg_msg *msg)
633633
break;
634634
}
635635
}
636-
sys_mbox_post(msg->conn->mbox, NULL);
636+
TCPIP_APIMSG_ACK(msg->conn->mbox);
637637
}
638638

639639
static void
@@ -688,7 +688,7 @@ do_send(struct api_msg_msg *msg)
688688
break;
689689
}
690690
}
691-
sys_mbox_post(msg->conn->mbox, NULL);
691+
TCPIP_APIMSG_ACK(msg->conn->mbox);
692692
}
693693

694694
static void do_recv(struct api_msg_msg *msg)
@@ -747,7 +747,7 @@ do_write(struct api_msg_msg *msg)
747747
break;
748748
}
749749
}
750-
sys_mbox_post(msg->conn->mbox, NULL);
750+
TCPIP_APIMSG_ACK(msg->conn->mbox);
751751
}
752752

753753
static void
@@ -782,7 +782,7 @@ do_close(struct api_msg_msg *msg)
782782
break;
783783
}
784784
}
785-
sys_mbox_post(msg->conn->mbox, NULL);
785+
TCPIP_APIMSG_ACK(msg->conn->mbox);
786786
}
787787

788788
api_msg_decode __decode__[API_MSG_MAX] = {

modules/network/SMSTCPIP/include/lwip/tcpip.h

+2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ extern sys_sem_t lock_tcpip_core;
4343
#define LOCK_TCPIP_CORE() sys_sem_wait(lock_tcpip_core)
4444
/** Unlock lwIP core mutex (needs @ref LWIP_TCPIP_CORE_LOCKING 1) */
4545
#define UNLOCK_TCPIP_CORE() sys_sem_signal(lock_tcpip_core)
46+
#define TCPIP_APIMSG_ACK(m)
4647
#else /* LWIP_TCPIP_CORE_LOCKING */
4748
#define LOCK_TCPIP_CORE()
4849
#define UNLOCK_TCPIP_CORE()
50+
#define TCPIP_APIMSG_ACK(m) sys_mbox_post(m, NULL)
4951
#endif /* LWIP_TCPIP_CORE_LOCKING */
5052

5153
void tcpip_init(void (*tcpip_init_done)(void *), void *arg);

0 commit comments

Comments
 (0)