From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0089.outbound.protection.outlook.com [104.47.36.89]) by dpdk.org (Postfix) with ESMTP id ADA0C1B234 for ; Sun, 8 Oct 2017 14:46:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=n0mXAZ834e+dIT9yridbnkFGU4CVY7Ll2yfHH9im6l8=; b=nXihluvod+amLYsrkECC5vE+Gdcm/jsfPBmzwHZzQi1YZLX8lXCedPTK6GLGOzDa7l3R5PFpEbDX7DJfWTBfiRRSJGpo/jhw1xPBIgeiqAaH/EM6rekUFyujAxiXnbcm/boZfzxYgXD8cbeqEErMOkxNm9tfNgL/a7w4GwWpk5k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (14.140.2.178) by BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sun, 8 Oct 2017 12:45:59 +0000 From: Santosh Shukla To: dev@dpdk.org Cc: ferruh.yigit@intel.com, jerin.jacob@caviumnetworks.com, Santosh Shukla Date: Sun, 8 Oct 2017 18:14:20 +0530 Message-Id: <20171008124430.1866-17-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171008124430.1866-1-santosh.shukla@caviumnetworks.com> References: <20170831145436.5397-1-jerin.jacob@caviumnetworks.com> <20171008124430.1866-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MA1PR01CA0113.INDPRD01.PROD.OUTLOOK.COM (10.174.56.157) To BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e235c33f-ef9a-46d8-42dd-08d50e4a8821 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR07MB3089; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 3:0pkgMd0ycIyZW6xs0e+5QXAFOicru0ZdGsHLHJw39GFQyj7+ZONqD73+coYK2uW5ROpywDJUcM5b2e/eIVfhh/KU9nq/R/TVd5ze/adW3Ki9fHbaPALmDikIdMiN410bAEnOj8DBEbsLWbXfaj6e3aMD5pva/IoPVyOTGxGBDp+ut6IVkzsDSULPCT9d1QgLjjHRSGv2IS96adShJQc9m1ho9JMSaZI7Iy42vpem+MEU8hzeI9ug/CLVjEVKltSI; 25:PtokLKubNqpm0aBzCD3RXecmH14M4WjwxhSG/xscgo2ynNb+mcJS8XvV/w3Rx77UKcLoGsASt6HyV6mlCJYttsXJKo/YpvVf+GLQa81XYHWAeE7FfSc4xQkt0YBAVleNt/qPrk1Yy95VuS63lc4o4c3ZPPB3K1S0/qtIk2x0DlxQNc6kl7f3JlAcaCREhq67CT3x8ytAk3riJyTb9OJnxeiTgFV7+3uwZlRpKRWLiJOy+sI4QhTX6S+ElWsJlMSrmjUUi+Rg7O/9wA2n2ix6lGRY5DsH9J7Ij/BCcGYRLSkQ6lGfpSNZ2rVLXZghkuWQr4aGG5VIhtJeIx/0YKCTdA==; 31:q6LrlbMTQDlsp8CfEq9u5wPYfO+8oY8GiVDozl+fqrZTWDkZaJqS0vJdOzD0o4qr5yv3nn+Z3VrFSMv7Y7tOGIv5+WQYJEtRZd1g+9ppNA+f3eWQIC0ygXkQZvqFh3sSU9HWEf17viYDcxYS4oaUFYejbRRtVcmlFOnP8yZXkCwmjrAxSfesRO2xJt+ksH+KE5SMHPeGpe5T8A4u7lETyitGvBRvW8D9ZKkuTwOf0qk= X-MS-TrafficTypeDiagnostic: BN6PR07MB3089: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 20:n8LVf3sYdyszMEg5OvuZZgrSa86PwnOPBEjkjpt0mzXjvU6yDAvDNgtjpbUmEbeIuWH7/5iK0qwGwSBuZH6PdnfDlBhB9dtyCJCnm7LB8ZymsDQ7g7IAEti5eok0gs0NtK5+SI5FnOiPyAN0sID2dv4AFqvSnNsbgMTiuq9PUcpLWSTEJWmGkLgP84daMLXy6PJU0FYuzAT3XfMCo2O76d43QUOM3cMzfOAnlb6aXUmXPI7uxwiBAMT50N1qMhEkgE6B0rIUxSSC/xQzQ6s9QlIJsxSFLVwGAVsUHrGx6zk8V3Mpx3RCuFxSV7NK8ie/CkP416wMjVTQf/c1ejw38nSHRriRyx+gwOtuyuNrN5jFqi//Y+McquyDGbeNPtnV/O/4MUcPlGwh8U41wBoKr9vGbu7WcHE5BBu7q4QNv83huI+Dh62RIu+CBWELrBnVyqStrPyooLj8GUdhOqFwdL4mP3lxEXnlEnL8t1OYoNkIvPO+tbkttRkeuytO0EULg6eErDbOLfi/ZVmtt3qObz0MQYTsiQpDefZLElP6URhm+uK7xRAoQ5CqEwp6TGq4VJb6RHIJ4mDuJzGrD0JiB2I6McgEOx6iCmUkz5xoGqg=; 4:/6p3rJNupEMu6aoFCHTiBPDL84UUnhWszskVZ5mb/2JvmucorhSn17PSqGMAg0MNWPvkbBjNNeV5sbKE5yA3YNAz4zWErO76MFIQNqMh9Gsmlfmxkik7KanMyHmMLB4UxsBGG3A66noMOBMRFmbs42nM/4jcX4wKdXNaAZDkIT/bbFD6O31C+nsXRIgqkd2IQFKYhEdkmzzxkybEqZhAU0Ym6UU1tbwEEAm/0U5hkqu+ZD42K2D6I89fDEzRYsay X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(100000703101)(100105400095)(6041248)(20161123562025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3089; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3089; X-Forefront-PRVS: 0454444834 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(376002)(346002)(199003)(189002)(6916009)(42882006)(81166006)(2950100002)(81156014)(8936002)(50226002)(6486002)(16526018)(6666003)(189998001)(16586007)(316002)(6116002)(1076002)(6506006)(3846002)(7736002)(305945005)(8676002)(106356001)(105586002)(5009440100003)(53936002)(4326008)(66066001)(107886003)(47776003)(2906002)(5660300001)(6512007)(76176999)(5003940100001)(50986999)(97736004)(25786009)(101416001)(68736007)(48376002)(50466002)(478600001)(72206003)(2351001)(2361001)(33646002)(36756003)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3089; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB3089; 23:c2yHraPdFcIL+4n39wbArjNoXA43738dFDyoJ4x7r?= =?us-ascii?Q?BoiMBDc8QHiF0I8V4AFohxY8bthBA2ZSaYFIuvU8SGgRByGvqW2z9hHGkaMw?= =?us-ascii?Q?sE72lIixhq1UV10xPUf1y5uMmK+yvIbmnl/M97AKNrvWC4MwOSlKF8G9FAL3?= =?us-ascii?Q?W8scpACfDfHCVMGkV9cBa2LmWFOfkn6Cc1BJVsxvqyADE8isYyd2iqUMEBhl?= =?us-ascii?Q?hmuUg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:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2017 12:45:59.8607 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3089 Subject: [dpdk-dev] [PATCH v2 16/26] net/octeontx: add promiscuous mode ops 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: Sun, 08 Oct 2017 12:46:03 -0000 From: Jerin Jacob Mark Promiscuous mode in features. Signed-off-by: Jerin Jacob Co-authored-by: Santosh Shukla Signed-off-by: Santosh Shukla --- doc/guides/nics/features/octeontx.ini | 1 + drivers/net/octeontx/octeontx_ethdev.c | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/doc/guides/nics/features/octeontx.ini b/doc/guides/nics/features/octeontx.ini index 56b135060..ed5de9a74 100644 --- a/doc/guides/nics/features/octeontx.ini +++ b/doc/guides/nics/features/octeontx.ini @@ -8,6 +8,7 @@ Speed capabilities = Y Link status = Y Lock-free Tx queue = Y Jumbo frame = Y +Promiscuous mode = Y CRC offload = Y Linux VFIO = Y ARMv8 = Y diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 9c6e7ec83..1e572b174 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -160,6 +160,28 @@ octeontx_port_close(struct octeontx_nic *nic) octeontx_log_dbg("port closed %d", nic->port_id); } +static void +octeontx_port_promisc_set(struct octeontx_nic *nic, int en) +{ + struct rte_eth_dev *dev; + int res; + + res = 0; + PMD_INIT_FUNC_TRACE(); + dev = nic->dev; + + res = octeontx_bgx_port_promisc_set(nic->port_id, en); + if (res < 0) + octeontx_log_err("failed to set promiscuous mode %d", + nic->port_id); + + /* Set proper flag for the mode */ + dev->data->promiscuous = (en != 0) ? 1 : 0; + + octeontx_log_dbg("port %d : promiscuous mode %s", + nic->port_id, en ? "set" : "unset"); +} + static inline void devconf_set_default_sane_values(struct rte_event_dev_config *dev_conf, struct rte_event_dev_info *info) @@ -273,6 +295,24 @@ octeontx_dev_configure(struct rte_eth_dev *dev) return 0; } +static void +octeontx_dev_promisc_enable(struct rte_eth_dev *dev) +{ + struct octeontx_nic *nic = octeontx_pmd_priv(dev); + + PMD_INIT_FUNC_TRACE(); + octeontx_port_promisc_set(nic, 1); +} + +static void +octeontx_dev_promisc_disable(struct rte_eth_dev *dev) +{ + struct octeontx_nic *nic = octeontx_pmd_priv(dev); + + PMD_INIT_FUNC_TRACE(); + octeontx_port_promisc_set(nic, 0); +} + static inline int octeontx_atomic_write_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link) @@ -401,6 +441,8 @@ octeontx_dev_info(struct rte_eth_dev *dev, static const struct eth_dev_ops octeontx_dev_ops = { .dev_configure = octeontx_dev_configure, .dev_infos_get = octeontx_dev_info, + .promiscuous_enable = octeontx_dev_promisc_enable, + .promiscuous_disable = octeontx_dev_promisc_disable, .link_update = octeontx_dev_link_update, }; -- 2.14.1