DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: changchun.ouyang@intel.com
Cc: dev@dpdk.org, Stephen Hemminger <shemming@brocade.com>
Subject: [dpdk-dev] [PATCH 3/5] virtio: don't set mac table unless negotiated
Date: Thu, 11 Jun 2015 08:53:25 -0700	[thread overview]
Message-ID: <1434038007-8964-4-git-send-email-stephen@networkplumber.org> (raw)
In-Reply-To: <1434038007-8964-1-git-send-email-stephen@networkplumber.org>

From: Stephen Hemminger <shemming@brocade.com>

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 <stephen@networkplumber.org>
---
 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

  parent reply	other threads:[~2015-06-11 15:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 15:53 [dpdk-dev] [PATCH 0/5 v3] virtio: patches Stephen Hemminger
2015-06-11 15:53 ` [dpdk-dev] [PATCH 1/5] virtio: remove blank lines Stephen Hemminger
2015-06-12  1:28   ` Ouyang, Changchun
2015-06-11 15:53 ` [dpdk-dev] [PATCH 2/5] virtio: don't enable/disable rx modes unless supported Stephen Hemminger
2015-06-12  1:29   ` Ouyang, Changchun
2015-06-11 15:53 ` Stephen Hemminger [this message]
2015-06-12  1:30   ` [dpdk-dev] [PATCH 3/5] virtio: don't set mac table unless negotiated Ouyang, Changchun
2015-06-11 15:53 ` [dpdk-dev] [PATCH 4/5] virtio: clarify feature bit handling Stephen Hemminger
2015-06-12  1:36   ` Ouyang, Changchun
2015-06-11 15:53 ` [dpdk-dev] [PATCH 5/5] virtio: fix ring size negotiation Stephen Hemminger
2015-06-12  1:49   ` Ouyang, Changchun
2015-06-12 12:46 ` [dpdk-dev] [PATCH 0/5 v3] virtio: patches Thomas Monjalon
  -- strict thread matches above, loose matches on Subject: below --
2015-04-15 15:20 [dpdk-dev] [PATCH 0/5] virtio driver fixes and cleanup Stephen Hemminger
2015-04-15 15:20 ` [dpdk-dev] [PATCH 3/5] virtio: don't set mac table unless negotiated Stephen Hemminger
2015-04-16  3:45   ` Ouyang, Changchun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434038007-8964-4-git-send-email-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=changchun.ouyang@intel.com \
    --cc=dev@dpdk.org \
    --cc=shemming@brocade.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).