From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-ft2.fr.colt.net (smtp-ft2.fr.colt.net [213.41.78.204]) by dpdk.org (Postfix) with ESMTP id 12772C312 for ; Thu, 28 May 2015 17:05:35 +0200 (CEST) Received: from smtp-ex5.fr.colt.net (smtp-ex5.fr.colt.net [213.41.78.121]) by smtp-ft2.fr.colt.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id t4SF5Smx020027 for ; Thu, 28 May 2015 17:05:28 +0200 Received: from 33.106-14-84.ripe.coltfrance.com ([84.14.106.33] helo=proxy.6wind.com) by smtp-ex5.fr.colt.net with esmtp (Exim) (envelope-from ) id 1YxzNG-0006EY-1D for ; Thu, 28 May 2015 17:05:34 +0200 Received: from 6wind.com (unknown [10.16.0.189]) by proxy.6wind.com (Postfix) with SMTP id 0AEBD28366; Thu, 28 May 2015 17:05:33 +0200 (CEST) Received: by 6wind.com (sSMTP sendmail emulation); Thu, 28 May 2015 17:05:30 +0200 From: Ivan Boule To: dev@dpdk.org Date: Thu, 28 May 2015 17:05:21 +0200 Message-Id: <1432825523-19006-4-git-send-email-ivan.boule@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432825523-19006-1-git-send-email-ivan.boule@6wind.com> References: <1432825523-19006-1-git-send-email-ivan.boule@6wind.com> X-ACL-Warn: 1/1 recipients OK. Subject: [dpdk-dev] [PATCH 3/5] e1000: add multicast MAC address filtering 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, 28 May 2015 15:05:35 -0000 Support the PMD function "set_mc_addr_list" in the "igb", "igb-vf", and "em" Poll Mode Drivers. Signed-off-by: Ivan Boule --- drivers/net/e1000/em_ethdev.c | 17 +++++++++++++++++ drivers/net/e1000/igb_ethdev.c | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index d28030e..2392942 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -116,6 +116,10 @@ static void eth_em_rar_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr, uint32_t index, uint32_t pool); static void eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index); +static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev, + struct ether_addr *mc_addr_set, + uint32_t nb_mc_addr); + #define EM_FC_PAUSE_TIME 0x0680 #define EM_LINK_UPDATE_CHECK_TIMEOUT 90 /* 9s */ #define EM_LINK_UPDATE_CHECK_INTERVAL 100 /* ms */ @@ -161,6 +165,7 @@ static const struct eth_dev_ops eth_em_ops = { .flow_ctrl_set = eth_em_flow_ctrl_set, .mac_addr_add = eth_em_rar_set, .mac_addr_remove = eth_em_rar_clear, + .set_mc_addr_list = eth_em_set_mc_addr_list, }; /** @@ -1522,6 +1527,18 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) return 0; } +static int +eth_em_set_mc_addr_list(struct rte_eth_dev *dev, + struct ether_addr *mc_addr_set, + uint32_t nb_mc_addr) +{ + struct e1000_hw *hw; + + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + e1000_update_mc_addr_list(hw, (u8 *)mc_addr_set, nb_mc_addr); + return 0; +} + struct rte_driver em_pmd_drv = { .type = PMD_PDEV, .init = rte_em_pmd_init, diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index e4b370d..1c24edc 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -194,6 +194,10 @@ static int eth_igb_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_op filter_op, void *arg); +static int eth_igb_set_mc_addr_list(struct rte_eth_dev *dev, + struct ether_addr *mc_addr_set, + uint32_t nb_mc_addr); + /* * Define VF Stats MACRO for Non "cleared on read" register */ @@ -269,6 +273,7 @@ static const struct eth_dev_ops eth_igb_ops = { .rss_hash_update = eth_igb_rss_hash_update, .rss_hash_conf_get = eth_igb_rss_hash_conf_get, .filter_ctrl = eth_igb_filter_ctrl, + .set_mc_addr_list = eth_igb_set_mc_addr_list, }; /* @@ -289,6 +294,7 @@ static const struct eth_dev_ops igbvf_eth_dev_ops = { .rx_queue_release = eth_igb_rx_queue_release, .tx_queue_setup = eth_igb_tx_queue_setup, .tx_queue_release = eth_igb_tx_queue_release, + .set_mc_addr_list = eth_igb_set_mc_addr_list, }; /** @@ -3642,6 +3648,18 @@ eth_igb_filter_ctrl(struct rte_eth_dev *dev, return ret; } +static int +eth_igb_set_mc_addr_list(struct rte_eth_dev *dev, + struct ether_addr *mc_addr_set, + uint32_t nb_mc_addr) +{ + struct e1000_hw *hw; + + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + e1000_update_mc_addr_list(hw, (u8 *)mc_addr_set, nb_mc_addr); + return 0; +} + static struct rte_driver pmd_igb_drv = { .type = PMD_PDEV, .init = rte_igb_pmd_init, -- 1.7.10.4