From patchwork Tue Jun 27 13:58:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 9811715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 12327603F2 for ; Tue, 27 Jun 2017 13:59:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05C8B28593 for ; Tue, 27 Jun 2017 13:59:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEE9528595; Tue, 27 Jun 2017 13:59:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7416628595 for ; Tue, 27 Jun 2017 13:59:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751942AbdF0N7P (ORCPT ); Tue, 27 Jun 2017 09:59:15 -0400 Received: from mail-lf0-f51.google.com ([209.85.215.51]:32951 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751516AbdF0N7D (ORCPT ); Tue, 27 Jun 2017 09:59:03 -0400 Received: by mail-lf0-f51.google.com with SMTP id m77so17711006lfe.0 for ; Tue, 27 Jun 2017 06:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UdrkfjijGPe0uHz27iIJPZTE3Hb00qUX3uk9qbNuyYM=; b=BY0v20Az33TUiphK5WTcUsqTPSOsPG86w5AluvUOmAejzw6ug2BU+sikTmUWhU1p13 zHikmtkJ9kfbB0lkF4pR5BwpD1soSaVZn/AScydiTEnFtQq7K3GqrvY+N7g7rWTuSaof fsFWGWBqUtN0mK5yy+oaJLLs3g7txzEeMNAVI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UdrkfjijGPe0uHz27iIJPZTE3Hb00qUX3uk9qbNuyYM=; b=pywB2FcyZzc6kXowrikxBL9Srk8Zs2Pj+1RN9LqjuJQ0WDlXcWVmEB2Y0/dLAgqsxJ Jmjqm6wT5cbSmA3GHyX/EhQJs8a9yMc9d2mpqH/qVoEAsHJlu3E1pyY3+PI4xiclUCAh EDvkNNlTVUOp2V99DiYS1WGH+Li3hf8b/7/XEQYRrE29Te3AB2d0Ay4Q5KD0T2yYKQmt oJHQybwVbg4EvS0MrJ22OJEuJ+65+7SIHzPYIJzkyIpRnl1+47CIxelC2uexCEP19YHZ eS1SVpbHr7kndGJ1zi7BwiO0gKs2u0gTCY76BH54GJRc92aZ8t/Hsx6g8jMJ/5j4MEb1 jsaw== X-Gm-Message-State: AKS2vOxDXgwQ0n+N9hc6BfSNe50xFszf4Sx0hr3EyAUEef6Z0XDKIkBH 57Sq0atlKW3TKokZ X-Received: by 10.46.87.16 with SMTP id l16mr1780080ljb.100.1498571941735; Tue, 27 Jun 2017 06:59:01 -0700 (PDT) Received: from localhost.localdomain (183-224-132-95.pool.ukrtel.net. [95.132.224.183]) by smtp.gmail.com with ESMTPSA id m29sm670836ljb.26.2017.06.27.06.59.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jun 2017 06:59:01 -0700 (PDT) From: Ivan Khoronzhuk To: m-karicheri2@ti.com, w-kwok2@ti.com Cc: grygorii.strashko@ti.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH net-next 3/3] net: ethernet: ti: netcp_ethss: use cpts to check if packet needs timestamping Date: Tue, 27 Jun 2017 16:58:53 +0300 Message-Id: <1498571933-3663-4-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498571933-3663-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1498571933-3663-1-git-send-email-ivan.khoronzhuk@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is cpts function to check if packet can be timstamped with cpts. Seems that ptp_classify_raw cover all cases listed with "case". Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/netcp_ethss.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c index 0847a8f..28cb38a 100644 --- a/drivers/net/ethernet/ti/netcp_ethss.c +++ b/drivers/net/ethernet/ti/netcp_ethss.c @@ -2503,24 +2503,8 @@ static bool gbe_need_txtstamp(struct gbe_intf *gbe_intf, const struct netcp_packet *p_info) { struct sk_buff *skb = p_info->skb; - unsigned int class = ptp_classify_raw(skb); - if (class == PTP_CLASS_NONE) - return false; - - switch (class) { - case PTP_CLASS_V1_IPV4: - case PTP_CLASS_V1_IPV6: - case PTP_CLASS_V2_IPV4: - case PTP_CLASS_V2_IPV6: - case PTP_CLASS_V2_L2: - case (PTP_CLASS_V2_VLAN | PTP_CLASS_L2): - case (PTP_CLASS_V2_VLAN | PTP_CLASS_IPV4): - case (PTP_CLASS_V2_VLAN | PTP_CLASS_IPV6): - return true; - } - - return false; + return cpts_can_timestamp(gbe_intf->gbe_dev->cpts, skb); } static int gbe_txtstamp_mark_pkt(struct gbe_intf *gbe_intf,