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 E8CE943390; Tue, 21 Nov 2023 17:52:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A65E242E8E; Tue, 21 Nov 2023 17:52:23 +0100 (CET) Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) by mails.dpdk.org (Postfix) with ESMTP id 5AF3740DCD for ; Tue, 21 Nov 2023 17:52:22 +0100 (CET) Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-58cdc801f69so924780eaf.3 for ; Tue, 21 Nov 2023 08:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700585541; x=1701190341; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UMsFR5amRJyb+KkqYP+r6opwXl078foKQdExvMaWAEQ=; b=ITICkJL8mBpLVtNqQ42ggRUR3iHA1f+qD/b2W0xMpbT86Bo3j3AQLMUvGlPtD9ie6m Y5f9hmHkURj6W/92lvvqK2ZEdqQ547bpVv/OXOzBQ52Y2K4t8wI13muL2Jfa626xzZti Ia1+gA+RCbabvNvwSy8HBcoBKHv8UaNt1lCqpfiprIvKeEWO9Vm6gYe0+BWRQrOFSpIR AMIfM07ik4ewBCHFmUD2aKKCDuwF99x8jf2kEBEQ5GK2WgNQDaXVXBHcr/2UEdVK+Npu 7G3bR7sMzAqqm07SHLRmjVelJ4HDpL2rP8s2XU52KdhBEMawWhvvsmjBuG5ZNNTllY6s mPgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700585541; x=1701190341; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UMsFR5amRJyb+KkqYP+r6opwXl078foKQdExvMaWAEQ=; b=rL45IAYJlv9abA04Oqgmqa3uObZ9icJVYiqhu3WXq42jP+CbIZo4K0gY8ucltH9QG4 t298Q3q5lNLAO8cXzT9itqjHSpDOOvNKndmC+waWpNfLOkpV/5RFkFTBmhgkeoXkjcoz lCsYVkRykKJjWYdunkddNXFPFPBip9jYibSHrqchpO1FMIAHPqh3Nj5JYUTJjIW7j0sA IMUsTsNo4zdZD6cAxTnv/nv6/Wg0O39ddJXGv6Zj2H9ddNohfFkHMtKTII2ft5R0pOHR 8WwkTpt2+hYtCeZyezrVyxWwqhscYr1p81bibLAiNnZBFvQxRanjc9cQR5GON8l4y6EP iXjg== X-Gm-Message-State: AOJu0YwccSx3vomYm6SKga5PjdDymJsrkcLGKEiusNMFxUCX/0edbVb4 5+aG4l1HtttQZt2+46wHqvvCyZ6mhnljC0csrDM= X-Google-Smtp-Source: AGHT+IH4KunFIlOfNkw/aVp2tUoPnDZKmxxNaRhms6N+yN+Eozeg9FZ+UlgnIvYphe39DRxbepvlnWSIroSEE3bhyDA= X-Received: by 2002:a05:6358:720e:b0:16b:fe18:27fc with SMTP id h14-20020a056358720e00b0016bfe1827fcmr13695279rwa.31.1700585540956; Tue, 21 Nov 2023 08:52:20 -0800 (PST) MIME-Version: 1.0 References: <20231023080710.240402-3-rjarry@redhat.com> <20231121083855.6ae8e362@hermes.local> In-Reply-To: <20231121083855.6ae8e362@hermes.local> From: Jerin Jacob Date: Tue, 21 Nov 2023 22:21:54 +0530 Message-ID: Subject: Re: [PATCH 1/2] usertools/rss: add driver abstractions To: Stephen Hemminger Cc: Robin Jarry , dev@dpdk.org, skori@marvell.com, thomas@monjalon.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Nov 21, 2023 at 10:08=E2=80=AFPM Stephen Hemminger wrote: > > On Mon, 23 Oct 2023 10:07:11 +0200 > Robin Jarry wrote: > > > +class DriverInfo: > > + def __init__(self, key: bytes =3D None, reta_size: int =3D None): > > + self.__key =3D key > > + self.__reta_size =3D reta_size > > + > > + def rss_key(self) -> bytes: > > + return self.__key > > + > > + def reta_size(self, num_queues: int) -> int: > > + return self.__reta_size > > + > > + > > +class MlxDriverInfo(DriverInfo): > > + def rss_key(self) -> bytes: > > + return bytes( > > + ( > > + # fmt: off > > + # rss_hash_default_key, see drivers/net/mlx5/mlx5_rxq.= c > > + 0x2c, 0xc6, 0x81, 0xd1, 0x5b, 0xdb, 0xf4, 0xf7, > > + 0xfc, 0xa2, 0x83, 0x19, 0xdb, 0x1a, 0x3e, 0x94, > > + 0x6b, 0x9e, 0x38, 0xd9, 0x2c, 0x9c, 0x03, 0xd1, > > + 0xad, 0x99, 0x44, 0xa7, 0xd9, 0x56, 0x3d, 0x59, > > + 0x06, 0x3c, 0x25, 0xf3, 0xfc, 0x1f, 0xdc, 0x2a, > > + # fmt: on > > + ) > > + ) > > + > > + def reta_size(self, num_queues: int) -> int: > > + if num_queues & (num_queues - 1) =3D=3D 0: > > + # If the requested number of RX queues is power of two, > > + # use a table of this size. > > + return num_queues > > + # otherwise, use the maximum table size > > + return 512 > > + > > + > > +DEFAULT_DRIVERS =3D { > > + "intel": DriverInfo( > > + key=3Dbytes( > > + ( > > + # fmt: off > > + # rss_intel_key, see drivers/net/ixgbe/ixgbe_rxtx.c > > + 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, > > + 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, > > + 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, > > + 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, > > + 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa, > > + # fmt: on > > + ) > > + ), > > + reta_size=3D128, > > + ), > > + "mlx": MlxDriverInfo(), > > + "i40e": DriverInfo( > > + key=3Dbytes( > > + ( > > + # fmt: off > > + # rss_key_default, see drivers/net/i40e/i40e_ethdev.c > > + # i40e is the only driver that takes 52 bytes keys > > + 0x44, 0x39, 0x79, 0x6b, 0xb5, 0x4c, 0x50, 0x23, > > + 0xb6, 0x75, 0xea, 0x5b, 0x12, 0x4f, 0x9f, 0x30, > > + 0xb8, 0xa2, 0xc0, 0x3d, 0xdf, 0xdc, 0x4d, 0x02, > > + 0xa0, 0x8c, 0x9b, 0x33, 0x4a, 0xf6, 0x4a, 0x4c, > > + 0x05, 0xc6, 0xfa, 0x34, 0x39, 0x58, 0xd8, 0x55, > > + 0x7d, 0x99, 0x58, 0x3a, 0xe1, 0x38, 0xc9, 0x2e, > > + 0x81, 0x15, 0x03, 0x66, > > + # fmt: on > > + ) > > + ), > > + reta_size=3D512, > > + ), > > } > > The tool should not need to have driver specific tables like this. > DPDK is already riddled with enough driver specific quirks.. > > That shows a flaw in the rss design, which should have been fixed. Every NIC's implements standard Toeplitz hash algorithm for RSS hash genera= tion. Only the initial SEED is different. It is not DPDK property, all the HW like is that as there is no standardization on initial SEED for hash. > I should have seen this in the earlier versions, would have rejected the = patch.