netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Brady, Alan" <alan.brady@intel.com>
To: Joe Perches <joe@perches.com>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: "Michael, Alice" <alice.michael@intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"nhorman@redhat.com" <nhorman@redhat.com>,
	"sassmann@redhat.com" <sassmann@redhat.com>,
	"Burra, Phani R" <phani.r.burra@intel.com>,
	"Hay, Joshua A" <joshua.a.hay@intel.com>,
	"Chittim, Madhu" <madhu.chittim@intel.com>,
	"Linga, Pavan Kumar" <pavan.kumar.linga@intel.com>,
	"Skidmore, Donald C" <donald.c.skidmore@intel.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
	"Samudrala, Sridhar" <sridhar.samudrala@intel.com>
Subject: RE: [net-next v3 07/15] iecm: Implement virtchnl commands
Date: Fri, 26 Jun 2020 17:51:34 +0000	[thread overview]
Message-ID: <MW3PR11MB4522C47BA782EA0DDFB6399E8F930@MW3PR11MB4522.namprd11.prod.outlook.com> (raw)
In-Reply-To: <de3e14d355f42ed2322483bc1a3448ace46fd6fb.camel@perches.com>

> -----Original Message-----
> From: Joe Perches <joe@perches.com>
> Sent: Thursday, June 25, 2020 8:06 PM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; davem@davemloft.net
> Cc: Michael, Alice <alice.michael@intel.com>; netdev@vger.kernel.org;
> nhorman@redhat.com; sassmann@redhat.com; Brady, Alan
> <alan.brady@intel.com>; Burra, Phani R <phani.r.burra@intel.com>; Hay,
> Joshua A <joshua.a.hay@intel.com>; Chittim, Madhu
> <madhu.chittim@intel.com>; Linga, Pavan Kumar
> <pavan.kumar.linga@intel.com>; Skidmore, Donald C
> <donald.c.skidmore@intel.com>; Brandeburg, Jesse
> <jesse.brandeburg@intel.com>; Samudrala, Sridhar
> <sridhar.samudrala@intel.com>
> Subject: Re: [net-next v3 07/15] iecm: Implement virtchnl commands
> 
> On Thu, 2020-06-25 at 19:07 -0700, Jeff Kirsher wrote:
> > From: Alice Michael <alice.michael@intel.com>
> >
> > Implement various virtchnl commands that enable communication with
> > hardware.
> []
> > diff --git a/drivers/net/ethernet/intel/iecm/iecm_virtchnl.c
> > b/drivers/net/ethernet/intel/iecm/iecm_virtchnl.c
> []
> > @@ -751,7 +1422,44 @@ iecm_send_add_queues_msg(struct iecm_vport
> > *vport, u16 num_tx_q,  enum iecm_status
> > iecm_send_get_stats_msg(struct iecm_vport *vport)  {
> > -	/* stub */
> > +	struct iecm_adapter *adapter = vport->adapter;
> > +	struct virtchnl_queue_select vqs;
> > +	enum iecm_status err;
> > +
> > +	/* Don't send get_stats message if one is pending or the
> > +	 * link is down
> > +	 */
> > +	if (test_bit(IECM_VC_GET_STATS, adapter->vc_state) ||
> > +	    adapter->state <= __IECM_DOWN)
> > +		return 0;
> > +
> > +	vqs.vsi_id = vport->vport_id;
> > +
> > +	err = iecm_send_mb_msg(adapter, VIRTCHNL_OP_GET_STATS,
> > +			       sizeof(vqs), (u8 *)&vqs);
> 
> rather clearer to just test and return err
> 
> 	if (err)
> 		return err;

Agreed, will fix.

> > +
> > +	if (!err)
> > +		err = iecm_wait_for_event(adapter, IECM_VC_GET_STATS,
> > +					  IECM_VC_GET_STATS_ERR);
> 
> unindent and add
> 
> 	if (err)
> 		return err;
> 
> so all the below is also unindented.
> It might also be clearer to use another temporary for vport->netstats
> 

Agreed will fix indent and add temp var.

> > +
> > +	if (!err) {
> > +		struct virtchnl_eth_stats *stats =
> > +			(struct virtchnl_eth_stats *)adapter->vc_msg;
> > +		vport->netstats.rx_packets = stats->rx_unicast +
> > +						 stats->rx_multicast +
> > +						 stats->rx_broadcast;
> > +		vport->netstats.tx_packets = stats->tx_unicast +
> > +						 stats->tx_multicast +
> > +						 stats->tx_broadcast;
> > +		vport->netstats.rx_bytes = stats->rx_bytes;
> > +		vport->netstats.tx_bytes = stats->tx_bytes;
> > +		vport->netstats.tx_errors = stats->tx_errors;
> > +		vport->netstats.rx_dropped = stats->rx_discards;
> > +		vport->netstats.tx_dropped = stats->tx_discards;
> > +		mutex_unlock(&adapter->vc_msg_lock);
> > +	}
> > +
> > +	return err;
> >  }
> 
> []
> 
> > @@ -801,7 +1670,24 @@ iecm_send_get_set_rss_key_msg(struct iecm_vport
> *vport, bool get)
> >   */
> >  enum iecm_status iecm_send_get_rx_ptype_msg(struct iecm_vport *vport)
> > {
> > -	/* stub */
> > +	struct iecm_rx_ptype_decoded *rx_ptype_lkup = vport->rx_ptype_lkup;
> > +	int ptype_list[IECM_RX_SUPP_PTYPE] = { 0, 1, 11, 12, 22, 23, 24, 25, 26,
> > +					      27, 28, 88, 89, 90, 91, 92, 93,
> > +					      94 };
> 
> static const?

Will fix.

Alan

  reply	other threads:[~2020-06-26 17:53 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  2:07 [net-next v3 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-06-25 Jeff Kirsher
2020-06-26  2:07 ` [net-next v3 01/15] virtchnl: Extend AVF ops Jeff Kirsher
2020-06-26  2:07 ` [net-next v3 02/15] iecm: Add framework set of header files Jeff Kirsher
2020-06-26  2:07 ` [net-next v3 03/15] iecm: Add TX/RX " Jeff Kirsher
2020-06-26  2:07 ` [net-next v3 04/15] iecm: Common module introduction and function stubs Jeff Kirsher
2020-06-26  2:23   ` Joe Perches
2020-06-26 17:34     ` Brady, Alan
2020-06-26 17:43       ` Joe Perches
2020-06-26  2:07 ` [net-next v3 05/15] iecm: Add basic netdevice functionality Jeff Kirsher
2020-06-26  2:39   ` Joe Perches
2020-06-26 17:38     ` Brady, Alan
2020-06-26  2:07 ` [net-next v3 06/15] iecm: Implement mailbox functionality Jeff Kirsher
2020-06-26  2:57   ` Joe Perches
2020-06-26 17:44     ` Brady, Alan
2020-06-26 23:11       ` Joe Perches
2020-06-26 19:10   ` Jakub Kicinski
2020-06-29 18:51     ` Brady, Alan
2020-06-26  2:07 ` [net-next v3 07/15] iecm: Implement virtchnl commands Jeff Kirsher
2020-06-26  3:06   ` Joe Perches
2020-06-26 17:51     ` Brady, Alan [this message]
2020-06-26  2:07 ` [net-next v3 08/15] iecm: Implement vector allocation Jeff Kirsher
2020-06-26  2:07 ` [net-next v3 09/15] iecm: Init and allocate vport Jeff Kirsher
2020-06-26 19:00   ` Jakub Kicinski
2020-06-29 18:48     ` Brady, Alan
2020-06-26  2:07 ` [net-next v3 10/15] iecm: Deinit vport Jeff Kirsher
2020-06-26  2:07 ` [net-next v3 11/15] iecm: Add splitq TX/RX Jeff Kirsher
2020-06-26 19:58   ` Jakub Kicinski
2020-06-27  1:26     ` Joe Perches
2020-06-29 18:57     ` Brady, Alan
2020-06-26  2:07 ` [net-next v3 12/15] iecm: Add singleq TX/RX Jeff Kirsher
2020-06-26  3:12   ` Joe Perches
2020-06-26 17:52     ` Brady, Alan
2020-06-26  2:07 ` [net-next v3 13/15] iecm: Add ethtool Jeff Kirsher
2020-06-26  3:29   ` Joe Perches
2020-06-26 17:57     ` Brady, Alan
2020-06-26 18:57   ` Jakub Kicinski
2020-06-29 18:48     ` Brady, Alan
2020-06-26 19:14   ` Jakub Kicinski
2020-06-29 18:53     ` Brady, Alan
2020-06-26 19:27   ` Jakub Kicinski
2020-06-29 21:00     ` Brady, Alan
2020-06-29 21:31       ` Jakub Kicinski
2020-06-29 22:07         ` Brady, Alan
2020-06-26 19:29   ` Jakub Kicinski
2020-07-10 20:16     ` Brady, Alan
2020-06-26  2:07 ` [net-next v3 14/15] iecm: Add iecm to the kernel build system Jeff Kirsher
2020-06-26  3:32   ` Joe Perches
2020-06-29 18:46     ` Brady, Alan
2020-06-26  2:07 ` [net-next v3 15/15] idpf: Introduce idpf driver Jeff Kirsher
2020-06-26  3:35   ` Joe Perches
2020-06-29 18:47     ` Brady, Alan
2020-06-26 18:52   ` Jakub Kicinski
2020-06-30 23:48     ` Kirsher, Jeffrey T
2020-07-01  0:59       ` Jakub Kicinski
2020-07-01  1:13         ` Kirsher, Jeffrey T
2020-06-26  3:37 ` [net-next v3 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-06-25 Joe Perches
2020-06-26 18:58 ` Jakub Kicinski

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=MW3PR11MB4522C47BA782EA0DDFB6399E8F930@MW3PR11MB4522.namprd11.prod.outlook.com \
    --to=alan.brady@intel.com \
    --cc=alice.michael@intel.com \
    --cc=davem@davemloft.net \
    --cc=donald.c.skidmore@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=joe@perches.com \
    --cc=joshua.a.hay@intel.com \
    --cc=madhu.chittim@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=pavan.kumar.linga@intel.com \
    --cc=phani.r.burra@intel.com \
    --cc=sassmann@redhat.com \
    --cc=sridhar.samudrala@intel.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).