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: 106438 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp1234249qge; Tue, 27 Jun 2017 06:59:36 -0700 (PDT) X-Received: by 10.99.185.5 with SMTP id z5mr5445695pge.231.1498571976107; Tue, 27 Jun 2017 06:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498571976; cv=none; d=google.com; s=arc-20160816; b=xmyycxBVqckAa+fjpqe4aoZxe0CHAO+htwhjuk9t6lXgjfUoYyi3kxLnrPTgH48wdG 9FxHMK14bZoyjszBP7sNQD0B7uxo1zqtd2yHyn8Sy7xtF/CH8wJdCQyRrvEaZET61Zsx NFLLjctmvTJtSwbie7DdEgX7Aq0iuGHSjFBz+DNf+5lBKEL44IiTXYSuJC9MPchfib1y b9T6xSNJy/Ip79oP7z+Ra8GSJcPEqLoNeRFo8pC7PZFDyQCg7vIJLJa5doUANZBAPcH8 Chvx50irIRe6fEqrhMCXHF3ZFryCkJ1R08/uXpb9U+B6kjN12Wd5YNilAI2A9p9DstlU mnkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=t5s1UVPV5LUvXaDZaMV5EWxKD2k8JAQXG+jQHk2iBwY=; b=yoJZHO2QFz94fPAhByaOyv5xhKQTdKCiae5Dlcs51HKPa6gFkVGvzhy1ERd9Fngntz Fcpq3wexC4nPHjAkERI72ILhMEPaFQo6aOvzo/mneKj3f7aND0A+xhBAyL135O6mN/0Y j6zepbh+biQwka15i8zhUtfu0zXy8/2ptr6PkzQRoMsCfJgTrXU0wn7Bj6jeolVkaMJu e/855k6Zu1E6NrndWZhs2oNiR/tlAdAvK5S2ZexLy0UUj6Wm8qtCp3C94h//PDd5HCLI acHEEp/xvxornyHxYERAqDy7ioVBkCC6E4Tu51jA7X/MBRm7eGtupaHxkQN3Utuq5Bcw eMZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=BY0v20Az; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x13si1975816pgq.524.2017.06.27.06.59.35; Tue, 27 Jun 2017 06:59:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=BY0v20Az; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751942AbdF0N7P (ORCPT + 3 others); 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 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(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,