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 6468943390; Tue, 21 Nov 2023 17:38:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7E8F42EC7; Tue, 21 Nov 2023 17:38:58 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id D051E42EA2 for ; Tue, 21 Nov 2023 17:38:57 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6c396ef9a3dso4868598b3a.1 for ; Tue, 21 Nov 2023 08:38:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1700584737; x=1701189537; 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=PXImK/krqHc0lG1f/Dtk6DpIkkX2OOaIM85U1eJT8WI=; b=PQPck2fwguWSiNeE63fxSuR51oQXcKcUF1UVzuVfabTNBjb9P4HaQwfPyTPbsiW6/9 JulGMfJN79bJ4pFJlHNDUwvzAf21IR3V2dpqMGP6uY/HhTbAOpD5wXanwmhWcRlmIcKG s3YW9y+G+hGvYacnJ1F/FYfsgQ/HcQFc6BxsxdED56MBjEVhYqcVaVMLbQeoFq25uuri wS+x4xeI+095gT1SEzF6Vd9sgU5Xogs6S/Qw6g/xcOosWYr/X1n0dS2X+EM+LJIyFwGV v8sF9ydpFyhjuIEaSkCmQReoynzjpxqAk1DT7bTVYC51dpsrcktY9eqKd81mxRQZdkvH MGTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700584737; x=1701189537; 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=PXImK/krqHc0lG1f/Dtk6DpIkkX2OOaIM85U1eJT8WI=; b=W6/cTlSOAlfm8zjN2fLHvcrng3eru21gvP6FtZMDOUchRLeby2h3zNoVmHhaz0VMiW h6jz6XeScfrPgvXnSyHsjmRZWkmAWcv/NkrWuNhRv7sHkJXfdqz1eLCw1W2hOvbuRPpC ItIk8mvIolt6vNdoVsADE1yKnwfAIjD/NoHrHxXJnZryIxDb86MTAv04q4QVlQ5fLjEW 0Z0LN3N/v5KdshjjMvAtr/Ucr8BHXgD1YrF6tnwi2fvYIxeG4DJONTLm/UsnO4BvmsoF WfUPLOelzNKBBWi9mPu2HQr1uSiI4sKqPMkBO+V9/IXDY67BJJ7k6V1NlwMGpmPCV1vV bdNw== X-Gm-Message-State: AOJu0Yxx/ylGdWj/jXvrsv1+vQr1DwM7bg8jWUN0CTgdFRJQxfvbcrv/ N2jQfjoDNcbz+uCWPPbVxpjafQ== X-Google-Smtp-Source: AGHT+IHFNf5jccqnI/GudwHUtOoXB7IxrlXqpQ0VVnCBT5X8yFq8iwkz2/7P3hgbwxOq7CIEatVwKA== X-Received: by 2002:a05:6a20:9187:b0:187:af0b:5768 with SMTP id v7-20020a056a20918700b00187af0b5768mr10341058pzd.1.1700584736961; Tue, 21 Nov 2023 08:38:56 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id g7-20020a056a000b8700b006cb6fee548esm5419467pfj.91.2023.11.21.08.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 08:38:56 -0800 (PST) Date: Tue, 21 Nov 2023 08:38:55 -0800 From: Stephen Hemminger To: Robin Jarry Cc: dev@dpdk.org, skori@marvell.com, thomas@monjalon.net, jerinjacobk@gmail.com Subject: Re: [PATCH 1/2] usertools/rss: add driver abstractions Message-ID: <20231121083855.6ae8e362@hermes.local> In-Reply-To: <20231023080710.240402-3-rjarry@redhat.com> References: <20231023080710.240402-3-rjarry@redhat.com> 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 Mon, 23 Oct 2023 10:07:11 +0200 Robin Jarry wrote: > +class DriverInfo: > + def __init__(self, key: bytes = None, reta_size: int = None): > + self.__key = key > + self.__reta_size = 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) == 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 = { > + "intel": DriverInfo( > + key=bytes( > + ( > + # 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=128, > + ), > + "mlx": MlxDriverInfo(), > + "i40e": DriverInfo( > + key=bytes( > + ( > + # 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=512, > + ), > } 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. I should have seen this in the earlier versions, would have rejected the patch.