From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <sang0627@gmail.com>
Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com
 [209.85.217.177]) by dpdk.org (Postfix) with ESMTP id 9C1869200
 for <dev@dpdk.org>; Thu, 15 Oct 2015 04:08:57 +0200 (CEST)
Received: by lbbck17 with SMTP id ck17so59181712lbb.1
 for <dev@dpdk.org>; Wed, 14 Oct 2015 19:08:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :content-type; bh=/hGl7jgh3qkLTPnuaAZyriFUAQqCJN4QvO/JwR9s4rk=;
 b=ZcbRy/SPAcLPe5sVMs+YHMjk5ndnGyThWu3gQqWy0oztQb1FT2E3rqMXS5wsqrUUDQ
 HoiehHSWpe1x8uwRbSEvMj0gttRXTwA25mP6k/IcJFt44SDqV/5RwTvyg0n2AhDsCQAF
 FD5wkfFAFawuIzouldsFGKRBTlLU6SBhBtpraaP3Os3Z+ffrGoyM0Yv8p33fJSYOlp+0
 zK4a9u2Uvm3uXEKFA6D3yx1TkAFdhoRB2VZ3SATLCitZzlhlxTNmhSvZxw/f4ovXcTFQ
 6ccBOumlpoVpfd7GhcfUECUq1KJBWvvPphpZ4QH36f/GlwH3BLDVYhAVv4MQ8tLHnT2m
 nkxw==
MIME-Version: 1.0
X-Received: by 10.112.235.229 with SMTP id up5mr3116226lbc.96.1444874937235;
 Wed, 14 Oct 2015 19:08:57 -0700 (PDT)
Received: by 10.112.255.73 with HTTP; Wed, 14 Oct 2015 19:08:57 -0700 (PDT)
In-Reply-To: <CAACK=XfWoMvbvM0cVmeUM1+dotRpjGueyhLMu9PHoQmPr4sQFw@mail.gmail.com>
References: <CAACK=XfWoMvbvM0cVmeUM1+dotRpjGueyhLMu9PHoQmPr4sQFw@mail.gmail.com>
Date: Thu, 15 Oct 2015 11:08:57 +0900
Message-ID: <CAACK=XcmnkOufRfqxM3No8aPBpFWrtaiDq4JcyVh=Dzh+YZKYg@mail.gmail.com>
From: Moon-Sang Lee <sang0627@gmail.com>
To: dev@dpdk.org
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: [dpdk-dev] [Q] l2fwd in examples directory
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Oct 2015 02:08:57 -0000

There is codes as below in examples/l2fwd/main.c and I think
rte_eth_dev_socket_id(portid)
always returns -1(SOCKET_ID_ANY) since there is no association code between
port and
lcore in the example codes. (i.e. I need to find a matching lcore from
lcore_queue_conf[] with portid
and call rte_lcore_to_socket_id(lcore_id).)

        /* init one RX queue */
        fflush(stdout);
        ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
                         rte_eth_dev_socket_id(portid),
                         NULL,
                         l2fwd_pktmbuf_pool);
        if (ret < 0)
            rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d,
port=%u\n",
                  ret, (unsigned) portid);

It works fine even though memory is allocated in different NUMA node. But I
wonder there is
a DPDK API that associates inlcore to port internally thus
rte_eth_devices[portid].pci_dev->numa_node
contains proper node.


-- 
Moon-Sang Lee, SW Engineer
Email: sang0627@gmail.com
Wisdom begins in wonder. *Socrates*