Skip to content

Commit a1aa7cd

Browse files
committed
Deprecate apcon/vss timestamps
1 parent b39fe79 commit a1aa7cd

File tree

4 files changed

+3
-66
lines changed

4 files changed

+3
-66
lines changed

userland/lib/pfring.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ pfring *pfring_open(const char *device_name, u_int32_t caplen, u_int32_t flags)
195195
ring->disable_timestamp = !!(flags & PF_RING_DO_NOT_TIMESTAMP);
196196
ring->chunk_mode_enabled = !!(flags & PF_RING_CHUNK_MODE);
197197
ring->ixia_timestamp_enabled = !!(flags & PF_RING_IXIA_TIMESTAMP);
198-
ring->vss_apcon_timestamp_enabled = !!(flags & PF_RING_VSS_APCON_TIMESTAMP);
199198
ring->force_userspace_bpf = !!(flags & (PF_RING_USERSPACE_BPF|PF_RING_TX_BPF));
200199
ring->ft_enabled = !!(flags & PF_RING_L7_FILTERING);
201200

@@ -505,13 +504,10 @@ int pfring_loop(pfring *ring, pfringProcesssPacket looper,
505504

506505
if (ring->flags & (
507506
PF_RING_IXIA_TIMESTAMP |
508-
PF_RING_VSS_APCON_TIMESTAMP |
509507
PF_RING_METAWATCH_TIMESTAMP |
510508
PF_RING_ARISTA_TIMESTAMP)) {
511509
if(ring->ixia_timestamp_enabled)
512510
pfring_handle_ixia_hw_timestamp(buffer, &hdr);
513-
else if(ring->vss_apcon_timestamp_enabled)
514-
pfring_handle_vss_apcon_hw_timestamp(buffer, &hdr);
515511
else if(ring->flags & PF_RING_METAWATCH_TIMESTAMP)
516512
pfring_handle_metawatch_hw_timestamp(buffer, &hdr);
517513
else if(ring->flags & PF_RING_ARISTA_TIMESTAMP) {
@@ -585,13 +581,10 @@ int pfring_recv(pfring *ring, u_char** buffer, u_int buffer_len,
585581

586582
if (unlikely(rc > 0 && ring->flags & (
587583
PF_RING_IXIA_TIMESTAMP |
588-
PF_RING_VSS_APCON_TIMESTAMP |
589584
PF_RING_METAWATCH_TIMESTAMP |
590585
PF_RING_ARISTA_TIMESTAMP))) {
591586
if(ring->ixia_timestamp_enabled)
592587
pfring_handle_ixia_hw_timestamp(*buffer, hdr);
593-
else if(ring->vss_apcon_timestamp_enabled)
594-
pfring_handle_vss_apcon_hw_timestamp(*buffer, hdr);
595588
else if(ring->flags & PF_RING_METAWATCH_TIMESTAMP)
596589
pfring_handle_metawatch_hw_timestamp(*buffer, hdr);
597590
else if(ring->flags & PF_RING_ARISTA_TIMESTAMP) {

userland/lib/pfring.h

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ struct __pfring {
202202
u_int8_t disable_timestamp;
203203
u_int8_t ixia_timestamp_enabled;
204204

205-
u_int8_t vss_apcon_timestamp_enabled;
205+
u_int8_t __padding_0;
206206
u_int8_t chunk_mode_enabled;
207207
u_int8_t userspace_bpf;
208208
u_int8_t force_userspace_bpf;
@@ -351,7 +351,7 @@ struct __pfring {
351351

352352
u_int8_t reentrant;
353353
u_int8_t break_recv_loop;
354-
u_int16_t __padding;
354+
u_int16_t __padding_1;
355355
u_int32_t num_poll_calls;
356356

357357
pfring_rwlock_t rx_lock;
@@ -387,7 +387,7 @@ struct __pfring {
387387
#define PF_RING_IXIA_TIMESTAMP (1 << 12) /**< pfring_open() flag: Enable ixiacom.com hardware timestamp support+stripping. */
388388
#define PF_RING_USERSPACE_BPF (1 << 13) /**< pfring_open() flag: Force userspace bpf even with standard drivers (not only with ZC). */
389389
#define PF_RING_ZC_NOT_REPROGRAM_RSS (1 << 14) /**< pfring_open() flag: Do not touch/reprogram hw RSS */
390-
#define PF_RING_VSS_APCON_TIMESTAMP (1 << 15) /**< pfring_open() flag: Enable apcon.com/vssmonitoring.com hardware timestamp support+stripping. */
390+
#define PF_RING_VSS_APCON_TIMESTAMP (1 << 15) /**< pfring_open() flag: Deprecated */
391391
#define PF_RING_ZC_IPONLY_RSS (1 << 16) /**< pfring_open() flag: Compute RSS on src/dst IP only (not 4-tuple) */
392392
#define PF_RING_FLOW_OFFLOAD (1 << 17) /**< pfring_open() flag: Enable Flow offload (Flow Manager on Napatech) */
393393
#define PF_RING_FLOW_OFFLOAD_NOUPDATES (1 << 18) /**< pfring_open() flag: Disable periodic updates when PF_RING_FLOW_OFFLOAD is used */
@@ -1343,24 +1343,6 @@ int pfring_read_arista_7150_hw_timestamp(u_char *buffer, u_int32_t buffer_len, u
13431343
*/
13441344
int pfring_handle_arista_hw_timestamp(u_char* buffer, struct pfring_pkthdr *hdr);
13451345

1346-
/**
1347-
* Reads a VSS/APCON-formatted timestamp from an incoming packet and puts it into the timestamp variable.
1348-
* @param buffer Incoming packet buffer.
1349-
* @param buffer_len Incoming packet buffer length.
1350-
* @param ts If found the hardware timestamp will be placed here
1351-
* @return The length of the VSS/APCON timestamp
1352-
*/
1353-
int pfring_read_vss_apcon_hw_timestamp(u_char *buffer, u_int32_t buffer_len, struct timespec *ts);
1354-
1355-
/**
1356-
* Strip an VSS/APCON-formatted timestamp from an incoming packet. If the timestamp is found, the
1357-
* hdr parameter (caplen and len fields) are decreased by the size of the timestamp.
1358-
* @param buffer Incoming packet buffer.
1359-
* @param hdr This is an in/out parameter: it is used to read the original packet len, and it is updated (size decreased) if the hw timestamp is found
1360-
* @return 0 on success, a negative value otherwise.
1361-
*/
1362-
void pfring_handle_vss_apcon_hw_timestamp(u_char* buffer, struct pfring_pkthdr *hdr);
1363-
13641346
/**
13651347
* Get interface speed.
13661348
* @param ring

userland/lib/pfring_hw_timestamp.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -281,32 +281,3 @@ int pfring_handle_arista_hw_timestamp(u_char* buffer, struct pfring_pkthdr *hdr)
281281

282282
/* ********************************* */
283283

284-
int pfring_read_vss_apcon_hw_timestamp(u_char *buffer, u_int32_t buffer_len, struct timespec *ts) {
285-
struct vss_apcon_hw_ts* vss_apcon = (struct vss_apcon_hw_ts *)&buffer[buffer_len - VSS_APCON_TS_LEN];
286-
287-
if(unlikely(thiszone == 0)) thiszone = gmt_to_local(0);
288-
ts->tv_sec = ntohl(vss_apcon->sec) - thiszone;
289-
ts->tv_nsec = ntohl(vss_apcon->nsec);
290-
return VSS_APCON_TS_LEN;
291-
}
292-
293-
/* ********************************* */
294-
295-
void pfring_handle_vss_apcon_hw_timestamp(u_char* buffer, struct pfring_pkthdr *hdr) {
296-
struct timespec ts;
297-
int ts_size;
298-
299-
if(unlikely(hdr->caplen != hdr->len))
300-
return; /* full packet only */
301-
302-
ts_size = pfring_read_vss_apcon_hw_timestamp(buffer, hdr->len, &ts);
303-
304-
if(likely(ts_size > 0)) {
305-
hdr->caplen = hdr->len = hdr->len - ts_size;
306-
hdr->ts.tv_sec = ts.tv_sec, hdr->ts.tv_usec = ts.tv_nsec/1000;
307-
hdr->extended_hdr.timestamp_ns = (((u_int64_t) ts.tv_sec) * 1000000000) + ts.tv_nsec;
308-
}
309-
}
310-
311-
/* ********************************* */
312-

userland/lib/pfring_hw_timestamp.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,3 @@ struct arista_7280_pkt_hw_ts {
7777

7878
/* *********************************************** */
7979

80-
#define VSS_APCON_TS_LEN sizeof(struct vss_apcon_hw_ts)
81-
82-
struct vss_apcon_hw_ts {
83-
u_int32_t sec;
84-
u_int32_t nsec;
85-
u_int32_t crc;
86-
} __attribute__((__packed__));
87-
88-
/* *********************************************** */

0 commit comments

Comments
 (0)