netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]  Break 'budget' dependency on netdev_max_backlog.
@ 2002-10-21  6:46 Ben Greear
  2002-10-21 12:51 ` jamal
  0 siblings, 1 reply; 12+ messages in thread
From: Ben Greear @ 2002-10-21  6:46 UTC (permalink / raw)
  To: 'netdev@oss.sgi.com', Robert Olsson

I want to have a very high netdev_max_backlog, but that makes
NAPI with the tulip driver (and 4 running ports) drop packets,
I assume because by the time it polls the first 3, the 4th has
been neglected too long...

So, this patch makes the budget NAPI variable independently tunable.
The default of 300 seems to work well, and is the current default.

In the future, I'm guessing we want a per-interface budget, because
a high performance GigE NIC will want a higher budget that the
venerable 100bt.


--- linux-2.4.19.p3/include/linux/sysctl.h      Tue Oct 15 14:26:40 2002
+++ linux-2.4.19.p4/include/linux/sysctl.h      Sun Oct 20 23:24:13 2002
@@ -206,7 +206,8 @@
         NET_CORE_NO_CONG=14,
         NET_CORE_LO_CONG=15,
         NET_CORE_MOD_CONG=16,
-       NET_CORE_DEV_WEIGHT=17
+       NET_CORE_DEV_WEIGHT=17,
+       NET_CORE_MAX_POLL=18
  };

  /* /proc/sys/net/ethernet */
--- linux-2.4.19.p3/net/core/dev.c      Tue Oct 15 14:23:39 2002
+++ linux-2.4.19.p4/net/core/dev.c      Sun Oct 20 23:36:02 2002
@@ -1092,6 +1092,7 @@
    =======================================================================*/

  int netdev_max_backlog = 300;
+int netdev_max_poll = 300; /* 'Budget' for the NAPI poll method */
  int weight_p = 64;            /* old backlog weight */
  /* These numbers are selected based on intuition and some
   * experimentatiom, if you have more scientific way of doing this
@@ -1604,7 +1605,7 @@
         int this_cpu = smp_processor_id();
         struct softnet_data *queue = &softnet_data[this_cpu];
         unsigned long start_time = jiffies;
-       int budget = netdev_max_backlog;
+       int budget = netdev_max_poll;

         br_read_lock(BR_NETPROTO_LOCK);
         local_irq_disable();
--- linux-2.4.19.p3/net/core/sysctl_net_core.c  Wed Oct  9 00:24:02 2002
+++ linux-2.4.19.p4/net/core/sysctl_net_core.c  Sun Oct 20 23:35:23 2002
@@ -12,6 +12,7 @@
  #ifdef CONFIG_SYSCTL

  extern int netdev_max_backlog;
+extern int netdev_max_poll;
  extern int weight_p;
  extern int no_cong_thresh;
  extern int no_cong;
@@ -54,6 +55,9 @@
         {NET_CORE_MAX_BACKLOG, "netdev_max_backlog",
          &netdev_max_backlog, sizeof(int), 0644, NULL,
          &proc_dointvec},
+       {NET_CORE_MAX_POLL, "netdev_max_poll",
+        &netdev_max_poll, sizeof(int), 0644, NULL,
+        &proc_dointvec},
         {NET_CORE_NO_CONG_THRESH, "no_cong_thresh",
          &no_cong, sizeof(int), 0644, NULL,
          &proc_dointvec},


-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-10-23  4:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-21  6:46 [PATCH] Break 'budget' dependency on netdev_max_backlog Ben Greear
2002-10-21 12:51 ` jamal
2002-10-21 16:25   ` Ben Greear
2002-10-23  0:47     ` jamal
2002-10-23  1:06       ` Ben Greear
2002-10-23  1:18         ` jamal
2002-10-23  2:37           ` Ben Greear
2002-10-23  3:21             ` jamal
2002-10-23  3:43               ` Ben Greear
2002-10-23  3:44                 ` jamal
2002-10-23  4:00                   ` Ben Greear
2002-10-23  3:58                     ` jamal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).