From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932379AbdJZPgR (ORCPT ); Thu, 26 Oct 2017 11:36:17 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50005 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932137AbdJZPgN (ORCPT ); Thu, 26 Oct 2017 11:36:13 -0400 X-Google-Smtp-Source: ABhQp+Q5GjX5sQE8GtkMDMop7O0qugyK/0b/XVfj3+V3OBL6Ua3DmjlTMlU5SGrZLdAuFUZ9s6hAGw== Date: Thu, 26 Oct 2017 17:36:11 +0200 From: Jiri Pirko To: Vivien Didelot Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli , Andrew Lunn Subject: Re: [PATCH net-next 7/9] net: dsa: define port types Message-ID: <20171026153611.GG1928@nanopsycho.orion> References: <20171026152259.3123-1-vivien.didelot@savoirfairelinux.com> <20171026152259.3123-8-vivien.didelot@savoirfairelinux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171026152259.3123-8-vivien.didelot@savoirfairelinux.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thu, Oct 26, 2017 at 05:22:57PM CEST, vivien.didelot@savoirfairelinux.com wrote: >Introduce an enumerated type for ports, which will be way more explicit >to identify a port type instead of digging into switch port masks. > >A port can be of type CPU, DSA, user, or unused by default. This is a >static parsed information that cannot be changed at runtime. > >Signed-off-by: Vivien Didelot >--- > include/net/dsa.h | 7 +++++++ > net/dsa/dsa2.c | 3 +++ > net/dsa/legacy.c | 6 ++++++ > 3 files changed, 16 insertions(+) > >diff --git a/include/net/dsa.h b/include/net/dsa.h >index dc7728062396..8da20c4a6552 100644 >--- a/include/net/dsa.h >+++ b/include/net/dsa.h >@@ -180,6 +180,13 @@ struct dsa_port { > struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev, > struct packet_type *pt); > >+ enum { >+ DSA_PORT_TYPE_UNUSED = 0, >+ DSA_PORT_TYPE_CPU, >+ DSA_PORT_TYPE_DSA, >+ DSA_PORT_TYPE_USER, Do you plan to expose this to userspace? How?