From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F3A4C05027 for ; Wed, 1 Feb 2023 08:09:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbjBAIJu (ORCPT ); Wed, 1 Feb 2023 03:09:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbjBAIJs (ORCPT ); Wed, 1 Feb 2023 03:09:48 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9705349426 for ; Wed, 1 Feb 2023 00:09:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675238948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OlcAQ5MsLGuGdKxnuWKdhyE/oF5Acl1gFxXDWtDH90g=; b=ZqG0aXzD9d7uc3EcUrJGr3IuwynVGfZ3Gmf5QXOD7w/YSmJrxOoduIOxqTmpBBgSJPNeHS peesTAWI46Ljea8CtdD+tN9W49I0XW5CZDYH4cYqMCyjBr1otl0CfxaAw8zyvBbbDdw37n Z1aa4xnez1kWzeKKRO0sB427fUbYwEQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-482-xv8DQVmzO_KaIN-8hS2fSw-1; Wed, 01 Feb 2023 03:09:02 -0500 X-MC-Unique: xv8DQVmzO_KaIN-8hS2fSw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C70E72A59559; Wed, 1 Feb 2023 08:09:01 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5738492B05; Wed, 1 Feb 2023 08:08:59 +0000 (UTC) From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= To: ecree.xilinx@gmail.com, habetsm.xilinx@gmail.com, richardcochran@gmail.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= , Yalin Li , kernel test robot Subject: [PATCH net-next v2 0/4] sfc: support unicast PTP Date: Wed, 1 Feb 2023 09:08:45 +0100 Message-Id: <20230201080849.10482-1-ihuguet@redhat.com> In-Reply-To: <20230131160506.47552-1-ihuguet@redhat.com> References: <20230131160506.47552-1-ihuguet@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Unicast PTP was not working with sfc NICs. The reason was that these NICs don't timestamp all incoming packets, but instead they only timestamp packets of the queues that are selected for that. Currently, only one RX queue is configured for timestamp: the RX queue of the PTP channel. The packets that are put in the PTP RX queue are selected according to firmware filters configured from the driver. Multicast PTP was already working because the needed filters are known in advance, so they're inserted when PTP is enabled. This patches add the ability to dynamically add filters for unicast addresses, extracted from the TX PTP-event packets. Since we don't know in advance how many filters we'll need, some info about the filters need to be saved. This will allow to check if a filter already exists or if a filter is too old and should be removed. Note that the previous point is unnecessary for multicast filters, but I've opted to change how they're handled to match the new unicast's filters to avoid having duplicate insert/remove_filters functions, once for each type of filter. Tested: With ptp4l, all combinations of master/slave and unicast/multicast Reported-by: Yalin Li Signed-off-by: Íñigo Huguet v2: fixed missing IS_ERR added doc of missing fields in efx_ptp_rxfilter For the missing IS_ERR: Reported-by: kernel test robot Íñigo Huguet (4): sfc: store PTP filters in a list sfc: allow insertion of filters for unicast PTP sfc: support unicast PTP sfc: remove expired unicast PTP filters drivers/net/ethernet/sfc/ptp.c | 274 ++++++++++++++++++++++++++------- 1 file changed, 219 insertions(+), 55 deletions(-) -- 2.34.3