From owner-svn-src-stable@freebsd.org Tue Feb 13 15:05:24 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51F9CF077E5; Tue, 13 Feb 2018 15:05:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 018427CFA3; Tue, 13 Feb 2018 15:05:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0C69225AC; Tue, 13 Feb 2018 15:05:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1DF5NsT019651; Tue, 13 Feb 2018 15:05:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1DF5Nos019649; Tue, 13 Feb 2018 15:05:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802131505.w1DF5Nos019649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Feb 2018 15:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329205 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 329205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 15:05:24 -0000 Author: hselasky Date: Tue Feb 13 15:05:23 2018 New Revision: 329205 URL: https://svnweb.freebsd.org/changeset/base/329205 Log: MFC r325648: Implement support for decoding general port notification event in the mlx5 core module. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Tue Feb 13 14:57:34 2018 (r329204) +++ stable/11/sys/dev/mlx5/device.h Tue Feb 13 15:05:23 2018 (r329205) @@ -526,6 +526,11 @@ struct mlx5_eqe_port_module_event { u8 error_type; }; +struct mlx5_eqe_general_notification_event { + u32 rq_user_index_delay_drop; + u32 rsvd0[6]; +}; + union ev_data { __be32 raw[7]; struct mlx5_eqe_cmd cmd; @@ -539,6 +544,7 @@ union ev_data { struct mlx5_eqe_page_req req_pages; struct mlx5_eqe_port_module_event port_module_event; struct mlx5_eqe_vport_change vport_change; + struct mlx5_eqe_general_notification_event general_notifications; } __packed; struct mlx5_eqe { @@ -1427,6 +1433,10 @@ static inline int mlx5_get_cqe_format(const struct mlx { return (cqe->op_own & MLX5E_CQE_FORMAT_MASK) >> 2; } + +enum { + MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT = 0x1, +}; /* 8 regular priorities + 1 for multicast */ #define MLX5_NUM_BYPASS_FTS 9 Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Tue Feb 13 14:57:34 2018 (r329204) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Tue Feb 13 15:05:23 2018 (r329205) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -80,6 +80,8 @@ struct cre_des_eq { /*Function prototype*/ static void mlx5_port_module_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe); +static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev, + struct mlx5_eqe *eqe); static int mlx5_cmd_destroy_eq(struct mlx5_core_dev *dev, u8 eqn) { @@ -157,6 +159,8 @@ static const char *eqe_type_str(u8 type) return "MLX5_EVENT_TYPE_NIC_VPORT_CHANGE"; case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: return "MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT"; + case MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT: + return "MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT"; default: return "Unrecognized event"; } @@ -296,6 +300,10 @@ static int mlx5_eq_int(struct mlx5_core_dev *dev, stru } break; + case MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT: + mlx5_port_general_notification_event(dev, eqe); + break; + case MLX5_EVENT_TYPE_CQ_ERROR: cqn = be32_to_cpu(eqe->data.cq_err.cqn) & 0xffffff; mlx5_core_warn(dev, "CQ error on CQN 0x%x, syndrom 0x%x\n", @@ -665,5 +673,26 @@ static void mlx5_port_module_event(struct mlx5_core_de /* store module status */ if (module_num < MLX5_MAX_PORTS) dev->module_status[module_num] = module_status; +} + +static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev, + struct mlx5_eqe *eqe) +{ + u8 port = (eqe->data.port.port >> 4) & 0xf; + u32 rqn = 0; + struct mlx5_eqe_general_notification_event *general_event = NULL; + + switch (eqe->sub_type) { + case MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT: + general_event = &eqe->data.general_notifications; + rqn = be32_to_cpu(general_event->rq_user_index_delay_drop) & + 0xffffff; + break; + default: + mlx5_core_warn(dev, + "general event with unrecognized subtype: port %d, sub_type %d\n", + port, eqe->sub_type); + break; + } }