netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, Scott Feldman <sfeldma@gmail.com>
Subject: Re: [PATCH 1/3] net: add support for phys_port_name
Date: Mon, 16 Mar 2015 10:02:09 -0600	[thread overview]
Message-ID: <5506FE81.2010602@gmail.com> (raw)
In-Reply-To: <20150316160000.GD2058@nanopsycho.orion>

On 3/16/15 10:00 AM, Jiri Pirko wrote:
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> >index dd1d069758be..47a773b9bee0 100644
>> >--- a/include/linux/netdevice.h
>> >+++ b/include/linux/netdevice.h
>> >@@ -765,6 +765,15 @@ struct netdev_phys_item_id {
>> >	unsigned char id_len;
>> >};
>> >
>> >+#define MAX_PHYS_ITEM_NAME_LEN 32
>> >+
>> >+/* This structure holds a unique name to identify some
>> >+ * physical item (port for example) used by a netdevice.
>> >+ */
>> >+struct netdev_phys_item_name {
>> >+	char str[MAX_PHYS_ITEM_NAME_LEN];
>> >+};
>> >+
>> >typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
>> >				       struct sk_buff *skb);
>> >
>> >@@ -1159,6 +1168,8 @@ struct net_device_ops {
>> >						      bool new_carrier);
>> >	int			(*ndo_get_phys_port_id)(struct net_device *dev,
>> >							struct netdev_phys_item_id *ppid);
>> >+	int			(*ndo_get_phys_port_name)(struct net_device *dev,
>> >+							  struct netdev_phys_item_name *name);
> I think that we do not need the structure. Just pass "char *name" for buffer
> where to put the name and "size_t len" for len of the buffer. Have:
> #define PORT_NAME_MAX_LEN 32
> and have called to have "char name[PORT_NAME_MAX_LEN]"
>
> Also, given that this is related to switches, won't it make sense to
> push this into switchdev code?
>
>

Doesn't seem right to have assumptions on buffer length like that.

David

  reply	other threads:[~2015-03-16 16:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 15:46 [PATCH 1/3] net: add support for phys_port_name David Ahern
2015-03-16 15:46 ` [PATCH 2/3] rocker: " David Ahern
2015-03-16 15:46 ` [PATCH 3/3] iproute2: Add " David Ahern
2015-03-24 22:50   ` Stephen Hemminger
2015-03-27  3:41     ` David Ahern
2015-03-16 16:00 ` [PATCH 1/3] net: add " Jiri Pirko
2015-03-16 16:02   ` David Ahern [this message]
2015-03-16 16:15     ` Jiri Pirko
2015-03-17  3:29   ` David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5506FE81.2010602@gmail.com \
    --to=dsahern@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=sfeldma@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).