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 A864E45EFE; Sat, 21 Dec 2024 01:45:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35F3540156; Sat, 21 Dec 2024 01:45:02 +0100 (CET) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id 111014003C for ; Sat, 21 Dec 2024 01:45:00 +0100 (CET) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-728f1e66418so2183905b3a.2 for ; Fri, 20 Dec 2024 16:45:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734741900; x=1735346700; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=BUUvTj38CT49NJhznMwv5Q/bumoMNiTqsRiV1IUZukk=; b=Z2oau6qz64JxCrsKhgV2DU+YwrIzFojUXMridEABHnjsijyJB45vcA0NTYp+ygJHoD fELMnEADqRd6oF5ZK81ki4RFDkP7WtVoT/7NNwL9FhZAYb4Aqn9wnsgXu/JzP7qtJElP jGnArwbzHHPfBdy6ovPMnOJArmsGkKdvZph2a4KHWL4AA9vfEzz7DX6D7LH5SDiMqX+a 00Ab+62N0JCQ25P52L+MrMIpaSGMlR7ltgEudlm5P3PFpPmMAXpBGyNm7fKVgQqFTQ3N M1VGp7D+LFi3sj7tcqk2gBj2sr6TGNbQkDq2lM50LaESwinEQQfzU2Jw9XmRAW7qQLai 06eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734741900; x=1735346700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BUUvTj38CT49NJhznMwv5Q/bumoMNiTqsRiV1IUZukk=; b=DdwN+T0RTEH4/sNCWGq34ECjarXYqWdoB+ddU18+r8tVqhS9awyKUDqmR9tMgn5HyE n6qyaPdoqvDCqev48iHEbjt7TUUJfjDWa9fg7qA4LI5w9bB/zThXfO/maQTK7U3wsawl c/CRd/r3q/U4J2oQq701cSqLBcuye65NXqfHJzt4R1hiiWqaEVpTThhDqOCIOAb59IdU z2EJiO8bFGre++T+HOAdlKanncM/u9lqVxkevGV5Z0PRo8ZhChS1nXGoPIk2wez2HCom edrJxTfoe8IYQlb/rZvLA0acVJMwcicVwPO4r2WaXBlgaY1fs9JPDYMNtHB42BKa7DWB j6uA== X-Gm-Message-State: AOJu0YzPpDrFg/TBEbiLwTnFCD7fLXfLcE7hVDSF7O91tAKBmP7YKKtl tRbtpwXmfavNOLziItJgBkoIiVO2CTMGt6Bx1nIlj9y7rR3GVKpSHL/SNYZzUFM= X-Gm-Gg: ASbGnct11CwZRSPDtx9VDN+5P/edI84fLL6TNflz8f7Vs/SdfU245onqZOabEf45EEz VKOJNhsGqVW/XtTU+Kp25NvPdW02FvD2EVgblv6/LdxK+O+AhSy4Y0mgcOk81ULp3WVZmrcjthX KokNjL38ndSz+wi7NhStiGsAfiFbTt/uQac5kGunAuRGlG1JLM7O/ghZAuCpoem0BdCqeDBPLrW cgJlXQnLHbntNF7VSHyBXhXbj0GbugmzCrKuloV516x4uFcKnRH/fCdr4hOUO979HBNC7Vr8lKD 3YjfPaIb0P1SM5eM1z8gjPqvMrUo86AdDA== X-Google-Smtp-Source: AGHT+IF0e9RjeJbYd1dHtjP48GwcxIafBrNPTcOsD/GTl0rwglB4oEhgn6DYBCWpCATToNCFjHHM1g== X-Received: by 2002:a05:6a00:398f:b0:725:e499:5b8a with SMTP id d2e1a72fcca58-72abde3335fmr6165190b3a.15.1734741900002; Fri, 20 Dec 2024 16:45:00 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842b821da83sm3425563a12.40.2024.12.20.16.44.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 16:44:59 -0800 (PST) Date: Fri, 20 Dec 2024 16:44:57 -0800 From: Stephen Hemminger To: Junlong Wang Cc: dev@dpdk.org Subject: Re: [PATCH v4 13/15] net/zxdh: rss hash config/update, reta update/get Message-ID: <20241220164457.473f0ff3@hermes.local> In-Reply-To: <20241218092603.1218855-14-wang.junlong1@zte.com.cn> References: <20241210055333.782901-2-wang.junlong1@zte.com.cn> <20241218092603.1218855-1-wang.junlong1@zte.com.cn> <20241218092603.1218855-14-wang.junlong1@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Wed, 18 Dec 2024 17:26:00 +0800 Junlong Wang wrote: > provided rss hash config/update, reta update/get ops. > > Signed-off-by: Junlong Wang > --- > doc/guides/nics/features/zxdh.ini | 3 + > doc/guides/nics/zxdh.rst | 1 + > drivers/net/zxdh/zxdh_ethdev.c | 52 ++++ > drivers/net/zxdh/zxdh_ethdev.h | 3 + > drivers/net/zxdh/zxdh_ethdev_ops.c | 410 +++++++++++++++++++++++++++++ > drivers/net/zxdh/zxdh_ethdev_ops.h | 26 ++ > drivers/net/zxdh/zxdh_msg.h | 22 ++ > drivers/net/zxdh/zxdh_tables.c | 82 ++++++ > drivers/net/zxdh/zxdh_tables.h | 7 + > 9 files changed, 606 insertions(+) > Some suggestions: > +int > +zxdh_dev_rss_reta_update(struct rte_eth_dev *dev, > + struct rte_eth_rss_reta_entry64 *reta_conf, > + uint16_t reta_size) > +{ > + struct zxdh_hw *hw = dev->data->dev_private; > + struct zxdh_msg_info msg = {0}; > + uint16_t old_reta[RTE_ETH_RSS_RETA_SIZE_256]; > + uint16_t idx; > + uint16_t i; > + uint16_t pos; > + int ret; > + > + if (reta_size != RTE_ETH_RSS_RETA_SIZE_256) { > + PMD_DRV_LOG(ERR, "reta_size is illegal(%u).reta_size should be 256", reta_size); > + return -EINVAL; > + } > + if (!hw->rss_reta) { > + hw->rss_reta = rte_zmalloc(NULL, RTE_ETH_RSS_RETA_SIZE_256 * sizeof(uint16_t), 4); This could be rte_calloc() ... > +int > +zxdh_rss_table_set(uint16_t vport, struct zxdh_rss_reta *rss_reta) > +{ > + struct zxdh_rss_to_vqid_table rss_vqid = {0}; > + union zxdh_virport_num vport_num = (union zxdh_virport_num)vport; > + int ret = 0; > + > + for (uint16_t i = 0; i < RTE_ETH_RSS_RETA_SIZE_256 / 8; i++) { > + for (uint16_t j = 0; j < 8; j++) { > + #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN > + if (j % 2 == 0) > + rss_vqid.vqm_qid[j + 1] = rss_reta->reta[i * 8 + j]; > + else > + rss_vqid.vqm_qid[j - 1] = rss_reta->reta[i * 8 + j]; > + #else > + rss_vqid.vqm_qid[j] = rss_init->reta[i * 8 + j]; > + #endif Please put #if in first column not indented. Better yet, use rte_byteorder functions to elimnate #if code pattern. > + } > + > + #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN > + rss_vqid.vqm_qid[1] |= 0x8000; > + #else > + rss_vqid.vqm_qid[0] |= 0x8000; > + #endif