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 6D3B8A0560; Tue, 18 Oct 2022 21:41:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C0B2410F2; Tue, 18 Oct 2022 21:41:56 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2068.outbound.protection.outlook.com [40.107.94.68]) by mails.dpdk.org (Postfix) with ESMTP id 861CB410EE; Tue, 18 Oct 2022 21:41:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rz0JWocgqLX5wBjVGhMRjlUuiCfEL+xVo7WIPZnHHPcebgJT5r/I5urLzoSBGFTUZvVsfSYqT3ycZIMzSMRAWMDXm1ha0hPMWYPaGDV+KCWWDhc1YJbMHL1CqLMO6vsmN1yXQROTzVSWh/TyMMwndz0Vorem3AwRgq79YGcKs1j9zfrf3jGJN75QyJtpUxU9nydFi0xOEHuBbl3TgQg+wloB0e3me5awDtiWKrZLERdfWZKN6VyIvaYIb7i+QbLS6GgCh/5hnwx1WO1qHewZilroelVL+y3N4aduckyJCKgIWh6V25X+AjLzJfmZt2yQx+jxUUYvDVN7YgikUYJTLA== 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=inGKrmqXWhG2Z3Lk58FuMt4Wf+fUV2/bJ695xgir7dNxcF1VerArJ0H4yuKD+X8hhgWB4AquynZ4zPP6QZU4jON9zp7f18dgz06H48yCfhMV9NCANZjqTnPvjY2ad3m/p2y2O+XJCZHQkaXWH5tSF5rg3GnPt9xbf1crQBQd++3XhM6nUUObJCB0NFwj/M8jKoFxwiYkDxyAaKKWStVEtotwqZgGF5fwZLaoH/uf4UNqHhl9YahsPuakOcWNX/P2jDlVWf8Ml1uqdhRUzI1/jWkly09PQDktXy5whrAQF1BLgbxIPuw6HQ3GaqsmXYKCVJZQKaedB76RGvlJFB2hMw== 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=JP84KwCSDm96TUfOsPzx7Z2lJe41KKpRRzqn3kBE5+VINJnaFdnxoYXMa/FCWuBNsILE5gcwuyP28D6Cj49RRsUlV12eJz8mSIGK7vCTfaMdEqJEfPc4NoL2mC0lS0UpNtS0BnVU5pQUztz4xlITveVhnEvDXLNmPMQKQjy7o+8= Received: from BN9PR03CA0156.namprd03.prod.outlook.com (2603:10b6:408:f4::11) by SJ1PR12MB6052.namprd12.prod.outlook.com (2603:10b6:a03:489::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Tue, 18 Oct 2022 19:41:52 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f4:cafe::9f) by BN9PR03CA0156.outlook.office365.com (2603:10b6:408:f4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32 via Frontend Transport; Tue, 18 Oct 2022 19:41:51 +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 BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 18 Oct 2022 19:41:51 +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.31; Tue, 18 Oct 2022 14:41:50 -0500 From: Andrew Boyer To: CC: Andrew Boyer , , Subject: [PATCH v2 01/36] net/ionic: fix up endianness for Rx and Tx handling Date: Tue, 18 Oct 2022 12:40:56 -0700 Message-ID: <20221018194131.23006-2-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011005032.47584-1-andrew.boyer@amd.com> References: <20221011005032.47584-1-andrew.boyer@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT058:EE_|SJ1PR12MB6052:EE_ X-MS-Office365-Filtering-Correlation-Id: 8530ac7b-1107-4e58-15a4-08dab140cdff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DH/dT+comu6rblD3T5NXWwogJbhbr8W1KLuoGBJVVkjARUlEVHomO2ReKoBejnFy/T2G4PGV18cdEyHz/dDmFDQN+/8WyRi2G9sWvQDItQc7xxMwqBbt0ADGzii+7bAOmPgeksVMyZCoP09kK8uQdB8vROZgpgTf8zqGIbaKxMA6wc8tJgUl6lSTQwH06IO7lU0TLIsU1GAQgc0kke1MXXLxPrJ7hhTSrlb07lagFu34Xu3YqFqW6ez6yz7xRJkm/ACRArlHFpun+vhoZ6VCP20QRcFEHrkLUUBQHm/CTpKMzm1HwHq17sW8zvei6HL7T6+bTwReAYH47yMnii5enoFuk2haFvzDvU7h8Q8leOhqiANJJo+ZoP/Kth4EIDSEkogWG9Bu9dxrxZ7RYWYxn7ZEOLVoJx7dFqj1gOR47INoml2myWN1Td6hlUVuYBx9PLd0uIpiRHJr40AwxDL11OBMbdtdsCCqZPL4dzYtAhbGxO1QCcbafsrYWlqj2zb0JBHlRxdMlSfAWn/QeJ14GCwbtOcGENydAobSo5C6znyLr+nVmrkW4ybmTO0/ZFN+TiKbUgkWbcc2BcAeCX8Jf8e+YtIwi93WONQq03QyhaHSbSl+yyLLbDbokLdBpw7lzJWYfveJDiQDF6wYOimo6QmcF6LNOru8N853myHvQi6UmZGObAuE2QG0BwPgMHriVHf0G54dqOit8iafYP8BOTxmiiGz2UIZpBb/sTDzBlSbxDDIufomZDHOuOZLYeXWqok5uaALg+VnA1USj/GmTBZihbAawyxpsiQjTypR4zo= 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)(136003)(376002)(396003)(39860400002)(346002)(451199015)(46966006)(40470700004)(36840700001)(47076005)(356005)(478600001)(81166007)(426003)(54906003)(82740400003)(6916009)(83380400001)(82310400005)(2616005)(26005)(36860700001)(8936002)(316002)(40460700003)(2906002)(41300700001)(186003)(86362001)(1076003)(16526019)(40480700001)(44832011)(36756003)(5660300002)(8676002)(336012)(4326008)(70586007)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2022 19:41:51.7947 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8530ac7b-1107-4e58-15a4-08dab140cdff 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: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6052 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