From patchwork Tue Mar 1 19:56:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 63343 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2018055lbc; Tue, 1 Mar 2016 11:57:16 -0800 (PST) X-Received: by 10.140.20.39 with SMTP id 36mr28505426qgi.15.1456862235031; Tue, 01 Mar 2016 11:57:15 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d193si32386069qka.54.2016.03.01.11.57.14; Tue, 01 Mar 2016 11:57:14 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7DEA162F8B; Tue, 1 Mar 2016 19:57:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 00259619C9; Tue, 1 Mar 2016 19:57:08 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AA57662FAB; Tue, 1 Mar 2016 19:57:03 +0000 (UTC) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) by lists.linaro.org (Postfix) with ESMTPS id 0B3F862F8C for ; Tue, 1 Mar 2016 19:57:02 +0000 (UTC) Received: by mail-ob0-f170.google.com with SMTP id fz5so45579193obc.0 for ; Tue, 01 Mar 2016 11:57:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LTBWDQC8E6ZEYRyzITCZnB87QQslzXED6Nh0M8Bpj7M=; b=JrJTA+5pn/5NgliRaMKxLG/KV9Je3rwdn1euOwMecayJrVIREIRBMHJcNvakO8V9I5 Z9cGFjc//Q4pG4tOmG6TTznh6I8z28YbKfzhuFE+IIeedstd7tn8VTfc73/b5HZm2que c3Xk66svclSiY/d21Pwad/3cTZUVugIMkrTFCA9Z3fVZLXpV4Vd2atoReIWNgDUxaihv f2VVvrAtSHmhqYmWmH7qx1TGgZjaEVq9KxVatfDKh8eBitMUn9Hm9So8VvOm5M4nwFnw HDKrgxAYiUCkogxGaoyfwbR1mVqaYYYS/W5MxuI3ZVzPUhFS06QZZT6+6oPDd6T2OVvK 6NWA== X-Gm-Message-State: AD7BkJJ72zIvpE6CX3tp/ATqTsulMPqpiKzO56K5utQZ8+eAbm8iNQVNlyWP0UrOKSX52XKC490= X-Received: by 10.182.61.38 with SMTP id m6mr18565399obr.32.1456862221425; Tue, 01 Mar 2016 11:57:01 -0800 (PST) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id bi2sm23064932obb.24.2016.03.01.11.57.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 11:57:00 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 1 Mar 2016 13:56:56 -0600 Message-Id: <1456862218-26220-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2 1/3] linux-generic: pktio: add link_status handler for loop interfaces X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" ODP loopback interfaces should always be considered up, so add a handler for odp_pktio_link_status() for this device type that always returns 1 to indicate the link is up. Signed-off-by: Bill Fischofer --- platform/linux-generic/pktio/loop.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index dbb0e7b..0ea6d0e 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -134,6 +134,12 @@ static int loopback_mac_addr_get(pktio_entry_t *pktio_entry ODP_UNUSED, return ETH_ALEN; } +static int loopback_link_status(pktio_entry_t *pktio_entry ODP_UNUSED) +{ + /* loopback interfaces are always up */ + return 1; +} + static int loopback_promisc_mode_set(pktio_entry_t *pktio_entry, odp_bool_t enable) { @@ -176,6 +182,7 @@ const pktio_if_ops_t loopback_pktio_ops = { .promisc_mode_set = loopback_promisc_mode_set, .promisc_mode_get = loopback_promisc_mode_get, .mac_get = loopback_mac_addr_get, + .link_status = loopback_link_status, .capability = NULL, .input_queues_config = NULL, .output_queues_config = NULL,