From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by dpdk.org (Postfix) with ESMTP id 0289D9238 for ; Mon, 5 Oct 2015 19:55:30 +0200 (CEST) Received: by wicgb1 with SMTP id gb1so130861780wic.1 for ; Mon, 05 Oct 2015 10:55:30 -0700 (PDT) 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=NKliCOAryyrdc3noCJL/6qdNewZ/HKVAiZ97wO93h/4=; b=ELncy5XD/yPb0RhFRqXEAgcmLTNZmvjUMrTasFukOgrfHEsim8JhrWuo1dyZGR0g94 MHmgyeFUHQvKYBep3RYvfO2d+SfZSQROWmg2rb1ctB4y/D/6O7xDY8EZeMTJ/tqk5sSH KcSHGMYU3H5oifgzQueS3kjKsywp6o6BWgyLJIi194NGVaK/RKscrsK9gvEmLM+rnSR2 P03rlM8HM2822lD8JMxDEmJVWP9fQx0DpJRVZv4W8XJUzOd56jhZtQjCqC7qm5YWchIc CfYGSSAWEu/DV9rzUn+tkPsX7Fjdq2KWBxZR0SoRh6CvYU1iBQCqKk5FSE8cMm8ExOBD zvaQ== X-Gm-Message-State: ALoCoQmLeUVIas3tTxeQv7PwzRpyBWgSi3jvC6CPB5gfqyAgc3vKRRq1k8zxy+jZiIRVosAVGXkG X-Received: by 10.195.11.40 with SMTP id ef8mr31666594wjd.103.1444067730798; Mon, 05 Oct 2015 10:55:30 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id gc8sm15843768wib.2.2015.10.05.10.55.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 05 Oct 2015 10:55:30 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 5 Oct 2015 19:54:43 +0200 Message-Id: <1444067692-29645-9-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444067692-29645-1-git-send-email-adrien.mazarguil@6wind.com> References: <1444067692-29645-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 08/17] mlx5: use alternate method to configure promiscuous mode 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: Mon, 05 Oct 2015 17:55:31 -0000 From: Olga Shern Promiscuous mode was historically enabled by adding a specific flow with type IBV_FLOW_ATTR_ALL_DEFAULT to each hash RX queue, but this method is deprecated. It is now simply enabled by omitting destination MAC addresses from basic flow specifications. Signed-off-by: Olga Shern Signed-off-by: Adrien Mazarguil Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxmode.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c index 7fe7f0e..aab38ee 100644 --- a/drivers/net/mlx5/mlx5_rxmode.c +++ b/drivers/net/mlx5/mlx5_rxmode.c @@ -74,20 +74,21 @@ static int hash_rxq_promiscuous_enable(struct hash_rxq *hash_rxq) { struct ibv_flow *flow; - struct ibv_flow_attr attr = { - .type = IBV_FLOW_ATTR_ALL_DEFAULT, - .num_of_specs = 0, - .port = hash_rxq->priv->port, - .flags = 0 - }; + struct priv *priv = hash_rxq->priv; + FLOW_ATTR_SPEC_ETH(data, priv_populate_flow_attr(priv, NULL, 0, + hash_rxq->type)); + struct ibv_flow_attr *attr = &data->attr; if (hash_rxq->priv->vf) return 0; DEBUG("%p: enabling promiscuous mode", (void *)hash_rxq); if (hash_rxq->promisc_flow != NULL) return EBUSY; + /* Promiscuous flows only differ from normal flows by not filtering + * on specific MAC addresses. */ + priv_populate_flow_attr(priv, attr, sizeof(data), hash_rxq->type); errno = 0; - flow = ibv_create_flow(hash_rxq->qp, &attr); + flow = ibv_create_flow(hash_rxq->qp, attr); if (flow == NULL) { /* It's not clear whether errno is always set in this case. */ ERROR("%p: flow configuration failed, errno=%d: %s", -- 2.1.0