netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Felix Manlunas <felix.manlunas@cavium.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	raghu.vatsavayi@cavium.com, derek.chickles@cavium.com,
	satananda.burla@cavium.com, vijaya.guvva@cavium.com
Subject: Re: [PATCH V3 net-next 1/2] liquidio: switchdev support for LiquidIO NIC
Date: Wed, 1 Nov 2017 14:02:07 +0100	[thread overview]
Message-ID: <20171101130207.GH12680@lunn.ch> (raw)
In-Reply-To: <20171031230453.GA3630@felix-thinkpad.cavium.com>

> +static int
> +lio_pf_switchdev_attr_get(struct net_device *dev, struct switchdev_attr *attr)
> +{
> +	struct lio *lio = GET_LIO(dev);
> +
> +	switch (attr->id) {
> +	case SWITCHDEV_ATTR_ID_PORT_PARENT_ID:
> +		attr->u.ppid.id_len = ETH_ALEN;
> +		ether_addr_copy(attr->u.ppid.id,
> +				(void *)&lio->linfo.hw_addr + 2);

The + 2 seems odd. Please could you explain why it is there?


> +static int lio_vf_rep_open(struct net_device *ndev);
> +static int lio_vf_rep_stop(struct net_device *ndev);
> +static int lio_vf_rep_pkt_xmit(struct sk_buff *skb, struct net_device *ndev);
> +static void lio_vf_rep_tx_timeout(struct net_device *netdev);
> +static int lio_vf_rep_phys_port_name(struct net_device *dev,
> +				     char *buf, size_t len);
> +static void lio_vf_rep_get_stats64(struct net_device *dev,
> +				   struct rtnl_link_stats64 *stats64);
> +static int lio_vf_rep_change_mtu(struct net_device *ndev, int new_mtu);
> +
> +static const struct net_device_ops lio_vf_rep_ndev_ops = {
> +	.ndo_open = lio_vf_rep_open,
> +	.ndo_stop = lio_vf_rep_stop,
> +	.ndo_start_xmit = lio_vf_rep_pkt_xmit,
> +	.ndo_tx_timeout = lio_vf_rep_tx_timeout,
> +	.ndo_get_phys_port_name = lio_vf_rep_phys_port_name,
> +	.ndo_get_stats64 = lio_vf_rep_get_stats64,
> +	.ndo_change_mtu = lio_vf_rep_change_mtu,
> +};

Please don't use forward references. Change the order of the code and
put this structure towards the end of the file.

> +lio_vf_rep_phys_port_name(struct net_device *dev,
> +			  char *buf, size_t len)
> +{
> +	struct lio_vf_rep_desc *vf_rep = netdev_priv(dev);
> +	struct octeon_device *oct = vf_rep->oct;
> +	int ret;
> +
> +	ret = snprintf(buf, len, "pf%dvf%d", oct->pf_num,
> +		       vf_rep->ifidx - oct->pf_num * 64 - 1);
> +	if (ret >= len)
> +		return -EOPNOTSUPP;

EOPNOTSUPP seems an odd return code for too short a buffer?

	   Andrew

  reply	other threads:[~2017-11-01 13:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 23:04 [PATCH V3 net-next 0/2] liquidio: switchdev support for LiquidIO NIC Felix Manlunas
2017-10-31 23:04 ` [PATCH V3 net-next 1/2] " Felix Manlunas
2017-11-01 13:02   ` Andrew Lunn [this message]
2017-11-01 19:29     ` Felix Manlunas
2017-11-01 20:14       ` Jakub Kicinski
2017-10-31 23:04 ` [PATCH V3 net-next 2/2] liquidio: Configure switchdev with devlink Felix Manlunas
2017-10-31 23:30 ` [PATCH V3 net-next 0/2] liquidio: switchdev support for LiquidIO NIC Jakub Kicinski
2017-11-01  2:40 ` David Miller

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=20171101130207.GH12680@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=derek.chickles@cavium.com \
    --cc=felix.manlunas@cavium.com \
    --cc=netdev@vger.kernel.org \
    --cc=raghu.vatsavayi@cavium.com \
    --cc=satananda.burla@cavium.com \
    --cc=vijaya.guvva@cavium.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).