From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0055.outbound.protection.outlook.com [104.47.36.55]) by dpdk.org (Postfix) with ESMTP id 090051B1A1 for ; Sun, 8 Oct 2017 14:45:28 +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=caLAeF9/xvTPu9dvE6F9DBoBMkKzpvvcOIIp2PAU5HQ=; b=mv4MFmsrRfg4uTyujMTV6R/ym024jc30KUEUsSoHAcTZ2Oiw9q2+rOxDrpKDFGeiVEw4G33RU6f11d9Er/h4GTvtAIo9J0HnOc0g66xxH5L9+aI+Pkw6u6nuzi1ZiZx1EMDpsddd8Yp7jSm1z00nskQ5a+DQzSR9W1nwNzgX+/w= 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:26 +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:07 +0530 Message-Id: <20171008124430.1866-4-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: 4d2d6b02-5b4f-4271-8690-08d50e4a73fa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR07MB3089; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 3:iOJKPEYPU7aH5HpXrPDlRwRjCCo0K2Y0EvQwvZ2wOHaSk0kD7s4iNwuICvhiFxbgldaU9/vTaV3WOslSzDJJaWWpIx66muJOaZDIhlgR7V+YWlkehazciz1WqAHl8HQzisMv6WIkc1C270hYhUZJjg1cgX5QVoyoR2Z4p8pxu06qoV0G4kY22Ejy8kOr85q/BuLkg6X5kXmdL9Iau60LHIgowJPQf5caOOCjQHPKE58cncVymyixeM+dH9Oc+XRm; 25:rkhbxQlo6Pm0vXM9QUJ9bCjSZ4qUDWsI776JDxc5+zAR1uj/ehBjuuG7sSiGwmTnUgWjEGkCoeFiWiCyJiHFoxFNRjr9d5iKKVVjrzQuo1Mi7qX0hdnDHBdliGMo0nwRcHeoIfr54L2pcVOfsyp9OJOUnL5zd2azuc36e6OckdmuidJFctf309jzToEkAVKwhxoEDotm/5GxpkljVfvQ1+UPqhE97HXJNrr6X8e60muaqs5blDOMfpUsi8buYdITn8Ztarm8BBT3pTOQs42CoTz1P+ipK6NoheI1uxOdiVuExZMk7Ou0VwEeNMnIzA3eRccnVEl439S15VH0ez/5pQ==; 31:2gYZtnvchc8lf0elsMaEHeZPBqUB3dQ3B0B9S3/6IFbg0VCa0ZToxWLwUlDoW22pZHyC/k4t8iOyNhbk+fr3LBElDv9zCdztO9aM5iHQAse+7f1feOTxvQoRI3H1BERTFn1nhR4FN5Zj9wr6c4LtybsCKL7Y7NCbY+jw1yQ6ph72WSJbhPQdmqzdpuE2d0tcjxM0BCrbO4XiEOTT4Sh2cjKV0A+qWc5aEr40AfTOm6A= X-MS-TrafficTypeDiagnostic: BN6PR07MB3089: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 20:ZEp0xwjuFTAJAeyKhW1trvgGOJmHEfGm9JltMmcd33lHLO8hZJDQyfTlvCdOy9hiu0TACH2wN961XMpzO8a4CPmL84z+5R6MF+Jvoq04e4HfV0Zw19/BXsiEoto8stqi7wI2EtgbLDnm/Y9o01v4EuC4yqBGb3FTKBNCUMP3G3chzuhCFYbOy+iO7wDordn5CGstHE+0lFVIvPfAI9gU/zL/ZCZ7j4sdiWykpczncjxaQbHIP6ON6iQahw4celvZMXMcfc4cfp0yOaVCqeUYNoyGYrq9EUDqTPVw/NBh5AeAFNdpJJc0oD0QbZu3hJZpi1H5EODD4bPWkDhk/lVaB8voBjbsH/NfZ7u+ePg/zGIaQbKpvXx7biLsEtiAmrjM8cUkTWl3EQnPtvueO4yyPJ8oIfevnDo+hJaTc+Y78zl0eHwOBmfYkTjYX3Pvyfu6wbbMgGIqlzJOb9WL3hrMkVTxIz7tEBjF6Vgn/xlIMYRauCaAOk9AKslJGRRfzTe5xdVuNV8+HcAnF/H9Oo9mksFlayImZcOsKOp7JmHGFdVfaYr9jorpgpHw40AnyXVf5pERQh3P4r+yZu6h+27Iz1FUVecU9Sc8NiajT3/0+b0=; 4:iDBCJvqiUa/twpDuDcHlxV5vCiq7Eak732bN+dIOvZzNon3zo0oIk2yjuKW5hLjSaJJQZeoT1Rx+/ePLeUf5GGny0JsAM/Rue5V3AJWZvRyREjU4Vw6WJstrctJgDpodmq2VORvT3/4RJBkL88oYW3ZumLELKwauIOG9LRT2MGJv039cRjut7yRuagpPyohH3uT/sWdNBUToROwWWV6JrJggsBtPgi7livhFA+wrb1ff5HjkZpG/bYMRhJtvYU7X 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)(15650500001)(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:hYzLoSCY6pllxdGOFELI4+SgYa5hwAXgevQrLxICV?= =?us-ascii?Q?4XN7u6ycKLS9c9JULfZN+UitBx+gxMAt0KNxJfybG7eFcEIzh2f8s7helhTi?= =?us-ascii?Q?bLo1xDO8zIL7gygBrvfUC1aJNbBe7RkyibWklufTHNwTAKP3vizBJ04dHOM4?= =?us-ascii?Q?RqWhpqYLiGuJhL4aysnT9SABSfJBJZEvHJuyukfOR43Fq3TBiqQIb3UsR8tN?= =?us-ascii?Q?xuuo6Wgh9d2x1rSkozrSxByb/59xm8YME4vDLLnp1aE2IFXkAfauXez373SI?= =?us-ascii?Q?KqNGjb802NmU/J5MMTm/z9jfY02BDHuKVJxk227wYypmPmP3YrEKw+UnpX8S?= =?us-ascii?Q?wU6pVMgJ1TQAnuvu0DCrYjr2Bz1inw2jG5VRfoYV5GdI+XWn3dGzsV9MlqTY?= =?us-ascii?Q?UIRzrI1f3mbaCe2hC6a5EJf3RWAzH0dTUNSO3TNtcnGRE3X/zG0dUKaZ2KgE?= =?us-ascii?Q?d4R0EcyHgzaglxfSEPynfGo+yORBqLgQs7oIEPGGcNU0vzEeOQZp14BsmN0e?= =?us-ascii?Q?vhtdqZpjCT5Ps7Z0/85IHpTq3Crl2l2uUoqkctOj2UfUKf/5Sjby+9Ukyon0?= =?us-ascii?Q?zgKbCXqGWo6uqwek2lg3mX5yNWmx7VnFFYV9mMV8UbEJ8OPPxS+3l6NI4OCX?= =?us-ascii?Q?cOry2/213xO8E+MoW9dsQbWGwpN55+UCthW6tmyOMq1Ddjrla0bxPUEzRF8p?= =?us-ascii?Q?kTvODdUxfOkfSNbzUr8LGS50rG+V10/jP190fHlyhu0D5A8Hw9xlFBU28/kn?= =?us-ascii?Q?bUMvxoY02TL/oYGGh+onLaE7xWIzwTpB3xO6XF89ZpPHiw82BmltSX56xW6X?= =?us-ascii?Q?XXli67PFxlq66JDwAXB9PiY7TquH844sgedjhlVtqBP1Jsy8qT+QbWv0nU/4?= =?us-ascii?Q?j20KjDgy495cF32MURL63zcKFIZXmT/0arY6lBTpmYj6opdniChzsbWrT+jC?= =?us-ascii?Q?Z4582kvWpkWcmwczQGxTqjO6ockSZxFKKOSy91eQC35FfWYKj49fErnurKbd?= =?us-ascii?Q?JUnvolZiwpzueLaqBIP5HLmKibpL59LmOGVOP7FWY322wWgKulPeiuGI6uJo?= =?us-ascii?Q?9Of0Sc9OWum4Y2LQgzI1CB/cYdIqrv+3P7mh/gao/bbEMp1lL/h7cT6L5RrP?= =?us-ascii?Q?UbS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Output: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2017 12:45:26.0207 (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 03/26] event/octeontx: introduce specialized mbox message copy 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:45:29 -0000 From: Jerin Jacob Some of the internal toolchain versions create unaligned memory access fault when copying from 17-31B buffer using memcpy. Subsequent patches in this series will be using 17-31B mbox message. Since the mailbox message copy comes in slow path, changing memcpy to byte-per-byte copy to workaround the issue. Signed-off-by: Jerin Jacob Co-authored-by: Santosh Shukla Signed-off-by: Santosh Shukla --- drivers/event/octeontx/ssovf_mbox.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/event/octeontx/ssovf_mbox.c b/drivers/event/octeontx/ssovf_mbox.c index 764414b59..9ed417d1a 100644 --- a/drivers/event/octeontx/ssovf_mbox.c +++ b/drivers/event/octeontx/ssovf_mbox.c @@ -87,6 +87,16 @@ struct mbox_ram_hdr { }; }; + +static inline void +mbox_msgcpy(uint8_t *d, const uint8_t *s, uint16_t size) +{ + uint16_t i; + + for (i = 0; i < size; i++) + d[i] = s[i]; +} + static inline void mbox_send_request(struct mbox *m, struct octeontx_mbox_hdr *hdr, const void *txmsg, uint16_t txsize) @@ -106,7 +116,7 @@ mbox_send_request(struct mbox *m, struct octeontx_mbox_hdr *hdr, /* Copy msg body */ if (txmsg) - memcpy(ram_mbox_msg, txmsg, txsize); + mbox_msgcpy(ram_mbox_msg, txmsg, txsize); /* Prepare new hdr */ new_hdr.chan_state = MBOX_CHAN_STATE_REQ; @@ -166,7 +176,7 @@ mbox_wait_response(struct mbox *m, struct octeontx_mbox_hdr *hdr, len = RTE_MIN(rx_hdr.len, rxsize); if (rxmsg) - memcpy(rxmsg, ram_mbox_msg, len); + mbox_msgcpy(rxmsg, ram_mbox_msg, len); return len; -- 2.14.1