From patchwork Tue Jan 27 16:44:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 43841 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B07892409D for ; Tue, 27 Jan 2015 16:47:42 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf8332254lbj.0 for ; Tue, 27 Jan 2015 08:47:41 -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=wIarUJzHycghzW+EXrFoj38TBDrgE877EQrVruuTvig=; b=Ci9khrpT6gNzTgnRr+maKX/Lo4kSznIC/q58Rk0oLwUgYPYdC8nSnlU3E4QEeQ4yEl lVadppsWTV1AH5AMEhcnz1Zvy3ccLUaiy8J2ZuQJKvKm6qA7IxyfrJNe6QJK5dfZxC3K 65CEhaIXcddM2jO4nojHPPVYAQF7JOypIUrWZ5oQN/YONUOs/+DdYutwsm1q2+8JwYnG YrTY4iTpSrgi2eXJVy7ipCqOxaJnHfa8cLe9m/UwDtyyzEnaRXjTESogyiIv3SPB7XCl GYLonJHjfg2xmkyCAP0204QjC+zoDt9YXEV+vaFjCMAh9ZmkebnznmnaQDAM94AX+zVa Gxcg== X-Gm-Message-State: ALoCoQnTJn9LtaoV3FPFledRIiPWOvnPYZdkrpHg2E+i1sNeIRNDTqErUK0Xl3+D4v98WN2yUYqx X-Received: by 10.194.204.201 with SMTP id la9mr408428wjc.6.1422377261687; Tue, 27 Jan 2015 08:47:41 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.193 with SMTP id ao1ls66305lac.20.gmail; Tue, 27 Jan 2015 08:47:41 -0800 (PST) X-Received: by 10.112.130.34 with SMTP id ob2mr2962803lbb.78.1422377261451; Tue, 27 Jan 2015 08:47:41 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id ei2si1815960lad.39.2015.01.27.08.47.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 08:47:41 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so14107721lbi.1 for ; Tue, 27 Jan 2015 08:47:41 -0800 (PST) X-Received: by 10.112.44.230 with SMTP id h6mr2888270lbm.98.1422377261071; Tue, 27 Jan 2015 08:47:41 -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 h5csp1160211lbj; Tue, 27 Jan 2015 08:47:40 -0800 (PST) X-Received: by 10.140.109.164 with SMTP id l33mr3372654qgf.91.1422377259709; Tue, 27 Jan 2015 08:47:39 -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 k89si2015754qge.62.2015.01.27.08.47.38 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 27 Jan 2015 08:47:39 -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 1YG9Id-0001tW-S8; Tue, 27 Jan 2015 16:47:35 +0000 Received: from mail-lb0-f180.google.com ([209.85.217.180]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YG9IX-0001rR-PT for lng-odp@lists.linaro.org; Tue, 27 Jan 2015 16:47:29 +0000 Received: by mail-lb0-f180.google.com with SMTP id b6so14039090lbj.11 for ; Tue, 27 Jan 2015 08:47:23 -0800 (PST) X-Received: by 10.152.4.102 with SMTP id j6mr2805795laj.95.1422377243248; Tue, 27 Jan 2015 08:47:23 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id c6sm591245lag.26.2015.01.27.08.47.21 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 08:47:22 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 27 Jan 2015 19:44:16 +0300 Message-Id: <1422377056-13294-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] linux-generic: pktio: abort on enq to pktin or deq from pktout 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.217.170 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 From: Stuart Haslam Attempts to enq to a pktin queue or deq from a pktout queue are programming errors, so abort. Signed-off-by: Stuart Haslam Reviewed-by: Taras Kondratiuk Signed-off-by: Maxim Uvarov --- v2: use ODP_UNUSED platform/linux-generic/odp_packet_io.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index f69d6b1..52125fc 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -535,9 +535,9 @@ int pktout_enqueue(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr) return (nbr == len ? 0 : -1); } -odp_buffer_hdr_t *pktout_dequeue(queue_entry_t *qentry) +odp_buffer_hdr_t *pktout_dequeue(queue_entry_t *qentry ODP_UNUSED) { - (void)qentry; + ODP_ABORT("attempted dequeue from a pktout queue"); return NULL; } @@ -555,20 +555,19 @@ int pktout_enq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], return (nbr == num ? 0 : -1); } -int pktout_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], - int num) +int pktout_deq_multi(queue_entry_t *qentry ODP_UNUSED, + odp_buffer_hdr_t *buf_hdr[] ODP_UNUSED, + int num ODP_UNUSED) { - (void)qentry; - (void)buf_hdr; - (void)num; - + ODP_ABORT("attempted dequeue from a pktout queue"); return 0; } -int pktin_enqueue(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr) +int pktin_enqueue(queue_entry_t *qentry ODP_UNUSED, + odp_buffer_hdr_t *buf_hdr ODP_UNUSED) { - /* Use default action */ - return queue_enq(qentry, buf_hdr); + ODP_ABORT("attempted enqueue to a pktin queue"); + return -1; } odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) @@ -603,10 +602,12 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) return buf_hdr; } -int pktin_enq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int num) +int pktin_enq_multi(queue_entry_t *qentry ODP_UNUSED, + odp_buffer_hdr_t *buf_hdr[] ODP_UNUSED, + int num ODP_UNUSED) { - /* Use default action */ - return queue_enq_multi(qentry, buf_hdr, num); + ODP_ABORT("attempted enqueue to a pktin queue"); + return 0; } int pktin_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int num)