Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1556,14 +1556,9 @@ AC_ARG_WITH([event-interface],

use_epoll=0
use_kqueue=0
use_port=0

AS_IF([test "x$event_interface" = "xauto"], [
if test "$ac_cv_func_port_create" = "yes"; then
use_port=1
have_good_poller=1
AC_MSG_NOTICE([Using port event interface])
elif test "$ac_cv_func_epoll_ctl" = "yes"; then
if test "$ac_cv_func_epoll_ctl" = "yes"; then
use_epoll=1
have_good_poller=1
AC_MSG_NOTICE([Using epoll event interface])
Expand All @@ -1580,10 +1575,6 @@ AS_IF([test "x$event_interface" = "xauto"], [
use_epoll=1
AC_MSG_RESULT([forced to epoll])
;;
xport)
use_port=1
AC_MSG_RESULT([forced to port])
;;
xkqueue)
use_kqueue=1
AC_MSG_RESULT([forced to kqueue])
Expand All @@ -1596,8 +1587,6 @@ AS_IF([test "x$event_interface" = "xauto"], [

AC_SUBST(use_epoll)
AC_SUBST(use_kqueue)
AC_SUBST(use_port)


# Profiler support
has_profiler=0
Expand Down
1 change: 0 additions & 1 deletion doc/developer-guide/testing/blackbox-testing.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ Condition Testing
- TS_USE_DIAGS
- TS_USE_EPOLL
- TS_USE_KQUEUE
- TS_USE_PORT
- TS_USE_POSIX_CAP
- TS_USE_TPROXY
- TS_HAS_SO_MARK
Expand Down
1 change: 0 additions & 1 deletion include/tscore/ink_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
#define TS_USE_DIAGS @use_diags@
#define TS_USE_EPOLL @use_epoll@
#define TS_USE_KQUEUE @use_kqueue@
#define TS_USE_PORT @use_port@
#define TS_USE_POSIX_CAP @use_posix_cap@
#define TS_USE_TPROXY @use_tproxy@
#define TS_HAS_SO_MARK @has_so_mark@
Expand Down
3 changes: 0 additions & 3 deletions include/tscore/ink_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ struct ifafilt;
#if TS_USE_KQUEUE
#include <sys/event.h>
#endif
#if TS_USE_PORT
#include <port.h>
#endif

#ifdef HAVE_VALUES_H
#include <values.h>
Expand Down
2 changes: 0 additions & 2 deletions iocore/eventsystem/UnixEThread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ EThread::EThread(ThreadType att, int anid) : id(anid), tt(att)
Fatal("EThread::EThread: %d=eventfd(0,EFD_NONBLOCK | EFD_CLOEXEC),errno(%d)", evfd, errno);
}
}
#elif TS_USE_PORT
/* We'll just port_send the event straight over the port. */
#else
ink_release_assert(pipe(evpipe) >= 0);
fcntl(evpipe[0], F_SETFD, FD_CLOEXEC);
Expand Down
72 changes: 1 addition & 71 deletions iocore/net/P_UnixNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
#define EVENTIO_WRITE INK_EVP_OUT
#define EVENTIO_ERROR (0x010 | 0x002 | 0x020) // ERR PRI HUP
#endif
#if TS_USE_PORT
#ifdef USE_EDGE_TRIGGER_PORT
#define USE_EDGE_TRIGGER 1
#endif
#define EVENTIO_READ POLLIN
#define EVENTIO_WRITE POLLOUT
#define EVENTIO_ERROR (POLLERR | POLLPRI | POLLHUP)
#endif

struct PollDescriptor;
typedef PollDescriptor *EventLoop;
Expand All @@ -85,7 +77,7 @@ struct NetAccept;
/// Unified API for setting and clearing kernel and epoll events.
struct EventIO {
int fd = -1; ///< file descriptor, often a system port
#if TS_USE_KQUEUE || TS_USE_EPOLL && !defined(USE_EDGE_TRIGGER) || TS_USE_PORT
#if TS_USE_KQUEUE || TS_USE_EPOLL && !defined(USE_EDGE_TRIGGER)
int events = 0; ///< a bit mask of enabled events
#endif
EventLoop event_loop = nullptr; ///< the assigned event loop
Expand Down Expand Up @@ -677,13 +669,6 @@ EventIO::start_common(EventLoop l, int afd, int e)
EV_SET(&ev[n++], fd, EVFILT_WRITE, EV_ADD | INK_EV_EDGE_TRIGGER, 0, 0, this);
return kevent(l->kqueue_fd, &ev[0], n, nullptr, 0, nullptr);
#endif
#if TS_USE_PORT
events = e;
int retval = port_associate(event_loop->port_fd, PORT_SOURCE_FD, fd, events, this);
Debug("iocore_eventio", "[EventIO::start] e(%d), events(%d), %d[%s]=port_associate(%d,%d,%d,%d,%p)", e, events, retval,
retval < 0 ? strerror(errno) : "ok", event_loop->port_fd, PORT_SOURCE_FD, fd, events, this);
return retval;
#endif
}

TS_INLINE int
Expand Down Expand Up @@ -735,38 +720,8 @@ EventIO::modify(int e)
else
return 0;
#endif
#if TS_USE_PORT
int n = 0;
int ne = e;
if (e < 0) {
if (((-e) & events)) {
ne = ~(-e) & events;
if ((-e) & EVENTIO_READ)
n++;
if ((-e) & EVENTIO_WRITE)
n++;
}
} else {
if (!(e & events)) {
ne = events | e;
if (e & EVENTIO_READ)
n++;
if (e & EVENTIO_WRITE)
n++;
}
}
if (n && ne && event_loop) {
events = ne;
int retval = port_associate(event_loop->port_fd, PORT_SOURCE_FD, fd, events, this);
Debug("iocore_eventio", "[EventIO::modify] e(%d), ne(%d), events(%d), %d[%s]=port_associate(%d,%d,%d,%d,%p)", e, ne, events,
retval, retval < 0 ? strerror(errno) : "ok", event_loop->port_fd, PORT_SOURCE_FD, fd, events, this);
return retval;
}
return 0;
#else
(void)e; // ATS_UNUSED
return 0;
#endif
}

TS_INLINE int
Expand All @@ -790,28 +745,8 @@ EventIO::refresh(int e)
else
return 0;
#endif
#if TS_USE_PORT
int n = 0;
int ne = e;
if ((e & events)) {
ne = events | e;
if (e & EVENTIO_READ)
n++;
if (e & EVENTIO_WRITE)
n++;
if (n && ne && event_loop) {
events = ne;
int retval = port_associate(event_loop->port_fd, PORT_SOURCE_FD, fd, events, this);
Debug("iocore_eventio", "[EventIO::refresh] e(%d), ne(%d), events(%d), %d[%s]=port_associate(%d,%d,%d,%d,%p)", e, ne, events,
retval, retval < 0 ? strerror(errno) : "ok", event_loop->port_fd, PORT_SOURCE_FD, fd, events, this);
return retval;
}
}
return 0;
#else
(void)e; // ATS_UNUSED
return 0;
#endif
}

TS_INLINE int
Expand All @@ -827,11 +762,6 @@ EventIO::stop()
memset(&ev, 0, sizeof(struct epoll_event));
ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
retval = epoll_ctl(event_loop->epoll_fd, EPOLL_CTL_DEL, fd, &ev);
#endif
#if TS_USE_PORT
retval = port_dissociate(event_loop->port_fd, PORT_SOURCE_FD, fd);
Debug("iocore_eventio", "[EventIO::stop] %d[%s]=port_dissociate(%d,%d,%d)", retval, retval < 0 ? strerror(errno) : "ok",
event_loop->port_fd, PORT_SOURCE_FD, fd);
#endif
event_loop = nullptr;
return retval;
Expand Down
16 changes: 0 additions & 16 deletions iocore/net/P_UnixPollDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ struct PollDescriptor {
#if TS_USE_KQUEUE
int kqueue_fd;
#endif
#if TS_USE_PORT
int port_fd;
#endif

PollDescriptor() { init(); }
#if TS_USE_EPOLL
Expand Down Expand Up @@ -91,15 +88,6 @@ struct PollDescriptor {
return r;
}
#define ev_next_event(a, x)
#endif

#if TS_USE_PORT
port_event_t Port_Triggered_Events[POLL_DESCRIPTOR_SIZE];
#define get_ev_port(a) ((a)->port_fd)
#define get_ev_events(a, x) ((a)->Port_Triggered_Events[(x)].portev_events)
#define get_ev_data(a, x) ((a)->Port_Triggered_Events[(x)].portev_user)
#define get_ev_odata(a, x) ((a)->Port_Triggered_Events[(x)].portev_object)
#define ev_next_event(a, x)
#endif

Pollfd *
Expand Down Expand Up @@ -130,10 +118,6 @@ struct PollDescriptor {
#if TS_USE_KQUEUE
kqueue_fd = kqueue();
memset(kq_Triggered_Events, 0, sizeof(kq_Triggered_Events));
#endif
#if TS_USE_PORT
port_fd = port_create();
memset(Port_Triggered_Events, 0, sizeof(Port_Triggered_Events));
#endif
}
};
7 changes: 0 additions & 7 deletions iocore/net/SSLNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -728,13 +728,6 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread)
read.triggered = 0;
nh->read_ready_list.remove(this);
Debug("ssl", "read finished - would block");
#if TS_USE_PORT
if (ret == SSL_READ_WOULD_BLOCK) {
readReschedule(nh);
} else {
writeReschedule(nh);
}
#endif
break;

