linux version needs to be defined

reviewable/pr15941/r7
Yash Tibrewal 7 years ago
parent 82b1a08e15
commit b49f47d4f2
  1. 10
      src/core/lib/iomgr/internal_errqueue.h
  2. 1
      src/core/lib/iomgr/port.h
  3. 3
      src/core/lib/iomgr/tcp_posix.cc
  4. 6
      test/core/iomgr/buffer_list_test.cc

@ -41,6 +41,16 @@
#endif /* GRPC_LINUX_ERRQUEUE */
namespace grpc_core {
#ifdef GRPC_LINUX_ERRQUEUE
constexpr uint32_t kTimestampingSocketOptions = SOF_TIMESTAMPING_SOFTWARE |
SOF_TIMESTAMPING_OPT_ID |
SOF_TIMESTAMPING_OPT_TSONLY;
constexpr uint32_t kTimestampingRecordingOptions =
SOF_TIMESTAMPING_TX_SCHED | SOF_TIMESTAMPING_TX_SOFTWARE |
SOF_TIMESTAMPING_TX_ACK;
#endif /* GRPC_LINUX_ERRQUEUE */
/* Returns true if kernel is capable of supporting errqueue and timestamping.
* Currently allowing only linux kernels above 4.0.0
*/

@ -60,6 +60,7 @@
#define GRPC_HAVE_IP_PKTINFO 1
#define GRPC_HAVE_MSG_NOSIGNAL 1
#define GRPC_HAVE_UNIX_SOCKET 1
#include <linux/version.h>
#ifdef LINUX_VERSION_CODE
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
#define GRPC_LINUX_ERRQUEUE 1

@ -633,8 +633,7 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg,
return cmsg;
}
auto tss =
reinterpret_cast<struct grpc_core::scm_timestamping*>(CMSG_DATA(cmsg));
auto tss = reinterpret_cast<struct scm_timestamping*>(CMSG_DATA(cmsg));
auto serr = reinterpret_cast<struct sock_extended_err*>(CMSG_DATA(next_cmsg));
if (serr->ee_errno != ENOMSG ||
serr->ee_origin != SO_EE_ORIGIN_TIMESTAMPING) {

@ -75,8 +75,8 @@ static void TestVerifierCalledOnAckVerifier(void* arg,
static void TestVerifierCalledOnAck() {
struct sock_extended_err serr;
serr.ee_data = 213;
serr.ee_info = grpc_core::SCM_TSTAMP_ACK;
struct grpc_core::scm_timestamping tss;
serr.ee_info = SCM_TSTAMP_ACK;
struct scm_timestamping tss;
tss.ts[0].tv_sec = 123;
tss.ts[0].tv_nsec = 456;
grpc_core::grpc_tcp_set_write_timestamps_callback(
@ -106,6 +106,6 @@ int main(int argc, char** argv) {
#else /* GRPC_LINUX_ERRQUEUE */
int main(int argc, char** argv) { return 1; }
int main(int argc, char** argv) { return 0; }
#endif /* GRPC_LINUX_ERRQUEUE */

Loading…
Cancel
Save