From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B68E3A0C61; Fri, 5 Nov 2021 09:39:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DD8D41143; Fri, 5 Nov 2021 09:39:03 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5972D40689 for ; Fri, 5 Nov 2021 09:39:01 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1A50PbGL014958; Fri, 5 Nov 2021 01:39:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=/5GcIhR2PjCpavloM5d4DfUSgn0Xdt63Igi2eJd2y7g=; b=aiMqnXCn8VEQHb09NAU4cF0iMFg6MBL2pq7weve0Y/NPqoaVpW1KV1hX6djyDSMl93Sg WkwO9OHjCd/EDtrv5CYs9qf629jtuMKMJ0He6VjpH/MrrJZDpPweUX3utckv1kp63svw xgAvabrvCcBoLrlLwS5q1VRWSlpyZ+knF8oAVU/OLAUFcxC94rU621z8Esk900K/0xbP SAQtzza3N0uW2kUuDMqjv+I/jnyx+HjxbeaPOyZqy2tPQPECMh1qy2IMPs/tmPVLh0EL aidktKcp7ksnKhhwJ+B6b9GZf2dt06OBTZBmS5y92uoLDUjRpleuqeLYW7zUkeD+EZUY Qw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3c4t2fsq5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 05 Nov 2021 01:39:00 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 5 Nov 2021 01:38:58 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 5 Nov 2021 01:38:58 -0700 Received: from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176]) by maili.marvell.com (Postfix) with ESMTP id F13453F7043; Fri, 5 Nov 2021 01:38:56 -0700 (PDT) From: To: , , CC: , Pavan Nikhilesh Date: Fri, 5 Nov 2021 14:08:50 +0530 Message-ID: <20211105083851.2812-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211105083851.2812-1-pbhagavatula@marvell.com> References: <20211003202448.10908-1-pbhagavatula@marvell.com> <20211105083851.2812-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: xaSk3PHkHQrjby4aO9RYFeEa35_0L6no X-Proofpoint-GUID: xaSk3PHkHQrjby4aO9RYFeEa35_0L6no X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-05_01,2021-11-03_01,2020-04-07_01 Subject: [dpdk-dev] [PATCH v5 2/3] examples/l3fwd: print port bdf when adding routes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Since the number of Ethernet ports have gone up, print the pci bdf along with the routes. This is also helpful for cases where allow listing order is not honored. Signed-off-by: Pavan Nikhilesh --- examples/l3fwd/l3fwd_fib.c | 31 +++++++++++++++++++------------ examples/l3fwd/l3fwd_lpm.c | 19 ++++++++++++------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c index f5c685a4f3..2110459cc3 100644 --- a/examples/l3fwd/l3fwd_fib.c +++ b/examples/l3fwd/l3fwd_fib.c @@ -580,6 +580,7 @@ fib_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy) void setup_fib(const int socketid) { + struct rte_eth_dev_info dev_info; struct rte_fib6_conf config; struct rte_fib_conf config_ipv4; unsigned int i; @@ -611,6 +612,8 @@ setup_fib(const int socketid) enabled_port_mask) == 0) continue; + rte_eth_dev_info_get(ipv4_l3fwd_route_array[i].if_out, + &dev_info); ret = rte_fib_add(ipv4_l3fwd_fib_lookup_struct[socketid], ipv4_l3fwd_route_array[i].ip, ipv4_l3fwd_route_array[i].depth, @@ -624,13 +627,14 @@ setup_fib(const int socketid) in.s_addr = htonl(ipv4_l3fwd_route_array[i].ip); if (inet_ntop(AF_INET, &in, abuf, sizeof(abuf)) != NULL) { - printf("FIB: Adding route %s / %d (%d)\n", - abuf, - ipv4_l3fwd_route_array[i].depth, - ipv4_l3fwd_route_array[i].if_out); + printf("FIB: Adding route %s / %d (%d) [%s]\n", abuf, + ipv4_l3fwd_route_array[i].depth, + ipv4_l3fwd_route_array[i].if_out, + dev_info.device->name); } else { - printf("FIB: IPv4 route added to port %d\n", - ipv4_l3fwd_route_array[i].if_out); + printf("FIB: IPv4 route added to port %d [%s]\n", + ipv4_l3fwd_route_array[i].if_out, + dev_info.device->name); } } /* >8 End of setup fib. */ @@ -659,6 +663,8 @@ setup_fib(const int socketid) enabled_port_mask) == 0) continue; + rte_eth_dev_info_get(ipv6_l3fwd_route_array[i].if_out, + &dev_info); ret = rte_fib6_add(ipv6_l3fwd_fib_lookup_struct[socketid], ipv6_l3fwd_route_array[i].ip, ipv6_l3fwd_route_array[i].depth, @@ -672,13 +678,14 @@ setup_fib(const int socketid) if (inet_ntop(AF_INET6, ipv6_l3fwd_route_array[i].ip, abuf, sizeof(abuf)) != NULL) { - printf("FIB: Adding route %s / %d (%d)\n", - abuf, - ipv6_l3fwd_route_array[i].depth, - ipv6_l3fwd_route_array[i].if_out); + printf("FIB: Adding route %s / %d (%d) [%s]\n", abuf, + ipv6_l3fwd_route_array[i].depth, + ipv6_l3fwd_route_array[i].if_out, + dev_info.device->name); } else { - printf("FIB: IPv6 route added to port %d\n", - ipv6_l3fwd_route_array[i].if_out); + printf("FIB: IPv6 route added to port %d [%s]\n", + ipv6_l3fwd_route_array[i].if_out, + dev_info.device->name); } } } diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index 9ae288780c..a5b476ced3 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -551,6 +551,7 @@ lpm_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy) void setup_lpm(const int socketid) { + struct rte_eth_dev_info dev_info; struct rte_lpm6_config config; struct rte_lpm_config config_ipv4; unsigned i; @@ -579,6 +580,8 @@ setup_lpm(const int socketid) enabled_port_mask) == 0) continue; + rte_eth_dev_info_get(ipv4_l3fwd_route_array[i].if_out, + &dev_info); ret = rte_lpm_add(ipv4_l3fwd_lpm_lookup_struct[socketid], ipv4_l3fwd_route_array[i].ip, ipv4_l3fwd_route_array[i].depth, @@ -591,10 +594,10 @@ setup_lpm(const int socketid) } in.s_addr = htonl(ipv4_l3fwd_route_array[i].ip); - printf("LPM: Adding route %s / %d (%d)\n", + printf("LPM: Adding route %s / %d (%d) [%s]\n", inet_ntop(AF_INET, &in, abuf, sizeof(abuf)), - ipv4_l3fwd_route_array[i].depth, - ipv4_l3fwd_route_array[i].if_out); + ipv4_l3fwd_route_array[i].depth, + ipv4_l3fwd_route_array[i].if_out, dev_info.device->name); } /* create the LPM6 table */ @@ -618,6 +621,8 @@ setup_lpm(const int socketid) enabled_port_mask) == 0) continue; + rte_eth_dev_info_get(ipv4_l3fwd_route_array[i].if_out, + &dev_info); ret = rte_lpm6_add(ipv6_l3fwd_lpm_lookup_struct[socketid], ipv6_l3fwd_route_array[i].ip, ipv6_l3fwd_route_array[i].depth, @@ -629,11 +634,11 @@ setup_lpm(const int socketid) i, socketid); } - printf("LPM: Adding route %s / %d (%d)\n", - inet_ntop(AF_INET6, ipv6_l3fwd_route_array[i].ip, - abuf, sizeof(abuf)), + printf("LPM: Adding route %s / %d (%d) [%s]\n", + inet_ntop(AF_INET6, ipv6_l3fwd_route_array[i].ip, abuf, + sizeof(abuf)), ipv6_l3fwd_route_array[i].depth, - ipv6_l3fwd_route_array[i].if_out); + ipv6_l3fwd_route_array[i].if_out, dev_info.device->name); } } -- 2.17.1