case SSL_READ_EOS:
Expand Down
34 changes: 0 additions & 34 deletions iocore/net/UnixNet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,35 +197,6 @@ PollCont::do_poll(ink_hrtime timeout)
kevent(pollDescriptor->kqueue_fd, nullptr, 0, pollDescriptor->kq_Triggered_Events, POLL_DESCRIPTOR_SIZE, &tv);
NetDebug("v_iocore_net_poll", "[PollCont::pollEvent] kqueue_fd: %d, timeout: %d, results: %d", pollDescriptor->kqueue_fd,
poll_timeout, pollDescriptor->result);
#elif TS_USE_PORT
int retval;
timespec_t ptimeout;
ptimeout.tv_sec = poll_timeout / 1000;
ptimeout.tv_nsec = 1000000 * (poll_timeout % 1000);
unsigned nget = 1;
if ((retval = port_getn(pollDescriptor->port_fd, pollDescriptor->Port_Triggered_Events, POLL_DESCRIPTOR_SIZE, &nget, &ptimeout)) <
0) {
pollDescriptor->result = 0;
switch (errno) {
case EINTR:
case EAGAIN:
case ETIME:
if (nget > 0) {
pollDescriptor->result = (int)nget;
}
break;
default:
ink_assert(!"unhandled port_getn() case:");
break;
}
} else {
pollDescriptor->result = (int)nget;
}
NetDebug("v_iocore_net_poll", "[PollCont::pollEvent] %d[%s]=port_getn(%d,%p,%d,%d,%d),results(%d)", retval,
retval < 0 ? strerror(errno) : "ok", pollDescriptor->port_fd, pollDescriptor->Port_Triggered_Events,
POLL_DESCRIPTOR_SIZE, nget, poll_timeout, pollDescriptor->result);
#else
#error port me
#endif
}

