From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2ED72A0544; Tue, 11 Oct 2022 02:51:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72DF442BA5; Tue, 11 Oct 2022 02:51:12 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2044.outbound.protection.outlook.com [40.107.92.44]) by mails.dpdk.org (Postfix) with ESMTP id 3C62D40DFD; Tue, 11 Oct 2022 02:51:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VncWTXQBUjf4Ez0nqskEFZY7xh3+1jl2oPA9ak81E36T5+lVExgAVYj0ewCoCLJH4klMAbIHi4Dus3NREBW8eMJ6lEhCOT+xnuUIz8XaEy3gtHrdaW3SFpby7yWSlhfcJPnIeFwGE8IvqfJ00QZ5lkqi9NjVK5of7mgIVfRt01PaF96Eg3vDc6o/0FU7Ji+3oyKtw8WjIOjHWJQw0cJRlwa8ML4bWSdGa7Gcr65ocsi8ssbGjB0meBXp3I8sVz3EBPebZPRMR6IJXsdNXy7KNz5HF3CXyT1W1wwCVa8cQ8Yip6VFzQFTRbppwNjdrKVqBSB59yaYg87WT5KdopATtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l6qPoordwLRytVvYf+Iggpb+OHA3MOzk2RfVK5FpKVk=; b=mmvuKZJYndR4kOom+9nYnusSGPDr6iAz4JE3M6AL7FzBaJ2iY2dymK7q6AeYT6De0nezqB1Y1eDeI2gVPbe0MdobsGK0MeC1Dem32+Pl611p5UDXAWP+QXrr/WcrG4PCY/CK+Q/48y0EChbLXR8tQlxHLDY0jqRYX4duNPrND/0aslv0olz/Eaa5E2na40hwGfaG8u8UK0JqOsTITfwwynX9p5BZWFv0vNpiEDObG649DkXmCORsgCB3wLbCEPSUgA5AmgnOQmhD9dbVUwGhRa3j+22VSj1+ZzAQMpNuXjvWO06w7mQUhw+bg+Uu7vcJzLS/AFgq2w2t1D4JejvN4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l6qPoordwLRytVvYf+Iggpb+OHA3MOzk2RfVK5FpKVk=; b=tigT4Ef/xPwxijOlQVzpNdOKDdD1eDFMiwIK1Zj8aw/yTyviBTAEt9Zrhk5NW/SsWyaX9R4pzjGWBdYxRJP0PXUgFZYCjwwUPvNiEloZinbykZCiBuF7RXJoB0ryCNJ8EdVeEC0gBtswfWXiMbz/+Loo9Ol/HP7d3nNbBBU3PYU= Received: from BN6PR17CA0050.namprd17.prod.outlook.com (2603:10b6:405:75::39) by DM6PR12MB4529.namprd12.prod.outlook.com (2603:10b6:5:2ab::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.31; Tue, 11 Oct 2022 00:51:06 +0000 Received: from BN8NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:405:75:cafe::b3) by BN6PR17CA0050.outlook.office365.com (2603:10b6:405:75::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.16 via Frontend Transport; Tue, 11 Oct 2022 00:51:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT028.mail.protection.outlook.com (10.13.176.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5709.10 via Frontend Transport; Tue, 11 Oct 2022 00:51:06 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 10 Oct 2022 19:51:05 -0500 From: Andrew Boyer To: CC: Andrew Boyer , , Subject: [PATCH v1 01/35] net/ionic: fix up endianness for Rx and Tx handling Date: Mon, 10 Oct 2022 17:49:58 -0700 Message-ID: <20221011005032.47584-2-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221007174336.54354-1-andrew.boyer@amd.com> References: <20221007174336.54354-1-andrew.boyer@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT028:EE_|DM6PR12MB4529:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c059aff-2261-4454-5c97-08daab22ae30 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0RarjnIJ/ofLh46AJo9yr0NVCfpq9C8a/lv8jvGV4hS1nOZJPLj+zAdw0nZYgY1VCfVwhBS09G+Y/lZ/AQAZe6gZv8G1K3tiIqYB3gUiL9ZeMUmkuNPou8ibdRqy3lwnKcEEmORUC7RtVgIzuQdwtoWqkKMlS4XKLlpBQ3UjNOBLzFOS8bi//t1lBbuqvz0jKg741uClTg7XGFiD/ij1Sm82ubBjmXhG9deeTa7fB6C270DjFDmgliy/LLUCgTKHgwCAGNr0es4PNnoAXDOi3fb5D80zw3ZJCJINjfcRdJNA3hR7IHDbjKETquVX7pH5wuwZsQtt7VcG7MbD+uwsqW5neFeQVhw5EK/aosciX/n41oEzZGYwtWccK9LyqXtuBLZnWydY1e3sJReGJcyX9wuQhw3OIRuw+OH9x1gXR75rujdGqxOaGW7KbZlNxIAjStD/ulkugUBPK9lwMtjQiQ/+y0fRTsQtqo72LTShLjzff/vgtojvpVj7SWV8YCB7gzQcjcWmI8DzYcH+bi1YBSKxZyicZ9FWgt9sLixha9YIxXylgzO1R/nSCyAd8wkz+O7QcxhZwg5FJXxCupYI4r4Uk8x0k0UmC9+xS6smxY1UEb9OPYohf4xxbRgVmnFvcVD2ZCsO0ZcKB+5aCSFJwlXEQceFJGxQKCMZzx6zUTawLzzk563rc87yFh5bdkWwFVnQd6lKGytPNnA8MalhLazmbP58pdXfBqa2blKUnnA8/jYzho2VRkp0vUx0xPOB5zNhXHhsypgtpJdZJjYuVjk/TwJEUZEsB5JGhhE2i+0= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(136003)(39860400002)(346002)(376002)(451199015)(36840700001)(46966006)(40470700004)(82740400003)(26005)(86362001)(82310400005)(40460700003)(356005)(81166007)(2616005)(41300700001)(4326008)(70206006)(70586007)(8676002)(478600001)(6666004)(54906003)(6916009)(316002)(36860700001)(2906002)(426003)(8936002)(5660300002)(336012)(1076003)(186003)(16526019)(44832011)(83380400001)(47076005)(40480700001)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2022 00:51:06.5520 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c059aff-2261-4454-5c97-08daab22ae30 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4529 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org These fields all need to be LE when talking to the FW. Fixes: a27d901331da ("net/ionic: add Rx and Tx handling") Cc: cardigliano@ntop.org Cc: stable@dpdk.org Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_rxtx.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index 9f602de6a9..af2d89f9fa 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -300,18 +300,20 @@ ionic_tx_tso_post(struct ionic_queue *q, struct ionic_txq_desc *desc, bool start, bool done) { void **info; + uint64_t cmd; uint8_t flags = 0; flags |= has_vlan ? IONIC_TXQ_DESC_FLAG_VLAN : 0; flags |= encap ? IONIC_TXQ_DESC_FLAG_ENCAP : 0; flags |= start ? IONIC_TXQ_DESC_FLAG_TSO_SOT : 0; flags |= done ? IONIC_TXQ_DESC_FLAG_TSO_EOT : 0; - desc->cmd = encode_txq_desc_cmd(IONIC_TXQ_DESC_OPCODE_TSO, + cmd = encode_txq_desc_cmd(IONIC_TXQ_DESC_OPCODE_TSO, flags, nsge, addr); - desc->len = len; - desc->vlan_tci = vlan_tci; - desc->hdr_len = hdrlen; - desc->mss = mss; + desc->cmd = rte_cpu_to_le_64(cmd); + desc->len = rte_cpu_to_le_16(len); + desc->vlan_tci = rte_cpu_to_le_16(vlan_tci); + desc->hdr_len = rte_cpu_to_le_16(hdrlen); + desc->mss = rte_cpu_to_le_16(mss); if (done) { info = IONIC_INFO_PTR(q, q->head_idx); @@ -423,7 +425,7 @@ ionic_tx_tso(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) len = RTE_MIN(frag_left, left); frag_left -= len; elem->addr = next_addr; - elem->len = len; + elem->len = rte_cpu_to_le_16(len); elem++; desc_nsge++; } else { @@ -470,7 +472,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) bool encap; bool has_vlan; uint64_t ol_flags = txm->ol_flags; - uint64_t addr; + uint64_t addr, cmd; uint8_t opcode = IONIC_TXQ_DESC_OPCODE_CSUM_NONE; uint8_t flags = 0; @@ -505,9 +507,10 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) addr = rte_cpu_to_le_64(rte_mbuf_data_iova(txm)); - desc->cmd = encode_txq_desc_cmd(opcode, flags, txm->nb_segs - 1, addr); - desc->len = txm->data_len; - desc->vlan_tci = txm->vlan_tci; + cmd = encode_txq_desc_cmd(opcode, flags, txm->nb_segs - 1, addr); + desc->cmd = rte_cpu_to_le_64(cmd); + desc->len = rte_cpu_to_le_16(txm->data_len); + desc->vlan_tci = rte_cpu_to_le_16(txm->vlan_tci); info[0] = txm; @@ -515,7 +518,7 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm) txm_seg = txm->next; while (txm_seg != NULL) { - elem->len = txm_seg->data_len; + elem->len = rte_cpu_to_le_16(txm_seg->data_len); elem->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(txm_seg)); elem++; txm_seg = txm_seg->next; @@ -845,7 +848,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, /* Vlan Strip */ if (cq_desc->csum_flags & IONIC_RXQ_COMP_CSUM_F_VLAN) { pkt_flags |= RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED; - rxm->vlan_tci = cq_desc->vlan_tci; + rxm->vlan_tci = rte_le_to_cpu_16(cq_desc->vlan_tci); } /* Checksum */ -- 2.17.1