From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 0954D93BA for ; Tue, 5 Jan 2016 19:00:32 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id u188so32808941wmu.1 for ; Tue, 05 Jan 2016 10:00:32 -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:in-reply-to:references; bh=/lp5dwoqRtBJM0vXbwC6r+6HAekxWuKpv4qtqq2Iil4=; b=AStGZ/jCzc4op2MoJY7GlYD/bT5y3b8uVHCnY129RPsS8CvXiw2aeIJWwyTSSitWny Mv8zl3JnAfXMc7Q7h0eVUjYbjJR3ak6Sbql/Hwc7AAKkfEOPKXjb06SRekxPBuu92Zw0 7UB55NF9QqE/QnkpxIUoVxNIWXuvnimDyR2vb5k3io7feZsVX8gdCgQmKUhwj3HESImD gYpHQmyM5GVWFa0RbHOxe5LUB2V9fuZW2tyBhZaMp15V8M9rWwfObx5gP1Spn3ZoisJ9 28PmXlFS5w5k/WlBtXSRluvMwiT5K14PRX2XOdNRDK+cQ89wndvcKzfRCA1hOm9ENuS1 QrKw== 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=/lp5dwoqRtBJM0vXbwC6r+6HAekxWuKpv4qtqq2Iil4=; b=cbzmUSjelpEU2GrKQFZa2Z8JitmE4qkZp8LWTb0IRzeJD4lDmAWcCP8r65Abh2J8qf hrJg/cDo6z0c/o5gbJ1sM80u5wLJiop7Y52uqX4OI3PxHmNdCG20D4MyNwUuRP5zFsYX fCM1R51Rrh+xoKntGpMH3xWgttDtbv10OU48xisEDsXBxWYvxabOUSnNBzvWkE9Dmd67 vhDkB8Rfq4accSsCrh658YAnyrq0UGStRR+jTckk1zR9HFCmO2A6czkFGcFh953A1H4B TWPQayqEJldsymwhT/GCp0MaDX/VnqUrDCPcxL78eWtkzd8wl2J8Gy5YyPREaw7z/OFz e5gQ== X-Gm-Message-State: ALoCoQkSH5gF5yDZ/R8bX+iOl3/UF0qfB+MFV9duxz3scqbl6MobLxV14FDHWw1FxEPCe/Zj/4/8aqhkqfr+01Vk4DdOlctirw== X-Received: by 10.28.12.140 with SMTP id 134mr5198013wmm.21.1452016831904; Tue, 05 Jan 2016 10:00:31 -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.30 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jan 2016 10:00:31 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Tue, 5 Jan 2016 19:00:09 +0100 Message-Id: <1452016809-29347-2-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1452016809-29347-1-git-send-email-david.marchand@6wind.com> References: <1452016809-29347-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH 2/2] mlx5: 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:32 -0000 Signed-off-by: David Marchand --- drivers/net/mlx5/mlx5.c | 1 + drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_mac.c | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 821ee0f..30d88b5 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -162,6 +162,7 @@ static const struct eth_dev_ops mlx5_dev_ops = { .flow_ctrl_set = mlx5_dev_set_flow_ctrl, .mac_addr_remove = mlx5_mac_addr_remove, .mac_addr_add = mlx5_mac_addr_add, + .mac_addr_set = mlx5_mac_addr_set, .mtu_set = mlx5_dev_set_mtu, .reta_update = mlx5_dev_rss_reta_update, .reta_query = mlx5_dev_rss_reta_query, diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index b84d31d..2f9a594 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -179,6 +179,7 @@ int priv_mac_addr_add(struct priv *, unsigned int, int priv_mac_addrs_enable(struct priv *); void mlx5_mac_addr_add(struct rte_eth_dev *, struct ether_addr *, uint32_t, uint32_t); +void mlx5_mac_addr_set(struct rte_eth_dev *, struct ether_addr *); /* mlx5_rss.c */ diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c index e37ce06..b1f34d9 100644 --- a/drivers/net/mlx5/mlx5_mac.c +++ b/drivers/net/mlx5/mlx5_mac.c @@ -488,3 +488,19 @@ mlx5_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, end: priv_unlock(priv); } + +/** + * DPDK callback to set primary MAC address. + * + * @param dev + * Pointer to Ethernet device structure. + * @param mac_addr + * MAC address to register. + */ +void +mlx5_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +{ + DEBUG("%p: setting primary MAC address", (void *)dev); + mlx5_mac_addr_remove(dev, 0); + mlx5_mac_addr_add(dev, mac_addr, 0, 0); +} -- 1.7.10.4