From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0081.outbound.protection.outlook.com [104.47.36.81]) by dpdk.org (Postfix) with ESMTP id 342B67D7E for ; Thu, 31 Aug 2017 16:56:00 +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=mbSq87LfR1TXkIBiA7TuJ4sS26/OrqhxeaedM+FpBhI=; b=Bk2ky9MHs6pklvpKULlsvoZg/GH8NwDOQMd40zZyECRQMQyAKduPiRaDjGxwknCLWQOpIeE5WdPSGpsTLAJ6G54ZUK9ZI1HwzvYuQBHdglUucSmdyqA1nBr4DpAhFfg9HNyRELINP+IThfa2LqBtsmTK0qLbXLmCrqbIQ61rwvU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.domain.name (171.76.126.71) by SN2PR07MB2526.namprd07.prod.outlook.com (2603:10b6:804:6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Thu, 31 Aug 2017 14:55:57 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: ferruh.yigit@intel.com, santosh.shukla@caviumnetworks.com, Jerin Jacob Date: Thu, 31 Aug 2017 20:24:26 +0530 Message-Id: <20170831145436.5397-17-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170831145436.5397-1-jerin.jacob@caviumnetworks.com> References: <20170831145436.5397-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.76.126.71] X-ClientProxiedBy: MA1PR01CA0109.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::25) To SN2PR07MB2526.namprd07.prod.outlook.com (2603:10b6:804:6::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db238019-e5db-48e4-2c2b-08d4f080646a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN2PR07MB2526; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 3:W6pwiDiJFaBHvDiyxCkCHTg/+zMC7/CQF+tVUaQIJz3KnODdKdH/UK1o58ztFHQksLvh/9VrDT8QlT1lxDO7+30hwRobXwBHoO5C7gokrrowU29PRPunFEK/zD/P3TFtI4AI5MkPlAomEZ8RQpYwlxM70N1CLD87ZVl4ddyNhPbWYhOXoi0CCN/FlceJ34K8A/OiqJ7jXgNaiOvHd29KCQXiJTOD2ZBDni/w4zRffVXoRZUwM3IT+dPxQSWc/+fO; 25:m6g5rDEoQL8dKLg9GvwBQS2k/ejPJSGuoUyVWx3ZNJOOF/O9SH9hgR0O/e1gvQs7fYTxtHKs/mSNCwt48MNb1GEMM8eUxwHSIDURhuJ3FX1yb2YaIHBGEJfOsKrK3yeE1klb5zaSkwYO3jtccOJxX3YglubCrSD9zQEMrPliSRBc1RAaDeKFD57T/C9Y5EFkRGAOLUhmJSOvT07QW1u2m31khoxEmN7fVqvvNDojGJr3idtoRZVfQ1lMGQUeRmd7hmgojCb8hGSWsShn+QNe4Hk10Z4jeUhlFiofAbtt/JA3ARqC/4UTcxfFhJudOQ6khazHIUdgBeRxd5a1yDx8hQ==; 31:AuH1IVfBz+Lu7vJQ72pYvy6DDgzbAsZCcLvANRszAOjLPYBiYdN56EyAEzO8iKW5FQjkXo2PcnSXqkeSvniWKgZp8d8Hzy9J3FL/3LjY9Y31WqSoEut8YKVTB4owFkXdBcrtYSHledcePukqiL/uAr+gS0jQvVtu1E0a8AdZ5Mr2KUlli+mxY9VNPWUcldcip58BNJWv04bV7S0kDokjPb11kyAeCyJDpKin1DCSVCY= X-MS-TrafficTypeDiagnostic: SN2PR07MB2526: X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 20:FsluzudxXibkSnou4SffHu9Ua0eZWQGDsjB71ad2unoAcOJh1oVd2kdqLpN4wbz2D91YtCTd6boyKaqEXNOsUrwyrL6B5QZgeUDL8HjOvtpMdMAd5/q1lWuCUncCgJqQeYa8Pu1GEB24JCIbZElUzy2BnrUjHunlrJaoAm8TMRJThmxOddydfYdPkaTm6IcN+Le/tKieXGKhFvE0A3Z9Q+z30m1aNu9D2Izw2PBX5Hs69Y0k9J564VryIM8Y3AURht58ArxUQw0pCu3YXO03UgzM16xQpqKPOKv0k6IYsYH4lkPGCbFv7gYw6iflQyZSL7h7Yrh9aXghW1du7kuk789t7P98NXg30uELJPIBsALsQWDuJc8kN3koGzwUm+CMVKQWrpPv9zZam0dsQipVV7aYluUjpkYSY1kNb0KZn1g/+WCz/aAwcJGNPQHZ/yIHSeLSJOeVcpoiwpVG67AZ1Q0N7XtEyfMO/GT/9U6FllJgHOcXi3mRP84hzylYbNXzjmqnW4TCZ7+1c1A0yivxFU+3TXS79PBGVuDb5LTzgWCm2G0jnJ+kYEzxvggt94QXWIHAUUpCb5+Wfa/L0/YWNT9wSEFsoJliglIfud5lhqE=; 4:mO4jDQqVrMmgd6ANuPntpGdTZsLLLqNxCgivIrL/AU+R1/26Llrhm2vBNTF0oTsBGf4lTVcc65xLne2MlWzUuvqvkq1H+8nvQH7MQI+VAoj7Dwvgx80FZ5IO2a9rOxB3ywuC/UNyN3bsOBP6jA4NgVsBEUhB7vEJ54SGN22YqFA08+TlfT0tNEsEUOX1Ea+FmiwBXgCncksLGxVWcpZW07rqD6RDCikmm2v2xxs5G1mVVCI5ZQylYxrCCoq/l0xQ 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)(601004)(2401047)(5005006)(8121501046)(93006095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR07MB2526; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR07MB2526; X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(25786009)(1076002)(53936002)(3846002)(6116002)(478600001)(110136004)(72206003)(7736002)(6666003)(107886003)(6512007)(305945005)(6506006)(36756003)(6486002)(68736007)(5003940100001)(189998001)(50986999)(42882006)(106356001)(101416001)(76176999)(2950100002)(6916009)(5660300001)(2361001)(33646002)(2351001)(2906002)(4326008)(97736004)(105586002)(48376002)(50466002)(81166006)(66066001)(69596002)(8936002)(47776003)(53416004)(8676002)(50226002)(81156014)(42186005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB2526; H:jerin.domain.name; 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; SN2PR07MB2526; 23:qgoiQybIgyz0/wD0fTe1Uqonu7F0gLfpaqHQz4bFT?= =?us-ascii?Q?RMFp8vJ8MOxcH5QvERzfNzyUYq+Qlz//0COhXLIy9FBAnYOySnsGEi7dYbdv?= =?us-ascii?Q?Gn3jhdLPJ7Zmu8HPUlW0H41mUFDam4oz/cjQa3DLSkBlziw6nmcCo0cKGXdc?= =?us-ascii?Q?/BGytqMut4fl/WVDwet4cmy4GEt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oi+yEfGXviwez+8DDy81dasbPdTN/kXph7un0aMZo+kFvtdw4cx+ScBUduce?= =?us-ascii?Q?tV42vf+Lh/ogCOQza9dkKBagIB/8w9RNUGy5Z9uCSgm+szzqD/Rnw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 6:XLCG6icso+4dmP849EHWWxILusGJsQHXnvnM2zkRpcvjFGGjfdoJGU9Blj9edxehXWsshu6m5tn6H4u09xFdCsh3iyBVnbQakbFm7MRwCd+KxgQqUEJixCC6GU+4vrJPizSuIHEFFnw0hUr5BhirVFjvroDuEqThE+WsAhtJihiyDxhtDBX73ViLT8O4UO8ZxCBoG8uwUkGKnCiEWP0PYEOGTC7+lR5Fg8Ct5hR9BaRxxKrF1Ijxq+t+dIte5B+1c4Or0eNzJ+jEWdHeRBtVAqX+Wtd7UFvUAEWbxXHbAUGwT1xMnPKatYjfNhDZlY50O+xUWPTCoWTyPBVLR0TGRw==; 5:PoNfgh5j1C06vrTv/h1OEBRxxGU1S1c/1gKfqX7J02YkfMioKfIMn/kGDOHfkI5vkd4jWtM1frd9BfCOLlI304OYr4JFG7/eUirtVmXw4PKLcxro1G8Z2UwcYu3l9ywwNvxTtxvDWC9FoBF3lqPytA==; 24:4Fg1LtJs+WV1tkILn6MRU73XBaw7BPl081pE2ucOby0yagRQOVtcbyKNsIXmVByaLgx7aCjfl3AtrXhU1/kraEV4758wLX32j6y979EzOFE=; 7:4JNpYtQ4Zj0EM2Cn1/48IoPqQn6aD7uSU/EBhSXN2tvGw6ADznFB4ouxWNqNpPVeUt5lBJi4dt4F62rT71WH+WRas4xDzLGm31o/q90VFaqLtpHM3JzkY/7e76MkMfwRpxTQ3HctppHi4JML+89hVXfI7yRLWpkmm+sjUJlah/7q/itAPytxjuqgpBM+rWP5kQIAC04Q+D8/Fpy3pv4rCYjR6EwvLET/xsv+KE/aY1c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 14:55:57.9898 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2526 Subject: [dpdk-dev] [PATCH 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: Thu, 31 Aug 2017 14:56:01 -0000 Mark Promiscuous mode in features. Signed-off-by: Jerin Jacob Co-authored-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