Expand All @@ -235,8 +206,6 @@ net_signal_hook_callback(EThread *thread)
#if HAVE_EVENTFD
uint64_t counter;
ATS_UNUSED_RETURN(read(thread->evfd, &counter, sizeof(uint64_t)));
#elif TS_USE_PORT
/* Nothing to drain or do */
#else
char dummy[1024];
ATS_UNUSED_RETURN(read(thread->evpipe[0], &dummy[0], 1024));
Expand Down Expand Up @@ -579,9 +548,6 @@ NetHandler::signalActivity()
#if HAVE_EVENTFD
uint64_t counter = 1;
ATS_UNUSED_RETURN(write(thread->evfd, &counter, sizeof(uint64_t)));
#elif TS_USE_PORT
PollDescriptor *pd = get_PollDescriptor(thread);
ATS_UNUSED_RETURN(port_send(pd->port_fd, 0, thread->ep));
#else
char dummy = 1;
ATS_UNUSED_RETURN(write(thread->evpipe[1], &dummy, 1));
Expand Down
5 changes: 0 additions & 5 deletions iocore/net/UnixUDPNet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1462,8 +1462,6 @@ net_signal_hook_callback(EThread *thread)
#if HAVE_EVENTFD
uint64_t counter;
ATS_UNUSED_RETURN(read(thread->evfd, &counter, sizeof(uint64_t)));
#elif TS_USE_PORT
/* Nothing to drain or do */
#else
char dummy[1024];
ATS_UNUSED_RETURN(read(thread->evpipe[0], &dummy[0], 1024));
Expand Down Expand Up @@ -1601,9 +1599,6 @@ UDPNetHandler::signalActivity()
#if HAVE_EVENTFD
uint64_t counter = 1;
ATS_UNUSED_RETURN(write(thread->evfd, &counter, sizeof(uint64_t)));
#elif TS_USE_PORT
PollDescriptor *pd = get_PollDescriptor(thread);
ATS_UNUSED_RETURN(port_send(pd->port_fd, 0, thread->ep));
#else
char dummy = 1;
ATS_UNUSED_RETURN(write(thread->evpipe[1], &dummy, 1));
Expand Down
1 change: 0 additions & 1 deletion src/traffic_layout/info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ produce_features(bool json)
print_feature("TS_USE_DIAGS", TS_USE_DIAGS, json);
print_feature("TS_USE_EPOLL", TS_USE_EPOLL, json);
print_feature("TS_USE_KQUEUE", TS_USE_KQUEUE, json);
print_feature("TS_USE_PORT", TS_USE_PORT, json);
print_feature("TS_USE_POSIX_CAP", TS_USE_POSIX_CAP, json);
print_feature("TS_USE_TPROXY", TS_USE_TPROXY, json);
print_feature("TS_HAS_SO_MARK", TS_HAS_SO_MARK, json);
Expand Down
1 change: 0 additions & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ ts.Disk.remap_config.AddLine(
* TS_USE_DIAGS
* TS_USE_EPOLL
* TS_USE_KQUEUE
* TS_USE_PORT
* TS_USE_POSIX_CAP
* TS_USE_TPROXY
* TS_HAS_SO_MARK
Expand Down