From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by dpdk.org (Postfix) with ESMTP id 2B38A2C8 for ; Tue, 20 Jun 2017 13:37:30 +0200 (CEST) Received: by mail-pf0-f196.google.com with SMTP id s66so22249773pfs.2 for ; Tue, 20 Jun 2017 04:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=72dSKrpEi/KayD00eYbL1HDCCyJ+Laqbb00z6anHr+o=; b=txVxnwk+KV8ZqZlnAHX914m8fcHuan8dGOvsC9OhDwsy2qbKCKCb7RoDJuG/TCNKxE 0pz50C6syWNx2r/zYJtCHGU/ioHtYR+DMQsZR7+ZNy8oY6FcapPJpDJKnmo+boZMVoun IyNn9spLQMLMrOZ2jVXn0Cq5vSxcaqp81kE98IEyGh/rQMj4DXFHK4zuAH7C29UJjYLT iMzEuoGrvQcS4FaLT/62LUWVnPe12E8TCvO0Y6ED/LwzKRGakiMc6R9hyLcHdERmKhkf sEQ4yhxqGDlDRpKiEaC9Ow7UjefHTvQUBQcs4lRr/P/66QUlSlF9cB6+ptaTSegilgOO IyAw== 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=72dSKrpEi/KayD00eYbL1HDCCyJ+Laqbb00z6anHr+o=; b=aLKkcVK9Pn+ZNyqOrVZVPGO9sGJHdd/u16Ep56apou7AQgLYNCt3kugV0fEzf+jMjE 78wM1azJFmdzAroYjCcC0uC9Yj3yFVpAtNPxBQZKh2lkS4pnyP+NxMdvz4sScPYMdcmt Bh1MoFDaNPmDoOvZGccvPiliQulPzaW50pahPHfHRvOyPO/IunJTK3wjhSW3lrzh+Tah iiGXqx2fPENGJR7/reOvGE+tMlT7dqcKrXhEUcYiiBYScKdNI/I0hOimtM44Vl/v7txy Qs9oZXZt71P1Gi2CoZmVkI/ca+78igFYZ1bJxhtWx9Ox8QN3yMwDwoKK1ayrzG/ZvGiF LY6Q== X-Gm-Message-State: AKS2vOzi1rUa+VKZpn2DxPr0UBWCPlALncG83o2FQaQBUTLCstHqQjoK xLHg9BSvpYWKSupY X-Received: by 10.99.112.14 with SMTP id l14mr30775042pgc.199.1497958649428; Tue, 20 Jun 2017 04:37:29 -0700 (PDT) Received: from yliu-home.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 25sm6104783pfj.59.2017.06.20.04.37.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:37:28 -0700 (PDT) From: Yuanhan Liu To: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= Cc: Yongseok Koh , Adrien Mazarguil , dpdk stable Date: Tue, 20 Jun 2017 19:35:32 +0800 Message-Id: <1497958550-13600-20-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> References: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/mlx5: fix flow application order on stop/start' has been queued to stable release 17.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 11:37:30 -0000 Hi, FYI, your patch has been queued to stable release 17.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/22/17. So please shout if anyone has objections. Thanks. --yliu --- >>From ca044e10452840918955bad4dabaa43a488f5258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= Date: Mon, 29 May 2017 11:40:58 +0200 Subject: [PATCH] net/mlx5: fix flow application order on stop/start [ upstream commit c8ffb8a9cc933401ccef5476d0dc1e78a0f6cafc ] Flow rules must be applied in the same order as they have been created and thus destroyed in the reverse order. Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions") Signed-off-by: Nelio Laranjeiro Acked-by: Yongseok Koh Acked-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5.c | 1 + drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_flow.c | 27 +++++++++++---------------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index fc99c0d..bcb2c1b 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -789,6 +789,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) eth_dev->device->driver = &mlx5_driver.driver; priv->dev = eth_dev; eth_dev->dev_ops = &mlx5_dev_ops; + TAILQ_INIT(&priv->flows); /* Bring Ethernet device up. */ DEBUG("forcing Ethernet interface up"); diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 67fd742..1148dee 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -155,7 +155,7 @@ struct priv { struct fdir_filter_list *fdir_filter_list; /* Flow director rules. */ struct fdir_queue *fdir_drop_queue; /* Flow director drop queue. */ struct rte_flow_drop *flow_drop_queue; /* Flow drop queue. */ - LIST_HEAD(mlx5_flows, rte_flow) flows; /* RTE Flow rules. */ + TAILQ_HEAD(mlx5_flows, rte_flow) flows; /* RTE Flow rules. */ uint32_t link_speed_capa; /* Link speed capabilities. */ struct mlx5_xstats_ctrl xstats_ctrl; /* Extended stats control. */ rte_spinlock_t lock; /* Lock for control functions. */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index adcbe3f..8b3957b 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -91,7 +91,7 @@ mlx5_flow_create_vxlan(const struct rte_flow_item *item, void *data); struct rte_flow { - LIST_ENTRY(rte_flow) next; /**< Pointer to the next flow structure. */ + TAILQ_ENTRY(rte_flow) next; /**< Pointer to the next flow structure. */ struct ibv_exp_flow_attr *ibv_attr; /**< Pointer to Verbs attributes. */ struct ibv_exp_rwq_ind_table *ind_table; /**< Indirection table. */ struct ibv_qp *qp; /**< Verbs queue pair. */ @@ -1230,7 +1230,7 @@ mlx5_flow_create(struct rte_eth_dev *dev, priv_lock(priv); flow = priv_flow_create(priv, attr, items, actions, error); if (flow) { - LIST_INSERT_HEAD(&priv->flows, flow, next); + TAILQ_INSERT_TAIL(&priv->flows, flow, next); DEBUG("Flow created %p", (void *)flow); } priv_unlock(priv); @@ -1249,8 +1249,7 @@ static void priv_flow_destroy(struct priv *priv, struct rte_flow *flow) { - (void)priv; - LIST_REMOVE(flow, next); + TAILQ_REMOVE(&priv->flows, flow, next); if (flow->ibv_flow) claim_zero(ibv_exp_destroy_flow(flow->ibv_flow)); if (flow->drop) @@ -1275,9 +1274,9 @@ priv_flow_destroy(struct priv *priv, */ for (queue_n = 0; queue_n < flow->rxqs_n; ++queue_n) { rxq = flow->rxqs[queue_n]; - for (tmp = LIST_FIRST(&priv->flows); + for (tmp = TAILQ_FIRST(&priv->flows); tmp; - tmp = LIST_NEXT(tmp, next)) { + tmp = TAILQ_NEXT(tmp, next)) { uint32_t tqueue_n; if (tmp->drop) @@ -1330,10 +1329,10 @@ mlx5_flow_destroy(struct rte_eth_dev *dev, static void priv_flow_flush(struct priv *priv) { - while (!LIST_EMPTY(&priv->flows)) { + while (!TAILQ_EMPTY(&priv->flows)) { struct rte_flow *flow; - flow = LIST_FIRST(&priv->flows); + flow = TAILQ_FIRST(&priv->flows); priv_flow_destroy(priv, flow); } } @@ -1494,9 +1493,7 @@ priv_flow_stop(struct priv *priv) { struct rte_flow *flow; - for (flow = LIST_FIRST(&priv->flows); - flow; - flow = LIST_NEXT(flow, next)) { + TAILQ_FOREACH_REVERSE(flow, &priv->flows, mlx5_flows, next) { claim_zero(ibv_exp_destroy_flow(flow->ibv_flow)); flow->ibv_flow = NULL; if (flow->mark) { @@ -1528,9 +1525,7 @@ priv_flow_start(struct priv *priv) ret = priv_flow_create_drop_queue(priv); if (ret) return -1; - for (flow = LIST_FIRST(&priv->flows); - flow; - flow = LIST_NEXT(flow, next)) { + TAILQ_FOREACH(flow, &priv->flows, next) { struct ibv_qp *qp; if (flow->drop) @@ -1570,9 +1565,9 @@ priv_flow_rxq_in_use(struct priv *priv, struct rxq *rxq) { struct rte_flow *flow; - for (flow = LIST_FIRST(&priv->flows); + for (flow = TAILQ_FIRST(&priv->flows); flow; - flow = LIST_NEXT(flow, next)) { + flow = TAILQ_NEXT(flow, next)) { unsigned int n; if (flow->drop) -- 2.7.4