From: Alejandro Lucero Date: Wed, 13 Sep 2017 11:27:01 +0000 (+0100) Subject: net/nfp: configure L2 broadcast and multicast X-Git-Tag: spdx-start~1953 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c05dc84fa276f454a6ef61a743fea935ebd28a6f;p=dpdk.git net/nfp: configure L2 broadcast and multicast This is required in some NFP firmwares when working with VFs. Signed-off-by: Alejandro Lucero --- diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 09854a2feb..b0142090d5 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -488,10 +488,6 @@ nfp_net_configure(struct rte_eth_dev *dev) return -EINVAL; } - /* Supporting VLAN insertion by default */ - if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN) - new_ctrl |= NFP_NET_CFG_CTRL_TXVLAN; - if (rxmode->jumbo_frame) /* this is handled in rte_eth_dev_configure */ @@ -505,6 +501,20 @@ nfp_net_configure(struct rte_eth_dev *dev) return -EINVAL; } + /* If next capabilities are supported, configure them by default */ + + /* VLAN insertion */ + if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN) + new_ctrl |= NFP_NET_CFG_CTRL_TXVLAN; + + /* L2 broadcast */ + if (hw->cap & NFP_NET_CFG_CTRL_L2BC) + new_ctrl |= NFP_NET_CFG_CTRL_L2BC; + + /* L2 multicast */ + if (hw->cap & NFP_NET_CFG_CTRL_L2MC) + new_ctrl |= NFP_NET_CFG_CTRL_L2MC; + if (!new_ctrl) return 0; @@ -2757,8 +2767,10 @@ nfp_net_init(struct rte_eth_dev *eth_dev) PMD_INIT_LOG(INFO, "VER: %#x, Maximum supported MTU: %d", hw->ver, hw->max_mtu); - PMD_INIT_LOG(INFO, "CAP: %#x, %s%s%s%s%s%s%s%s%s", hw->cap, + PMD_INIT_LOG(INFO, "CAP: %#x, %s%s%s%s%s%s%s%s%s%s%s", hw->cap, hw->cap & NFP_NET_CFG_CTRL_PROMISC ? "PROMISC " : "", + hw->cap & NFP_NET_CFG_CTRL_L2BC ? "L2BCFILT " : "", + hw->cap & NFP_NET_CFG_CTRL_L2MC ? "L2MCFILT " : "", hw->cap & NFP_NET_CFG_CTRL_RXCSUM ? "RXCSUM " : "", hw->cap & NFP_NET_CFG_CTRL_TXCSUM ? "TXCSUM " : "", hw->cap & NFP_NET_CFG_CTRL_RXVLAN ? "RXVLAN " : "",