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 C083AA04FD; Fri, 7 Oct 2022 19:44:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B600440E5A; Fri, 7 Oct 2022 19:44:21 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id B01BE40DFB; Fri, 7 Oct 2022 19:44:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F9NplryJZQLlt1OZ85c5akyiUxidxt7xH1k+g7DslFp6Qypt5eQT0yVnYH0aEHvPtrM7h0KjvDMzLKLJJYgZ4uBAxi/4PbFMBNqDH7tBWySDu6leJFLpwxT+COIATWwL8d2I13wufxtygXOA3vXWeGrgnjckIjHXJ2YEKlT49mxL4DQeIsBEDDs0UPye7dcl3Z+q3FHqAKpYvoN54yoJPJTVwLhdfRXXjpqwhx0pFz98dqd/NrnoeJrLTrRTZYVgBD4qMMcDwU/B+EkTMGCnY4cSeGut86l7ASAZBJpmK+2J//wSK99s4CzJxeLT4erVpvYahr6Ah6gqfoZcmgm06g== 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=WndBut2S8f3KFPBiqNi52JAs80tYC49Qf7XaSmI4O55+qALv0FS2a2XhZhFv1XxG6zP1CJmzHGI9BKbe+EAfebjVWbWfdStlWjvkulJpoBALrPBVvrlR28dG0nfHnkgKDDgvVQjdvoCYED4BrvmnqZqvgnkoBEYza7ViBuM1J5YdzXkw78Rj+dJ5neU6LbvFi4eEQbm0cL/CzdNcyhX4iCyfh/5xWoBiC42/wGFQRkSfcznGhduSbz5hdKYws3SxLie9ZsY4SwWMb3v4mYDRrg9T6+gmuxV3zpiu5ljCgYMK+ma69aVVR3Gyo1sNg7GATjXqxxsxnGL5YbKqCZ+CSg== 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=w9hHy1CcvJ/i4j5iI2388OiRpTKgqphQbDhK+8WxAT2V9Tz3vJQQ8yuVVnKzdw/z/WwUc1tQ41RrxxAz4+uvHXMuwkJzSinH2997O4atu5+vKqBCtYiJYdX2yPkfzI3SunB8wGIN5VnqwQKqx/S1NfvKurN3mkPb0GYU4y0qgOQ= Received: from MW4PR03CA0188.namprd03.prod.outlook.com (2603:10b6:303:b8::13) by DS7PR12MB5768.namprd12.prod.outlook.com (2603:10b6:8:77::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.33; Fri, 7 Oct 2022 17:44:18 +0000 Received: from CO1NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b8:cafe::4d) by MW4PR03CA0188.outlook.office365.com (2603:10b6:303:b8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24 via Frontend Transport; Fri, 7 Oct 2022 17:44:18 +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 CO1NAM11FT039.mail.protection.outlook.com (10.13.174.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5709.10 via Frontend Transport; Fri, 7 Oct 2022 17:44:17 +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; Fri, 7 Oct 2022 12:44:16 -0500 From: Andrew Boyer To: CC: Andrew Boyer , , Subject: [PATCH 01/35] net/ionic: fix up endianness for Rx and Tx handling Date: Fri, 7 Oct 2022 10:43:02 -0700 Message-ID: <20221007174336.54354-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: CO1NAM11FT039:EE_|DS7PR12MB5768:EE_ X-MS-Office365-Filtering-Correlation-Id: c861cf36-e8e4-4a4c-75ba-08daa88b8ef3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Krb6EPxAO6d5mzDpvSiJlqB/rAgcCxUIhNs9hF15KRANQ+cHj5qhLe6t3IAjk0bBzEmmxyV8vvShBeZeDW/ra37G0xOlA3agvh8yuO/snKMKcNDTtUZ15DaRHaQ1gZ7/A3Q0SuPNTzdkL4t3/zE7amyIq556i774RMapvnFZnYkvGCfuB0DMT2ne2fLiiGdsvLvcFMVwB8c3cpvlivDMoVdfhNMsvRv5pdpqfDlNXk3j0cH/5geiusOQiWdbny4KENhPZkvVSP7H0J9KFcjyT5f9M9n/DepNlfZvPbQ8n3uYQt7IuRnt152voQ9hkXj/nZylfTTx6RFVboJU7H1CqHXI8om9wTQCfotlB5JY4Z7girmSdJ04UT35Uh3rtF3GTvQENcNuPeiexMSn3H6eA9QBIuf+AeELfo4vpHzp1e1pSLEscZh52A/meLKpV/Qv5StxRBdwm+U2GeYGsJRw2P9UJc4XNRE6cw/VZxsQKPAxtQ8MIh0pBfXvmsgux6slN1OOUszoiOSmjEgbbZDjOlIbM89+FSUm2L8GFg+XCRSyP1wD9Z5TpIimDD2ILi9T4W8CrhPjCpKvooQRQdmbUB40R8OOVdrpIVURfB2ydMOsKrx9olbMg5SRHDi3PCzU8yk/4WaH6fVBuIZ0yPujU3/hJzBup0JgNJaimD9npy0d4YS4U8vo/VKSfEIQhzbyKljDAiedddShYDJfnuPXgx0CrzjSee7SOY6Gmt+oFcLp9ZIHJbraRkXluh64oVVRX7nlH4ru/+jM+JJRlcXyctdRX42HaHZ5oUhoFf7n1n0= 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)(346002)(376002)(136003)(39860400002)(396003)(451199015)(46966006)(36840700001)(40470700004)(426003)(8676002)(83380400001)(47076005)(4326008)(82310400005)(336012)(26005)(40480700001)(36756003)(54906003)(8936002)(70206006)(478600001)(70586007)(186003)(2906002)(41300700001)(36860700001)(6666004)(1076003)(6916009)(86362001)(356005)(44832011)(5660300002)(2616005)(82740400003)(16526019)(316002)(40460700003)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2022 17:44:17.6867 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c861cf36-e8e4-4a4c-75ba-08daa88b8ef3 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: CO1NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5768 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