transport: Introduce transmit time stamp deferral.
Up until now, the code has always fetched the time stamp immediately after transmitting a message. However, a transparent clock will want to forward a given incoming message out all egress ports with as little delay as possible, in order to minimize the residence time of the message within the switch. This patch adds a new transmit mode for event messages that will be used to signal the new behavior. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
a1c5e3f2ed
commit
e160bad721
14
raw.c
14
raw.c
|
@ -296,9 +296,21 @@ static int raw_send(struct transport *t, struct fdarray *fda,
|
|||
{
|
||||
struct raw *raw = container_of(t, struct raw, t);
|
||||
ssize_t cnt;
|
||||
int fd = event ? fda->fd[FD_EVENT] : fda->fd[FD_GENERAL];
|
||||
unsigned char pkt[1600], *ptr = buf;
|
||||
struct eth_hdr *hdr;
|
||||
int fd = -1;
|
||||
|
||||
switch (event) {
|
||||
case TRANS_GENERAL:
|
||||
fd = fda->fd[FD_GENERAL];
|
||||
break;
|
||||
case TRANS_EVENT:
|
||||
case TRANS_ONESTEP:
|
||||
case TRANS_P2P1STEP:
|
||||
case TRANS_DEFER_EVENT:
|
||||
fd = fda->fd[FD_EVENT];
|
||||
break;
|
||||
}
|
||||
|
||||
ptr -= sizeof(*hdr);
|
||||
len += sizeof(*hdr);
|
||||
|
|
|
@ -50,6 +50,7 @@ enum transport_event {
|
|||
TRANS_EVENT,
|
||||
TRANS_ONESTEP,
|
||||
TRANS_P2P1STEP,
|
||||
TRANS_DEFER_EVENT,
|
||||
};
|
||||
|
||||
struct transport;
|
||||
|
|
16
udp.c
16
udp.c
|
@ -219,10 +219,22 @@ static int udp_send(struct transport *t, struct fdarray *fda,
|
|||
enum transport_event event, int peer, void *buf, int len,
|
||||
struct address *addr, struct hw_timestamp *hwts)
|
||||
{
|
||||
ssize_t cnt;
|
||||
int fd = event ? fda->fd[FD_EVENT] : fda->fd[FD_GENERAL];
|
||||
struct address addr_buf;
|
||||
unsigned char junk[1600];
|
||||
ssize_t cnt;
|
||||
int fd = -1;
|
||||
|
||||
switch (event) {
|
||||
case TRANS_GENERAL:
|
||||
fd = fda->fd[FD_GENERAL];
|
||||
break;
|
||||
case TRANS_EVENT:
|
||||
case TRANS_ONESTEP:
|
||||
case TRANS_P2P1STEP:
|
||||
case TRANS_DEFER_EVENT:
|
||||
fd = fda->fd[FD_EVENT];
|
||||
break;
|
||||
}
|
||||
|
||||
if (!addr) {
|
||||
memset(&addr_buf, 0, sizeof(addr_buf));
|
||||
|
|
16
udp6.c
16
udp6.c
|
@ -230,10 +230,22 @@ static int udp6_send(struct transport *t, struct fdarray *fda,
|
|||
struct address *addr, struct hw_timestamp *hwts)
|
||||
{
|
||||
struct udp6 *udp6 = container_of(t, struct udp6, t);
|
||||
ssize_t cnt;
|
||||
int fd = event ? fda->fd[FD_EVENT] : fda->fd[FD_GENERAL];
|
||||
struct address addr_buf;
|
||||
unsigned char junk[1600];
|
||||
ssize_t cnt;
|
||||
int fd = -1;
|
||||
|
||||
switch (event) {
|
||||
case TRANS_GENERAL:
|
||||
fd = fda->fd[FD_GENERAL];
|
||||
break;
|
||||
case TRANS_EVENT:
|
||||
case TRANS_ONESTEP:
|
||||
case TRANS_P2P1STEP:
|
||||
case TRANS_DEFER_EVENT:
|
||||
fd = fda->fd[FD_EVENT];
|
||||
break;
|
||||
}
|
||||
|
||||
if (!addr) {
|
||||
memset(&addr_buf, 0, sizeof(addr_buf));
|
||||
|
|
Loading…
Reference in New Issue