From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m13-91.163.com (m13-91.163.com [220.181.13.91]) by dpdk.org (Postfix) with ESMTP id 609251F3 for ; Wed, 7 Aug 2013 08:13:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Received:Date:From:To:Subject:Content-Type: MIME-Version:Message-ID; bh=a0nBvuvi4u2b6qsX7xAFUP6tTDKC7+oXETNa FOPKaL8=; b=AZLdzw8wdUdKiGTeowxzl46DGuxWhTfP+Yv8uYcUaKPZNV5zJgjl CXLUxZ5Gj1DUyRXTfHd85AGeOi4UktWcmVHWMwXZA8hcnPE5bJMsVFVilAFhbz77 PeVyGGYxjLcd+NzZE28XUg0dHlCtMBa3Ovr0iJyh9YWZcODzVR+7kMU= Received: from jinxiu.1006$163.com ( [211.162.75.108] ) by ajax-webmail-wmsvr91 (Coremail) ; Wed, 7 Aug 2013 14:14:19 +0800 (CST) X-Originating-IP: [211.162.75.108] Date: Wed, 7 Aug 2013 14:14:19 +0800 (CST) From: dvr To: dev@dpdk.org X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 20130709(22708.5479.5480) Copyright (c) 2002-2013 www.mailtech.cn 163com X-CM-CTRLDATA: S1dGtWZvb3Rlcl9odG09MTQ3OTo4MQ== Content-Type: multipart/alternative; boundary="----=_Part_196321_2091359227.1375856059933" MIME-Version: 1.0 Message-ID: <77584a69.d001.1405769661d.Coremail.jinxiu.1006@163.com> X-CM-TRANSID: W8GowEAp1EC95QFSmr3zAA--.2858W X-CM-SenderInfo: xmlq5xbxoriiqw6rljoofrz/xtbBdgly7FEADseEnwAAsi X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== Subject: [dpdk-dev] Get the socket id X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2013 06:13:59 -0000 ------=_Part_196321_2091359227.1375856059933 Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: 7bit hi, all I'm confused with the following code(Eal_memory.c in lib\librte_eal\linuxapp\eal directory, LINE 373): nodestr = strstr(buf," N"); if(nodestr == NULL) {...} nodestr += 2; end = strstr(nodestr,"="); if(end == NULL) {...} // here nodestr = "0=1" end[0] = '\0'; end = NULL; // here nodestr = "0" socket_id = strtoul(nodestr,&end,0); Through "printf", I know that: buf = "00200000 default file=/mnt/dpdk/huge/rtemap_1 huge dirty=1 N0=1" And finally socket_id=0 My question is :why we get the socket_id before "=" instead of after "=" ? and if we want to get the character after "N", isn't this code too complex? I will be very appreciate for any help. Regards! Maria ------=_Part_196321_2091359227.1375856059933 Content-Type: text/html; charset=GBK Content-Transfer-Encoding: 7bit
hi,
   all
   I'm confused with the following code(Eal_memory.c in lib\librte_eal\linuxapp\eal directory, LINE 373):
 
   nodestr = strstr(buf," N");
   if(nodestr == NULL) {...}
   nodestr += 2;
   end = strstr(nodestr,"=");
   if(end == NULL) {...}
   // here nodestr = "0=1"
   end[0] = '\0';
   end = NULL;
  // here nodestr = "0"
   socket_id = strtoul(nodestr,&end,0);
 
   Through "printf", I know that:
   buf = "00200000 default file=/mnt/dpdk/huge/rtemap_1 huge dirty=1 N0=1"
   And finally socket_id=0
   My question is :why we get the socket_id before "=" instead of after "=" ?
   and if we want to get the character after "N", isn't this code too complex?
 
   I will be very appreciate for any help.
   Regards!
 
Maria
  


------=_Part_196321_2091359227.1375856059933--