All of lore.kernel.org
 help / color / mirror / Atom feed
From: dvr <jinxiu.1006-9Onoh4P/yGk@public.gmane.org>
To: dev-VfR2kkLFssw@public.gmane.org
Subject: Get the socket id
Date: Wed, 7 Aug 2013 14:14:19 +0800 (CST)	[thread overview]
Message-ID: <77584a69.d001.1405769661d.Coremail.jinxiu.1006@163.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

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
  

[-- Attachment #2: Type: text/html, Size: 1560 bytes --]

             reply	other threads:[~2013-08-07  6:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07  6:14 dvr [this message]
     [not found] ` <77584a69.d001.1405769661d.Coremail.jinxiu.1006-9Onoh4P/yGk@public.gmane.org>
2013-08-07 15:52   ` Get the socket id Stephen Hemminger
     [not found]     ` <20130807085241.684ed79a-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
2013-08-07 15:56       ` Damien Millescamps
     [not found]         ` <52026E47.6090402-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2013-08-07 16:11           ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77584a69.d001.1405769661d.Coremail.jinxiu.1006@163.com \
    --to=jinxiu.1006-9onoh4p/ygk@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.