svn commit: r336363 - head/sys/ofed/drivers/infiniband/core

Hans Petter Selasky hselasky at FreeBSD.org
Tue Jul 17 08:34:50 UTC 2018


Author: hselasky
Date: Tue Jul 17 08:34:49 2018
New Revision: 336363
URL: https://svnweb.freebsd.org/changeset/base/336363

Log:
  Process address resolve requests at least one time per second in ibcore.
  
  When setting a large address resolve timeout it was observed that the
  address resolving would succeed at the timeout and not when the address
  was available. Make sure the address resolving requests are processed no
  slower than one time every second.
  
  While at it use "int" for jiffies instead of "unsigned long" to match
  FreeBSD ticks.
  
  MFC after:		1 week
  Sponsored by:		Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_addr.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/ib_addr.c	Tue Jul 17 07:42:14 2018	(r336362)
+++ head/sys/ofed/drivers/infiniband/core/ib_addr.c	Tue Jul 17 08:34:49 2018	(r336363)
@@ -63,7 +63,7 @@ struct addr_req {
 	void *context;
 	void (*callback)(int status, struct sockaddr *src_addr,
 			 struct rdma_dev_addr *addr, void *context);
-	unsigned long timeout;
+	int timeout;
 	int status;
 };
 
@@ -190,13 +190,15 @@ int rdma_translate_ip(const struct sockaddr *addr,
 }
 EXPORT_SYMBOL(rdma_translate_ip);
 
-static void set_timeout(unsigned long time)
+static void set_timeout(int time)
 {
 	int delay;	/* under FreeBSD ticks are 32-bit */
 
 	delay = time - jiffies;
 	if (delay <= 0)
 		delay = 1;
+	else if (delay > hz)
+		delay = hz;
 
 	mod_delayed_work(addr_wq, &work, delay);
 }


More information about the svn-src-head mailing list