From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 6740F1B253 for ; Mon, 9 Oct 2017 16:45:51 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id u138so23203881wmu.5 for ; Mon, 09 Oct 2017 07:45:51 -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=bR2YYTOXCnFN014meJMqZ3SeMBLp8cYFWUbyPgTnfds=; b=dmvs9XK9ZBRrjIRQ/wtsX+CxRZyWX6cCUGzkR7xWdVNflHOqSHyCV8MaU774lVYUCL 7rhVHIbwBkeXxqsR3i9YSNHml7rtvWtnbKswnpFOaYcuQDbE0s/DvHsi3yDsy5Vpj0T4 UVjZ8aEeL3t5ZVCaIbbAm7v1I/P+/eXoLmdVfkrVS7hJ5yjH4tlC0n0cE90GT3uj0ot6 IRR5CoRYe7artuS3UHaLqzGwdzmwWzS1+9B7mJq8os8GtdqJch6fIClHuQBTXj9FJ+jj gJnNyTVngW16cemLP4u1y85WZmakASovIXXDxETfudgnMpGrWg61sGeC+Ds3bYleInzl EJ6A== 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=bR2YYTOXCnFN014meJMqZ3SeMBLp8cYFWUbyPgTnfds=; b=XJ+EfI7q0de5HpnDZyopM8FxfYmXD8dSQ86og0tDxtG5l5GJeyZtFeYZaF48lhXvBY +7t0Rt+DF1p4IeRpwQ7M2kIm63O4FzHZuGyYlKJppvX8IypAy1Ga2hWMdaCxE3NxttcS h8FwBl1MfQCZjRQggwgXS8RhE4T8XUOLwn4uBwEkahHQN+E8Yk1Gkg1XmX1Pj+vus39n CqW3X+S4v+zQxOYoAQp4jTUIT2cthizxcVDsbcmcaQ5zE3KXCdohz1bv2dFFjQqLPPi9 3CCmDc6oaewggHvOkBU4ANpg5IBWxNYhfWSB8c54m9G3nTDnD7bkLujEaiJS4W07lGem 42Wg== X-Gm-Message-State: AMCzsaWOOq+EUCHwwkEl6jTz7Y/tRkxvLuervU99Yd3VU2JA9xJiKux3 aVBRjoCRxCEpx8uUEILhvZmDKeWM6g== X-Google-Smtp-Source: AOwi7QDmBGIHiH0sSTJKyEUhsZA4tN+7Xf8SpcsQxjzU2gjXfjFFeNcsAWiXDVUXOdvh6Wi92wRPtA== X-Received: by 10.28.222.70 with SMTP id v67mr5076361wmg.99.1507560349915; Mon, 09 Oct 2017 07:45:49 -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 x15sm6791495wma.32.2017.10.09.07.45.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 07:45:49 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: adrien.mazarguil@6wind.com, yskoh@mellanox.com, ferruh.yigit@intel.com Date: Mon, 9 Oct 2017 16:45:06 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 30/30] net/mlx5: add new operations for isolated 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: Mon, 09 Oct 2017 14:45:51 -0000 Isolated works exclusively with the generic flow API, this patch adds a new set of operations valid in this mode. - promiscuous*() - allmulticast*() - reta*() - rss*() are not supported in this mode as it is fully supported by generic flow API. Signed-off-by: Nelio Laranjeiro Acked-by: Yongseok Koh --- drivers/net/mlx5/mlx5.c | 39 +++++++++++++++++++++++++++++++++++++-- drivers/net/mlx5/mlx5_flow.c | 8 ++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index b206535..b2087c0 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -257,7 +257,7 @@ mlx5_dev_close(struct rte_eth_dev *dev) memset(priv, 0, sizeof(*priv)); } -static const struct eth_dev_ops mlx5_dev_ops = { +const struct eth_dev_ops mlx5_dev_ops = { .dev_configure = mlx5_dev_configure, .dev_start = mlx5_dev_start, .dev_stop = mlx5_dev_stop, @@ -300,7 +300,6 @@ static const struct eth_dev_ops mlx5_dev_ops = { .rx_queue_intr_disable = mlx5_rx_intr_disable, }; - static const struct eth_dev_ops mlx5_dev_sec_ops = { .stats_get = mlx5_stats_get, .stats_reset = mlx5_stats_reset, @@ -312,6 +311,42 @@ static const struct eth_dev_ops mlx5_dev_sec_ops = { .tx_descriptor_status = mlx5_tx_descriptor_status, }; +/* Available operators in flow isolated mode. */ +const struct eth_dev_ops mlx5_dev_ops_isolate = { + .dev_configure = mlx5_dev_configure, + .dev_start = mlx5_dev_start, + .dev_stop = mlx5_dev_stop, + .dev_set_link_down = mlx5_set_link_down, + .dev_set_link_up = mlx5_set_link_up, + .dev_close = mlx5_dev_close, + .link_update = mlx5_link_update, + .stats_get = mlx5_stats_get, + .stats_reset = mlx5_stats_reset, + .xstats_get = mlx5_xstats_get, + .xstats_reset = mlx5_xstats_reset, + .xstats_get_names = mlx5_xstats_get_names, + .dev_infos_get = mlx5_dev_infos_get, + .dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get, + .vlan_filter_set = mlx5_vlan_filter_set, + .rx_queue_setup = mlx5_rx_queue_setup, + .tx_queue_setup = mlx5_tx_queue_setup, + .rx_queue_release = mlx5_rx_queue_release, + .tx_queue_release = mlx5_tx_queue_release, + .flow_ctrl_get = mlx5_dev_get_flow_ctrl, + .flow_ctrl_set = mlx5_dev_set_flow_ctrl, + .mac_addr_remove = mlx5_mac_addr_remove, + .mac_addr_add = mlx5_mac_addr_add, + .mac_addr_set = mlx5_mac_addr_set, + .mtu_set = mlx5_dev_set_mtu, + .vlan_strip_queue_set = mlx5_vlan_strip_queue_set, + .vlan_offload_set = mlx5_vlan_offload_set, + .filter_ctrl = mlx5_dev_filter_ctrl, + .rx_descriptor_status = mlx5_rx_descriptor_status, + .tx_descriptor_status = mlx5_tx_descriptor_status, + .rx_queue_intr_enable = mlx5_rx_intr_enable, + .rx_queue_intr_disable = mlx5_rx_intr_disable, +}; + static struct { struct rte_pci_addr pci_addr; /* associated PCI address */ uint32_t ports; /* physical ports bitfield. */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 36c060e..3321b3e 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -59,6 +59,10 @@ #define MLX5_IPV4 4 #define MLX5_IPV6 6 +/* Dev ops structure defined in mlx5.c */ +extern const struct eth_dev_ops mlx5_dev_ops; +extern const struct eth_dev_ops mlx5_dev_ops_isolate; + static int mlx5_flow_create_eth(const struct rte_flow_item *item, const void *default_mask, @@ -2359,6 +2363,10 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, return -rte_errno; } priv->isolated = !!enable; + if (enable) + priv->dev->dev_ops = &mlx5_dev_ops_isolate; + else + priv->dev->dev_ops = &mlx5_dev_ops; priv_unlock(priv); return 0; } -- 2.1.4