From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id BACA51B23A for ; Thu, 5 Oct 2017 14:50:51 +0200 (CEST) Received: by mail-wm0-f48.google.com with SMTP id b189so1911742wmd.4 for ; Thu, 05 Oct 2017 05:50: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=WVL0BmmP7JDWAtaIuCax/Zm6jsE9h+8wyGaRoC6AI6w=; b=lGod7ywk1nWweRHWtP2nyLhuTttixfOUnw8Wft26j51yr9Y2zH3JG14F42H1tvCVOv 6/SdwqYGx6poPRD8rlEDq2kdVt3bd+gtfAj8o4T8foHGX/ndADmQieWeIy6Tnkz0zmMh bZRI/EoldDr9C2ch5lgr1UVZ7k7uRFdv9K9XAKRj5yB5Qjr57z6hI36N46GPH0Qcotfq PpnaJkjWRlyZZDbNv1s1bfK43f/sqDvx+YB8a0Rg0JeKn/RsoEYw2c3KLdYw+SOD6+YX JrUzoXWK7dGpg7ZUHOf/ZB4W3xavqDCWuY3lAzBTYZoreKQXumwtygyGKlO4SJSQ+i7E Uyrg== 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=WVL0BmmP7JDWAtaIuCax/Zm6jsE9h+8wyGaRoC6AI6w=; b=NQyI35tZoz7XCcSMGjRWU75tkr95wi9sF6WVMPsw+8PhHwi2eYoi7uaL4/h7oyiQa5 yaq9dEy0DULAfYQBER7smh80Oy2bPli3Sw0Uh8vJ9s4W3lee+NkdrfK5tKMw/0yme+7J 2K0iKOCsTyxZO0ffJpHKfvOlmCVvyDd3mBx47CGEEWpywuCx2ebzBMRMbAea/8lb72aZ ZtjxaH7AqsqyspH9Stl1XcWXHIYk9QGqYgYx3MJufflv8yoWOjeHsiuocEK2d5FX7OR+ RgO1oALC361R0ev5FoNjBRJi2567bQA+XyCrM2RPk+Ud0Ovrj8PqrFJmqnvs3/2TFIjT GHsQ== X-Gm-Message-State: AMCzsaXYNhPNIpWwVK5/5KIhrkr5IbxEpBfMa/Fv6LGM0QuoDCnK3XCi /OleSkNuxhDwdCX1s39hA9faOza7ZQ== X-Google-Smtp-Source: AOwi7QDvl1b3UvluYRgN0CFmr448zbjRH4GeSLK9RLM9KEE7VP4BCEE96WyvLxqW9bwhep/jeHVWtA== X-Received: by 10.28.62.67 with SMTP id l64mr11603195wma.6.1507207851119; Thu, 05 Oct 2017 05:50:51 -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 k9sm26405823wrk.27.2017.10.05.05.50.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Oct 2017 05:50:50 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: adrien.mazarguil@6wind.com, yskoh@mellanox.com, ferruh.yigit@intel.com Date: Thu, 5 Oct 2017 14:50:02 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 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: Thu, 05 Oct 2017 12:50: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 --- 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 7edc918..3362200 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 46a8cde..c1d4dd5 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