From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 5D789A11E for ; Wed, 2 Aug 2017 16:11:13 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id t201so42847178wmt.0 for ; Wed, 02 Aug 2017 07:11:13 -0700 (PDT) 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 :in-reply-to:references; bh=gHbpTz4t97qq3tZCBeYr0xVdHbT+lJ0MMnjxI47evEU=; b=vZsF+RnVFjnhej31L3HU+tVcTCEZ8ZpgJvOXy7G15i2pG7d5X6yv0HoO1+ugTjdGjN 70K4X3ZwFYIOrTiPVbTOwxTr6JIbvYHOwKIV6rQwJx8aFJZv/JPtgtJ4cUVpPZ8b2FXy U9ad8MzFGzb72TedjfmODcfqKCQ47tuv3J5OhyHGeaoRqEg9n7ajdpWl1N7k2JHuc/QE 2pYs+eP913xCmKmPs/xumZ24Dxxc1X+NM6goJG9CWZuzOdkt44GgfpSD3EPP/5HZqPDt NtRXkYsgiCYjsGudRskBkimlzeTtEuEpd/5o3Gav37n5qBN/iAujSQTwvnnbF0Mr0/rY s+Ww== 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:in-reply-to:references; bh=gHbpTz4t97qq3tZCBeYr0xVdHbT+lJ0MMnjxI47evEU=; b=mOLkzitpyi6oCCpcw/Pajl3Qp1V0M3bxgOZvdmf3tDx9WidPfhSSXWPWWbJbSaTZy4 fCqvOfoxM/JSkvYfrkBXqtuYHLmkKREJ671F/QIv/259pASUtFq/TmYHfsnw53B01B0I JkLxFgPzNN4rLsYa50st3yZ1FCKD6AL2pYlq6CYif9KzG11h/A2Hk45Nbw5mpGuk0QLo EBTJieLvqRyM3ZdkdaydtStXJhWLpZeSoY91wwzydcnZQo82jGtlcd3+R6gZDxR8vytL C5xUEfVv5sAZocdI7UqlVgWjV+3IWqUu9P8gS3hvmjSfzDpX++zxpa4t2n2WVthBfpfw 4K0A== X-Gm-Message-State: AIVw1114ogAcmGRYlChdpudYXx1MXgM+V7Npe50Mh5Vbq8hSXG6w+tns SMRGsInCR9nCNSSXdWJyOQ== X-Received: by 10.28.185.141 with SMTP id j135mr4015345wmf.44.1501683072737; Wed, 02 Aug 2017 07:11:12 -0700 (PDT) Received: from ping.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id d53sm39449552wrd.81.2017.08.02.07.11.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 07:11:12 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: adrien.mazarguil@6wind.com Date: Wed, 2 Aug 2017 16:10:33 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v1 17/21] net/mlx5: use flow to enable all multi mode 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: Wed, 02 Aug 2017 14:11:14 -0000 RSS hash configuration is currently ignored by the PMD, this commits removes the RSS feature on promiscuous mode. This functionality will be added in a later commit. Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_rxmode.c | 52 ++++++++++++++--------------------------- drivers/net/mlx5/mlx5_rxq.c | 9 +++---- drivers/net/mlx5/mlx5_rxtx.h | 3 --- drivers/net/mlx5/mlx5_trigger.c | 2 ++ 5 files changed, 23 insertions(+), 44 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index cbf8849..ba461a3 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -107,7 +107,6 @@ struct priv { /* Device properties. */ uint16_t mtu; /* Configured MTU. */ uint8_t port; /* Physical port number. */ - unsigned int allmulti_req:1; /* All multicast mode requested. */ unsigned int hw_csum:1; /* Checksum offload is supported. */ unsigned int hw_csum_l2tun:1; /* Same for L2 tunnels. */ unsigned int hw_vlan_strip:1; /* VLAN stripping is supported. */ diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c index d6ca907..3fcfec7 100644 --- a/drivers/net/mlx5/mlx5_rxmode.c +++ b/drivers/net/mlx5/mlx5_rxmode.c @@ -53,18 +53,6 @@ /* Initialization data for special flows. */ static const struct special_flow_init special_flow_init[] = { - [HASH_RXQ_FLOW_TYPE_ALLMULTI] = { - .dst_mac_val = "\x01\x00\x00\x00\x00\x00", - .dst_mac_mask = "\x01\x00\x00\x00\x00\x00", - .hash_types = - 1 << HASH_RXQ_UDPV4 | - 1 << HASH_RXQ_IPV4 | - 1 << HASH_RXQ_UDPV6 | - 1 << HASH_RXQ_IPV6 | - 1 << HASH_RXQ_ETH | - 0, - .per_vlan = 0, - }, [HASH_RXQ_FLOW_TYPE_BROADCAST] = { .dst_mac_val = "\xff\xff\xff\xff\xff\xff", .dst_mac_mask = "\xff\xff\xff\xff\xff\xff", @@ -328,7 +316,7 @@ priv_special_flow_enable_all(struct priv *priv) if (priv->isolated) return 0; - for (flow_type = HASH_RXQ_FLOW_TYPE_ALLMULTI; + for (flow_type = HASH_RXQ_FLOW_TYPE_BROADCAST; flow_type != HASH_RXQ_FLOW_TYPE_MAC; ++flow_type) { int ret; @@ -355,7 +343,7 @@ priv_special_flow_disable_all(struct priv *priv) { enum hash_rxq_flow_type flow_type; - for (flow_type = HASH_RXQ_FLOW_TYPE_ALLMULTI; + for (flow_type = HASH_RXQ_FLOW_TYPE_BROADCAST; flow_type != HASH_RXQ_FLOW_TYPE_MAC; ++flow_type) priv_special_flow_disable(priv, flow_type); @@ -412,19 +400,17 @@ mlx5_promiscuous_disable(struct rte_eth_dev *dev) void mlx5_allmulticast_enable(struct rte_eth_dev *dev) { - struct priv *priv = dev->data->dev_private; - int ret; + struct rte_flow_item_eth eth = { + .dst.addr_bytes = "\x01\x00\x00\x00\x00\x00", + .src.addr_bytes = "\x01\x00\x00\x00\x00\x00", + .type = 0, + }; if (mlx5_is_secondary()) return; - - priv_lock(priv); - priv->allmulti_req = 1; - ret = priv_rehash_flows(priv); - if (ret) - ERROR("error while enabling allmulticast mode: %s", - strerror(ret)); - priv_unlock(priv); + dev->data->all_multicast = 1; + if (dev->data->dev_started) + claim_zero(mlx5_flow_ctrl(dev, ð, ð, 3, 1)); } /** @@ -436,17 +422,15 @@ mlx5_allmulticast_enable(struct rte_eth_dev *dev) void mlx5_allmulticast_disable(struct rte_eth_dev *dev) { - struct priv *priv = dev->data->dev_private; - int ret; + struct rte_flow_item_eth eth = { + .dst.addr_bytes = "\x01\x00\x00\x00\x00\x00", + .src.addr_bytes = "\x01\x00\x00\x00\x00\x00", + .type = 0, + }; if (mlx5_is_secondary()) return; - - priv_lock(priv); - priv->allmulti_req = 0; - ret = priv_rehash_flows(priv); - if (ret) - ERROR("error while disabling allmulticast mode: %s", - strerror(ret)); - priv_unlock(priv); + dev->data->all_multicast = 0; + if (dev->data->dev_started) + claim_zero(mlx5_flow_ctrl(dev, ð, ð, 3, 0)); } diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 5f9e84a..e5ec57f 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -573,16 +573,13 @@ priv_destroy_hash_rxqs(struct priv *priv) int priv_allow_flow_type(struct priv *priv, enum hash_rxq_flow_type type) { + (void)priv; switch (type) { - case HASH_RXQ_FLOW_TYPE_ALLMULTI: - return !!priv->allmulti_req; case HASH_RXQ_FLOW_TYPE_BROADCAST: case HASH_RXQ_FLOW_TYPE_IPV6MULTI: - /* If allmulti is enabled, broadcast and ipv6multi - * are unnecessary. */ - return !priv->allmulti_req; case HASH_RXQ_FLOW_TYPE_MAC: return 1; + return 1; default: /* Unsupported flow type is not allowed. */ return 0; @@ -604,7 +601,7 @@ priv_rehash_flows(struct priv *priv) { enum hash_rxq_flow_type i; - for (i = HASH_RXQ_FLOW_TYPE_ALLMULTI; + for (i = HASH_RXQ_FLOW_TYPE_BROADCAST; i != RTE_DIM((*priv->hash_rxqs)[0].special_flow); ++i) if (!priv_allow_flow_type(priv, i)) { diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 166cd5d..4d26726 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -233,7 +233,6 @@ struct special_flow_init { }; enum hash_rxq_flow_type { - HASH_RXQ_FLOW_TYPE_ALLMULTI, HASH_RXQ_FLOW_TYPE_BROADCAST, HASH_RXQ_FLOW_TYPE_IPV6MULTI, HASH_RXQ_FLOW_TYPE_MAC, @@ -244,8 +243,6 @@ static inline const char * hash_rxq_flow_type_str(enum hash_rxq_flow_type flow_type) { switch (flow_type) { - case HASH_RXQ_FLOW_TYPE_ALLMULTI: - return "allmulticast"; case HASH_RXQ_FLOW_TYPE_BROADCAST: return "broadcast"; case HASH_RXQ_FLOW_TYPE_IPV6MULTI: diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index ead8238..6370d6f 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -167,6 +167,8 @@ mlx5_dev_start(struct rte_eth_dev *dev) } if (dev->data->promiscuous) mlx5_promiscuous_enable(dev); + else if (dev->data->all_multicast) + mlx5_allmulticast_enable(dev); err = priv_flow_start(priv, &priv->ctrl_flows); if (err) { ERROR("%p: an error occurred while configuring control flows:" -- 2.1.4