From 43e2e22b40e8f36e358e44ac2e4d575767d5b165 Mon Sep 17 00:00:00 2001 From: Sebastian Doell Date: Tue, 19 Mar 2024 13:56:10 +0100 Subject: [PATCH 1/4] [NXDRVLINUX-148] - Add auto-loading of the kernel module for known PCI cards. --- uio_netx/uio_netx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uio_netx/uio_netx.c b/uio_netx/uio_netx.c index 5f7e9bc..f82a77e 100644 --- a/uio_netx/uio_netx.c +++ b/uio_netx/uio_netx.c @@ -566,6 +566,9 @@ static struct pci_device_id netx_pci_ids[] = { { 0, } }; +/* publish PCI ids, to provide automatic load for known PCI cards */ +MODULE_DEVICE_TABLE(pci, netx_pci_ids); + static struct pci_driver netx_pci_driver = { .name = "netx", .id_table = netx_pci_ids, From 578fc92ffdf709ecdf9f2d8ef56bc87157cca80a Mon Sep 17 00:00:00 2001 From: Sebastian Doell Date: Tue, 19 Mar 2024 14:27:22 +0100 Subject: [PATCH 2/4] [NXDRVLINUX-149] - Fix server/client connection establishment failure due to a time consuming (>timeout on client side) call of getnameinfo(). --- examples/tcpserver/tcp_connector.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/tcpserver/tcp_connector.c b/examples/tcpserver/tcp_connector.c index adcf977..4bec32c 100644 --- a/examples/tcpserver/tcp_connector.c +++ b/examples/tcpserver/tcp_connector.c @@ -233,6 +233,16 @@ void* ServerThread(void* pvParam) /* print host-ip */ printf("Connected with client : %s\n", inet_ntoa(tSockAddr.sin_addr)); + /* NOTE: To prevent timeout on client side, as getnameinfo() may take */ + /* more time, first start client thread then retrieve host name. */ + if ( setsockopt(hClient, IPPROTO_TCP, TCP_NODELAY, (void*)&iNoDelay, sizeof(iNoDelay)) != 0 ) + { + printf("The server is not able to send small packets.\n"); + printf("So the communication could be very slow!\n"); + } + ptTcpData->hClient = hClient; + pthread_create(&ptTcpData->hClientThread, NULL,ClientThread, (void*)ptTcpData); + /* Query remote name */ if (0 == getnameinfo( (struct sockaddr *) &tSockAddr, sizeof (struct sockaddr), szHostname,NI_MAXHOST, NULL, 0, 0)) @@ -243,16 +253,6 @@ void* ServerThread(void* pvParam) { printf("Host name unknown!\n"); } - - if ( setsockopt(hClient, IPPROTO_TCP, TCP_NODELAY, (void*)&iNoDelay, sizeof(iNoDelay)) != 0 ) - { - printf("The server is not able to send small packets.\n"); - printf("So the communication could be very slow!\n"); - } - - ptTcpData->hClient = hClient; - pthread_create(&ptTcpData->hClientThread, NULL,ClientThread, (void*)ptTcpData); - } } } From 60184823579de2062f4078c66f5d02c6450f8f83 Mon Sep 17 00:00:00 2001 From: Sebastian Doell Date: Thu, 21 Mar 2024 14:05:25 +0100 Subject: [PATCH 3/4] [NXDRVLINUX-150] - Fix "virteth" device allocation error, which led to an access violation at shutdown. --- libcifx/netx_tap/netx_tap.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/libcifx/netx_tap/netx_tap.c b/libcifx/netx_tap/netx_tap.c index 023551c..43283b9 100644 --- a/libcifx/netx_tap/netx_tap.c +++ b/libcifx/netx_tap/netx_tap.c @@ -264,19 +264,10 @@ void* cifxeth_create_device(NETX_ETH_DEV_CFG_T* config) /* Device successfully created */ OS_EnterLock( g_eth_list_lock); - if ((internal_dev = OS_Memalloc( sizeof(internal_dev))) != NULL) - { - TAILQ_INSERT_TAIL( &s_DeviceList, internal_dev, lentry); - ret = internal_dev; - } + TAILQ_INSERT_TAIL( &s_DeviceList, internal_dev, lentry); + ret = internal_dev; OS_LeaveLock( g_eth_list_lock); - if(NULL == ret) - { - if(g_ulTraceLevel & TRACE_LEVEL_ERROR) - { - USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Not enough memory to create cifx virtual ethernet interface!"); - } - } + return ret; } } } @@ -289,6 +280,12 @@ void* cifxeth_create_device(NETX_ETH_DEV_CFG_T* config) { cifxeth_delete_device( internal_dev); } + } else + { + if(g_ulTraceLevel & TRACE_LEVEL_ERROR) + { + USER_Trace( internal_dev->devinst, TRACE_LEVEL_ERROR, "Ethernet-IF Error: Not enough memory to create cifx virtual ethernet interface!"); + } } channel_no++; } From 86ff0cb4f8e368d46d00bd25df2c94b8aa31ddc9 Mon Sep 17 00:00:00 2001 From: Sebastian Doell Date: Thu, 28 Mar 2024 11:26:23 +0100 Subject: [PATCH 4/4] [#####] - Add static library builds to gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c536699..500ba0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.a *.o *.cmd* *.ko*