From patchwork Mon Feb 29 20:53:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 63257 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1464115lbc; Mon, 29 Feb 2016 12:53:20 -0800 (PST) X-Received: by 10.55.74.14 with SMTP id x14mr22285679qka.70.1456779200037; Mon, 29 Feb 2016 12:53:20 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g6si334302qkb.57.2016.02.29.12.53.19; Mon, 29 Feb 2016 12:53:19 -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 5180861D12; Mon, 29 Feb 2016 20:53:19 +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_H2, 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 A68B961B53; Mon, 29 Feb 2016 20:53:13 +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 1AD5261B53; Mon, 29 Feb 2016 20:53:11 +0000 (UTC) Received: from mail-ob0-f176.google.com (mail-ob0-f176.google.com [209.85.214.176]) by lists.linaro.org (Postfix) with ESMTPS id 5B3E461B00 for ; Mon, 29 Feb 2016 20:53:10 +0000 (UTC) Received: by mail-ob0-f176.google.com with SMTP id ts10so146866538obc.1 for ; Mon, 29 Feb 2016 12:53:10 -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=WztdHNGlwS7pNa5JzWqd6rJjmiVrvp6H8zHSF/HNt02QjohgeS1uvgoQysnAXcoG2E IMXLxkKSwF1x/88j02fxTznwoxZCko7uhf9w30spOKWwilWunvdosz89TT6LVlBKA9Fp t6gpHlfxJzhCCuYdmk1siYkiUmmKzzQwunCNYadglGci9mTCdPb8I2EiQ3067gQS60/S k08+hdQ3WsnixA3dcZcDCKSzQXMwS6IEirjApHhSJkFhdBkQ0vhEu/LvFXEoX/ehTo2A dAsJCvOm7Lf8YXhogxZjgglMPgw43SlBnTv8XAmNWVn508fSHWldwN4TL04WwJEhhXth ghgQ== X-Gm-Message-State: AD7BkJJBp/Z7QJupcJ4NI9MtUruGmQiKGH3FhRc+tIVKKoO+VXv7YLIJUvbO6l/mswc911VVCF8= X-Received: by 10.182.24.8 with SMTP id q8mr13199425obf.67.1456779189906; Mon, 29 Feb 2016 12:53:09 -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 v136sm19222721oif.15.2016.02.29.12.53.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 12:53:09 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 29 Feb 2016 14:53:05 -0600 Message-Id: <1456779187-32336-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 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,