Performance optimization for embedded devices

Rulfs, Andreas andreas.rulfs at siemens.com
Wed Feb 22 19:18:04 GMT 2006


We made same modification for performance optimization for embedded
devices.
 
Here the diff:
 
Regards,
 
Wavebox
 
More information :
http://now-portal.c-lab.de/project/showfiles.php?group_id=13
<http://now-portal.c-lab.de/project/showfiles.php?group_id=13&release_id
=107> &release_id=107 under M740AV
 
 }
 
 
/***********************************************************************
*****
@@ -285,8 +361,15 @@
  int mpx = MAX(cli->max_mux-1, 1);
  int block = (cli->max_xmit - (smb_size+32)) & ~1023;
  int blocks = (size + (block-1)) / block;
+ static int first  = 1;
+ if(first) {
+  fprintf(stderr,"max_mux=%d max_xmit=%d\n",cli->max_mux,
+    cli->max_xmit);
+  first = 0;
+ }
 
  while (received < blocks) {
+  if(issued<blocks) {
 
   while ((issued - received < mpx) && (issued < blocks)) {
    int bsent = issued * block;
@@ -299,7 +382,7 @@
     return -1;
    issued++;
   }
-
+  }
   if (!cli_receive_smb(cli))
    return bwritten;
 
diff -urN samba-2.2.7/source/libsmb/libsmbclient.c
samba-2.2.7wavebox/source/libsmb/libsmbclient.c
--- samba-2.2.7/source/libsmb/libsmbclient.c 2002-08-28
16:33:10.000000000 +0200
+++ samba-2.2.7wavebox/source/libsmb/libsmbclient.c 2004-08-25
09:48:24.000000000 +0200
@@ -64,7 +64,7 @@
 
 extern BOOL in_client;
 extern pstring global_myname;
-static int smbc_initialized = 0;
+int smbc_initialized = 0;
 static smbc_get_auth_data_fn smbc_auth_fn = NULL;
 /*static int smbc_debug;*/
 static int smbc_start_fd;
diff -urN samba-2.2.7/source/libsmb/namequery.c
samba-2.2.7wavebox/source/libsmb/namequery.c
--- samba-2.2.7/source/libsmb/namequery.c 2002-11-19 19:44:20.000000000
+0100
+++ samba-2.2.7wavebox/source/libsmb/namequery.c 2005-01-17
12:24:09.000000000 +0100
@@ -824,6 +824,7 @@
  return False;
 }
 
+
 /********************************************************
  Internal interface to resolve a name into an IP address.
  Use this function if the string is either an IP address, DNS
@@ -963,6 +964,22 @@
   return result;
 }
 
+static struct interface *iface_find2(struct in_addr ip, BOOL CheckMask)
+{
+ struct interface *i;
+ int count = iface_count();
+ int j;
+ if (is_zero_ip(ip))
+  return NULL;
+ for (j=0;j<count;j++) {
+  i = get_interface(j);
+  if (CheckMask) {
+   if (same_net(i->ip,ip,i->nmask)) return i;
+  } else if ((i->ip).s_addr == ip.s_addr) return i;
+ }
+ return NULL;
+}
+
 /********************************************************
  Internal interface to resolve a name into one IP address.
  Use this function if the string is either an IP address, DNS
@@ -985,7 +1002,7 @@
   /* only return valid addresses for TCP connections */
   for (i=0; i<count; i++) {
    char *ip_str = inet_ntoa(ip_list[i]);
-   if (ip_str &&
+   if (ip_str && iface_find2(ip_list[i],True) &&
     strcmp(ip_str, "255.255.255.255") != 0 &&
     strcmp(ip_str, "0.0.0.0") != 0) {
     *return_ip = ip_list[i];

 
 


More information about the samba-technical mailing list