From patchwork Thu Feb 26 19:42:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 45202 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B426520674 for ; Thu, 26 Feb 2015 19:43:24 +0000 (UTC) Received: by lamq1 with SMTP id q1sf10224060lam.0 for ; Thu, 26 Feb 2015 11:43:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=T9MP/3It05CqxYMi0iddhPggDVerxFN0HXWST6oz6qw=; b=SQlbZ5NK4gKpxDOFyFKFuvnjtlbcopDXXhvEMYmu6K//HyjHfTP1Vpdkci4mdkFKQP AAZJ7+D9iL37t5yWy8crT24R5hLeqWtJpgsIdYAP3CqKcdeMXJOJohsPOuXzrX7kGrrZ vFzQoN+Gyh+V3CVJ3ju8ZdC4gOrjoJRDW0paDptFyYaUS3mm8tta2EIiTZ1kRIHnFaSi bPSD+/Fb0BYKTkBex9+5/LkOCdB46lXc+AiQoJSSk01EwRV4KAaKjSYUeCV8IqR6YlnZ AhktrRCbu0Y3vZ/jLvzxHLKCjXX1XhOmqMBSUL4JJwALJuCpbVhrGT5tVwZL/X1rmREb tB0Q== X-Gm-Message-State: ALoCoQk8UaJOoBe1p3mWfU1Ty1wC/uMnTdcoAlU9Xjo0/TFQuOtK7c0FuKo3lNZMDskCjq4k33dw X-Received: by 10.180.11.34 with SMTP id n2mr1002887wib.2.1424979803362; Thu, 26 Feb 2015 11:43:23 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.171 with SMTP id kr11ls76117lac.36.gmail; Thu, 26 Feb 2015 11:43:23 -0800 (PST) X-Received: by 10.112.9.74 with SMTP id x10mr9116850lba.93.1424979803204; Thu, 26 Feb 2015 11:43:23 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id d9si1293297lah.156.2015.02.26.11.43.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 11:43:23 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lamq1 with SMTP id q1so13257076lam.5 for ; Thu, 26 Feb 2015 11:43:23 -0800 (PST) X-Received: by 10.112.42.225 with SMTP id r1mr9181150lbl.72.1424979803056; Thu, 26 Feb 2015 11:43:23 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp3515886lbj; Thu, 26 Feb 2015 11:43:22 -0800 (PST) X-Received: by 10.140.98.35 with SMTP id n32mr20852375qge.62.1424979802292; Thu, 26 Feb 2015 11:43:22 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id x11si1751342qae.72.2015.02.26.11.43.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Feb 2015 11:43:22 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YR4L7-0004Ea-EC; Thu, 26 Feb 2015 19:43:17 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YR4L1-0004CW-Gz for lng-odp@lists.linaro.org; Thu, 26 Feb 2015 19:43:11 +0000 Received: by labgd6 with SMTP id gd6so13264606lab.7 for ; Thu, 26 Feb 2015 11:43:05 -0800 (PST) X-Received: by 10.152.178.164 with SMTP id cz4mr9176145lac.39.1424979785863; Thu, 26 Feb 2015 11:43:05 -0800 (PST) Received: from localhost.localdomain (broadband-46-188-125-102.2com.net. [46.188.125.102]) by mx.google.com with ESMTPSA id n9sm398494lbp.0.2015.02.26.11.43.04 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Feb 2015 11:43:04 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 26 Feb 2015 22:42:57 +0300 Message-Id: <1424979778-20444-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCHv2 1/2] linux-generic: make more readable debug messages X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Pkio tests also test for incorrect number. In log there are messages about errors on ioctl. Make prints for that errors more clean. Like: odp_packet_socket.c:161:setup_pkt_sock():ioctl(SIOCGIFINDEX): No such device: "nothere". odp_packet_socket.c:738:mmap_store_hw_addr():ioctl(SIOCGIFHWADDR): No such device: "nothere" Signed-off-by: Maxim Uvarov Reviewed-by: Bill Fischofer --- platform/linux-generic/odp_packet_socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 41e57c1..55c212e 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -157,7 +157,8 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev, snprintf(ethreq.ifr_name, IFNAMSIZ, "%s", netdev); err = ioctl(sockfd, SIOCGIFINDEX, ðreq); if (err != 0) { - ODP_ERR("ioctl(SIOCGIFINDEX): %s\n", strerror(errno)); + ODP_ERR("ioctl(SIOCGIFINDEX): %s: \"%s\".\n", strerror(errno), + ethreq.ifr_name); goto error; } if_idx = ethreq.ifr_ifindex; @@ -732,7 +733,9 @@ static int mmap_store_hw_addr(pkt_sock_mmap_t *const pkt_sock, ret = ioctl(pkt_sock->sockfd, SIOCGIFHWADDR, ðreq); if (ret != 0) { __odp_errno = errno; - ODP_ERR("ioctl(SIOCGIFHWADDR): %s\n", strerror(errno)); + ODP_ERR("ioctl(SIOCGIFHWADDR): %s: \"%s\".\n", + strerror(errno), + ethreq.ifr_name); return -1; }