From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by dpdk.org (Postfix) with ESMTP id 284881B226 for ; Mon, 9 Oct 2017 17:01:15 +0200 (CEST) Received: by mail-lf0-f43.google.com with SMTP id 75so291167lfx.1 for ; Mon, 09 Oct 2017 08:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LH5eKuOht7lynPoSD5hg8QX+QB0c8cTHybSZhTrQHu8=; b=XSQRrfr3oKcFAFWhMeo3zK7WU++Um6feiYzajhZHxIetlUAItNzIfcV/ahO2vpiYyi geoVPJWRMzPh8gxx/VFcTNm9Bfk8U8fmGlXF2R3WizzeeHNX7n9YiJRBsBEE/ffWR1zJ ka+ejRqNDddouYto26aYaxUE+W+jH7IvHY9CRlcAY2bMEXI1q9RnyFkr8HzGV16BMAu6 4EylWwuXsBuh37wi/iwel0LdbnpjEfkOJ7QDJrUECuqwIXD7FW1Aw3+3R15MQfc+JPHp B7fWnd83P5e9d3iYLj7i8GTGRiw8kq01SByJAt3zXGtYIT/PEvgNkt+zppw4kSxHJkh0 Itsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LH5eKuOht7lynPoSD5hg8QX+QB0c8cTHybSZhTrQHu8=; b=sdiWO9T+jADBpdVP6YnCDVWztrbE0kuiF72fmHSARFycyHh6xYZO94cH2W/iHJdh4o XdaLCp3dHOvc7NiWrVufunW6mviyrP9OYrb65TXkTxW9CjbQiSq6IRRqrTR8d1bp201B RlM5AMGFWmlkCnnl1rqetVPJSx7onOd7LQ7uxLHp6RbUQxPQwRAhTaN2NoVmdHX75GSj zdjWhFvitOu6bldAmXWLT3V5PjzlxvWf9MzTvvFUztsTbpSAHRfrAyRXGd43SqGs2OTm nIjt1CnACrYH00oUxvU1I35tktRr1fxiob43SBdLdm+H7PcHXZFTk6le3O6Z70zlL46D 04ag== X-Gm-Message-State: AMCzsaW9YBX6+OyxfspUEWycwAn8J9gVjHGqYL2Q2MCd8ZA53qTTDKvN d1I+u6Q05lD5+uF2fJ/VOc+bnRfsEMA= X-Google-Smtp-Source: AOwi7QBMS5bvHsxARldCLyPMd/NAMRCPERq11AinzuuBqxcg3zdw+q/8EFGNU5iL+QLE3c33TG6ZwQ== X-Received: by 10.25.59.208 with SMTP id d77mr3678054lfl.189.1507561274537; Mon, 09 Oct 2017 08:01:14 -0700 (PDT) Received: from tdu.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id z64sm1352637lfa.91.2017.10.09.08.01.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 08:01:13 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: mw@semihalf.com, dima@marvell.com, nsamsono@marvell.com, Jianbo.liu@linaro.org, Tomasz Duszynski , Jacek Siuda Date: Mon, 9 Oct 2017 17:00:36 +0200 Message-Id: <1507561244-20115-9-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507561244-20115-1-git-send-email-tdu@semihalf.com> References: <1507031500-11473-1-git-send-email-tdu@semihalf.com> <1507561244-20115-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v4 08/16] net/mrvl: add support for promiscuous and allmulticast modes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:01:15 -0000 Add support for promiscuous and allmulticast modes. Signed-off-by: Jacek Siuda Signed-off-by: Tomasz Duszynski --- doc/guides/nics/features/mrvl.ini | 2 ++ drivers/net/mrvl/mrvl_ethdev.c | 72 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/doc/guides/nics/features/mrvl.ini b/doc/guides/nics/features/mrvl.ini index 2ddabfb..c2df525 100644 --- a/doc/guides/nics/features/mrvl.ini +++ b/doc/guides/nics/features/mrvl.ini @@ -8,3 +8,5 @@ Speed capabilities = Y Link status = Y MTU update = Y Jumbo frame = Y +Promiscuous mode = Y +Allmulticast mode = Y diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c index 3a5f6a0..519aa19 100644 --- a/drivers/net/mrvl/mrvl_ethdev.c +++ b/drivers/net/mrvl/mrvl_ethdev.c @@ -589,6 +589,74 @@ mrvl_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused) } /** + * DPDK callback to enable promiscuous mode. + * + * @param dev + * Pointer to Ethernet device structure. + */ +static void +mrvl_promiscuous_enable(struct rte_eth_dev *dev) +{ + struct mrvl_priv *priv = dev->data->dev_private; + int ret; + + ret = pp2_ppio_set_uc_promisc(priv->ppio, 1); + if (ret) + RTE_LOG(ERR, PMD, "Failed to enable promiscuous mode\n"); +} + +/** + * DPDK callback to enable allmulti mode. + * + * @param dev + * Pointer to Ethernet device structure. + */ +static void +mrvl_allmulticast_enable(struct rte_eth_dev *dev) +{ + struct mrvl_priv *priv = dev->data->dev_private; + int ret; + + ret = pp2_ppio_set_mc_promisc(priv->ppio, 1); + if (ret) + RTE_LOG(ERR, PMD, "Failed enable all-multicast mode\n"); +} + +/** + * DPDK callback to disable promiscuous mode. + * + * @param dev + * Pointer to Ethernet device structure. + */ +static void +mrvl_promiscuous_disable(struct rte_eth_dev *dev) +{ + struct mrvl_priv *priv = dev->data->dev_private; + int ret; + + ret = pp2_ppio_set_uc_promisc(priv->ppio, 0); + if (ret) + RTE_LOG(ERR, PMD, "Failed to disable promiscuous mode\n"); +} + +/** + * DPDK callback to disable allmulticast mode. + * + * @param dev + * Pointer to Ethernet device structure. + */ +static void +mrvl_allmulticast_disable(struct rte_eth_dev *dev) +{ + struct mrvl_priv *priv = dev->data->dev_private; + int ret; + + ret = pp2_ppio_set_mc_promisc(priv->ppio, 0); + if (ret) + RTE_LOG(ERR, PMD, "Failed to disable all-multicast mode\n"); +} + +/** * DPDK callback to set the primary MAC address. * * @param dev @@ -934,6 +1002,10 @@ static const struct eth_dev_ops mrvl_ops = { .dev_set_link_down = mrvl_dev_set_link_down, .dev_close = mrvl_dev_close, .link_update = mrvl_link_update, + .promiscuous_enable = mrvl_promiscuous_enable, + .allmulticast_enable = mrvl_allmulticast_enable, + .promiscuous_disable = mrvl_promiscuous_disable, + .allmulticast_disable = mrvl_allmulticast_disable, .mac_addr_set = mrvl_mac_addr_set, .mtu_set = mrvl_mtu_set, .dev_infos_get = mrvl_dev_infos_get, -- 2.7.4