From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f48.google.com (mail-qg0-f48.google.com [209.85.192.48]) by dpdk.org (Postfix) with ESMTP id 4A344B38D for ; Thu, 11 Jun 2015 17:53:32 +0200 (CEST) Received: by qgfa66 with SMTP id a66so3300087qgf.0 for ; Thu, 11 Jun 2015 08:53:31 -0700 (PDT) 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:in-reply-to :references; bh=hlfYJCyP9WJXYWDAsFD+O8uwxpK+2+0AVTW7vYwsTQ0=; b=bDAtAA/MH31v7wHNMP7hsEgkEky8WNqn0Qy6ZZxRv6OV/2pSrHYnwZ/UWQ7Snw1TOI S4A4232KbPHOAUecdrVMzMKs7o2SYbwNMZdSu86zAh7l47UcaCO6lz34y+gjeA+uKppL xS/EJQ0kQROxFzFtJ33PQr+IG6F9lMQ47CaGF5SokTT3hX0kmvB8w5/EHvtPmg/UfZDV 1pI5N20P173viT+6+jBsNT+4knlmhlP6Wsh8HbaLa0D5Hazewq4nPDJ4Zwsx4pQaPYxc w4uPbQqPEpKtWRyC0qDKIzUfiUQZ901rtRPA5W86BJ2h7Y8VLSj1qQG/+YO1c5RZTBrs WfRQ== X-Gm-Message-State: ALoCoQnCvvGdu+PS2aMe7mp7UNDEgUzQRYF/2hCvxQ4CWnDJrHbYiVkZUEoiorVUFyucnNf9+lZI X-Received: by 10.140.33.227 with SMTP id j90mr12276209qgj.6.1434038011884; Thu, 11 Jun 2015 08:53:31 -0700 (PDT) Received: from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id v13sm405348qhd.31.2015.06.11.08.53.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Jun 2015 08:53:31 -0700 (PDT) From: Stephen Hemminger To: changchun.ouyang@intel.com Date: Thu, 11 Jun 2015 08:53:25 -0700 Message-Id: <1434038007-8964-4-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1434038007-8964-1-git-send-email-stephen@networkplumber.org> References: <1434038007-8964-1-git-send-email-stephen@networkplumber.org> Cc: dev@dpdk.org, Stephen Hemminger Subject: [dpdk-dev] [PATCH 3/5] virtio: don't set mac table unless negotiated X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2015 15:53:32 -0000 From: Stephen Hemminger Don't attempt to set the MAC address table unless the host allows it in feature negotiation. Also, don't return a value from mac_table_set since all callers ignore the return value. Signed-off-by: Stephen Hemminger --- drivers/net/virtio/virtio_ethdev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 3476ad3..ad49fc1 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -668,7 +668,7 @@ virtio_get_hwaddr(struct virtio_hw *hw) } } -static int +static void virtio_mac_table_set(struct virtio_hw *hw, const struct virtio_net_ctrl_mac *uc, const struct virtio_net_ctrl_mac *mc) @@ -676,6 +676,11 @@ virtio_mac_table_set(struct virtio_hw *hw, struct virtio_pmd_ctrl ctrl; int err, len[2]; + if (!vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_MAC_ADDR)) { + PMD_DRV_LOG(INFO, "host does not support mac table\n"); + return; + } + ctrl.hdr.class = VIRTIO_NET_CTRL_MAC; ctrl.hdr.cmd = VIRTIO_NET_CTRL_MAC_TABLE_SET; @@ -688,8 +693,6 @@ virtio_mac_table_set(struct virtio_hw *hw, err = virtio_send_command(hw->cvq, &ctrl, len, 2); if (err != 0) PMD_DRV_LOG(NOTICE, "mac table set failed: %d", err); - - return err; } static void -- 2.1.4