From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id DAE2593BA for ; Tue, 5 Jan 2016 19:00:30 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id f206so41251884wmf.0 for ; Tue, 05 Jan 2016 10:00:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=zcaiitg0Qs9qH/+Pd3MNvVrQDDjLZFAUN2XR2KvWs1o=; b=TvJKzgeMD3fYP4G+RZPocl2olCLLMcwfvc7C2ljuWEamc+soWsj/wUmDbydkzrezS8 TxnsmyiKL4t+5UnRLzMIcoHJiT9Kk9vERcr1f+xPjvD3oMFcHq0Mk5t7mS8zHrTNh25K 9KHI6sMivUQgxGMkdhv82xpMYEGOYFw5fOhIx2dLZ7XCma2BLXAzDuD1k/GLR/eWWCj4 NI43P2EmA8teQ8EpThPJ7WTV4FHQ7CTNSykCulfu706q8O48mb5Y1lGGW8XmRLMqFzv6 WeClIWi6HfQ+2B4ooYVUlhrHcu/MsuK9n7YFXCMejPLZ5owfB7ZK0vyPmFYzQ00XrfAM kB5w== 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=zcaiitg0Qs9qH/+Pd3MNvVrQDDjLZFAUN2XR2KvWs1o=; b=C3lE0iepK3Mz4ozbme0GRhtGJZJpp70oJxwkkAYOP7I1rCjY4shuQGjIiI7I1TRPjk 8Rz+nKmVkmTBterHNhHndM8VqSuZ2sg6DGr2GbG6jQLUH75k8vgFej3IiTURw+PMentb nCvL920tFLADj+Zn1g3gY2fM1zFEqX905Wm3wMYy1z55/270czw+adMSIjwhP+44CEzt /QrXYnzg8hl47HnobQhjjlofVip8WQwWHD6IddwAkYvAIaSU9DjxWmD1m2vZ81A+3b44 MD+pYu/nzqKDfK9LJUcurKOlxC3Nz38Uw/GWp3il+48fN+cRbLryb2Ldu5xsSm28mhv2 viXQ== X-Gm-Message-State: ALoCoQkJQCBtzlzvLtWSl/jh2UgmtZ2ExENqZFG/CFUq42t7dNEM4oK0XgVsfSX/EXtC7pY7YYEH+tUBDwo5xJQYuE5jsXsXlA== X-Received: by 10.28.55.76 with SMTP id e73mr5707172wma.53.1452016830697; Tue, 05 Jan 2016 10:00:30 -0800 (PST) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id i2sm2838284wjx.42.2016.01.05.10.00.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jan 2016 10:00:29 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Tue, 5 Jan 2016 19:00:08 +0100 Message-Id: <1452016809-29347-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 Subject: [dpdk-dev] [PATCH 1/2] mlx4: add callback to set primary mac address 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: Tue, 05 Jan 2016 18:00:31 -0000 Signed-off-by: David Marchand --- drivers/net/mlx4/mlx4.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 207bfe2..acc76d7 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -4432,6 +4432,22 @@ end: } /** + * DPDK callback to set the primary MAC address. + * + * @param dev + * Pointer to Ethernet device structure. + * @param mac_addr + * MAC address to register. + */ +static void +mlx4_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +{ + DEBUG("%p: setting primary MAC address", (void *)dev); + mlx4_mac_addr_remove(dev, 0); + mlx4_mac_addr_add(dev, mac_addr, 0, 0); +} + +/** * DPDK callback to enable promiscuous mode. * * @param dev @@ -5004,6 +5020,7 @@ static const struct eth_dev_ops mlx4_dev_ops = { .priority_flow_ctrl_set = NULL, .mac_addr_remove = mlx4_mac_addr_remove, .mac_addr_add = mlx4_mac_addr_add, + .mac_addr_set = mlx4_mac_addr_set, .mtu_set = mlx4_dev_set_mtu, .udp_tunnel_add = NULL, .udp_tunnel_del = NULL, -- 1.7.10.4