netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Kubecek <mkubecek@suse.cz>
To: netdev@vger.kernel.org
Cc: sunil.kovvuri@gmail.com, davem@davemloft.net, kubakici@wp.pl,
	Sunil Goutham <sgoutham@marvell.com>,
	Prakash Brahmajyosyula <bprakash@marvell.com>
Subject: Re: [PATCH v2 15/17] octeontx2-pf: ethtool RSS config support
Date: Tue, 14 Jan 2020 11:19:49 +0100	[thread overview]
Message-ID: <20200114101949.GB22304@unicorn.suse.cz> (raw)
In-Reply-To: <1578985340-28775-16-git-send-email-sunil.kovvuri@gmail.com>

On Tue, Jan 14, 2020 at 12:32:18PM +0530, sunil.kovvuri@gmail.com wrote:
> From: Sunil Goutham <sgoutham@marvell.com>
> 
> Added support to show or configure RSS hash key, indirection table,
> 2,4 tuple via ethtool. Also added debug msg_level support
> to dump messages when HW reports errors in packet received
> or transmitted.
> 
> Signed-off-by: Prakash Brahmajyosyula <bprakash@marvell.com>
> Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
> ---
[...]
> +static int otx2_set_rss_hash_opts(struct otx2_nic *pfvf,
> +				  struct ethtool_rxnfc *nfc)
> +{
> +	struct otx2_rss_info *rss = &pfvf->hw.rss_info;
> +	u32 rxh_l4 = RXH_L4_B_0_1 | RXH_L4_B_2_3;
> +	u32 rss_cfg = rss->flowkey_cfg;
> +
> +	if (!rss->enable)
> +		netdev_err(pfvf->netdev, "RSS is disabled, cmd ignored\n");
> +
> +	/* Mimimum is IPv4 and IPv6, SIP/DIP */
> +	if (!(nfc->data & RXH_IP_SRC) || !(nfc->data & RXH_IP_DST))
> +		return -EINVAL;
> +
> +	switch (nfc->flow_type) {
> +	case TCP_V4_FLOW:
> +	case TCP_V6_FLOW:
> +		/* Different config for v4 and v6 is not supported.
> +		 * Both of them have to be either 4-tuple or 2-tuple.
> +		 */
> +		if ((nfc->data & rxh_l4) == rxh_l4)
> +			rss_cfg |= NIX_FLOW_KEY_TYPE_TCP;
> +		else
> +			rss_cfg &= ~NIX_FLOW_KEY_TYPE_TCP;
> +		break;

IMHO it would be cleaner to reject requests with only one bit set than
to silently clear the bit (same for UDP and SCTP). You also shouldn't
silently ignore unsupported bits.

Michal Kubecek

> +	case UDP_V4_FLOW:
> +	case UDP_V6_FLOW:
> +		if ((nfc->data & rxh_l4) == rxh_l4)
> +			rss_cfg |= NIX_FLOW_KEY_TYPE_UDP;
> +		else
> +			rss_cfg &= ~NIX_FLOW_KEY_TYPE_UDP;
> +		break;
> +	case SCTP_V4_FLOW:
> +	case SCTP_V6_FLOW:
> +		if ((nfc->data & rxh_l4) == rxh_l4)
> +			rss_cfg |= NIX_FLOW_KEY_TYPE_SCTP;
> +		else
> +			rss_cfg &= ~NIX_FLOW_KEY_TYPE_SCTP;
> +		break;
> +	case AH_ESP_V4_FLOW:
> +	case AH_V4_FLOW:
> +	case ESP_V4_FLOW:
> +	case IPV4_FLOW:
> +	case AH_ESP_V6_FLOW:
> +	case AH_V6_FLOW:
> +	case ESP_V6_FLOW:
> +	case IPV6_FLOW:
> +		rss_cfg = NIX_FLOW_KEY_TYPE_IPV4 | NIX_FLOW_KEY_TYPE_IPV6;
> +		break;
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	rss->flowkey_cfg = rss_cfg;
> +	otx2_set_flowkey_cfg(pfvf);
> +	return 0;
> +}

  reply	other threads:[~2020-01-14 10:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14  7:02 [PATCH v2 00/17] octeontx2-pf: Add network driver for physical function sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 01/17] octeontx2-pf: Add Marvell OcteonTX2 NIC driver sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 02/17] octeontx2-pf: Mailbox communication with AF sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 03/17] octeontx2-pf: Attach NIX and NPA block LFs sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 04/17] octeontx2-pf: Initialize and config queues sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 05/17] octeontx2-pf: Setup interrupts and NAPI handler sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 06/17] octeontx2-pf: Receive packet handling support sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 07/17] octeontx2-pf: Add packet transmission support sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 08/17] octeontx2-pf: Register and handle link notifications sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 09/17] octeontx2-pf: MTU, MAC and RX mode config support sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 10/17] octeontx2-pf: Error handling support sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 11/17] octeontx2-pf: Receive side scaling support sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 12/17] octeontx2-pf: TCP segmentation offload support sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 13/17] octeontx2-pf: Add ndo_get_stats64 sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 14/17] octeontx2-pf: Add basic ethtool support sunil.kovvuri
2020-01-14 10:08   ` Michal Kubecek
2020-01-14 10:26     ` Sunil Kovvuri
2020-01-14 13:17   ` Jakub Kicinski
2020-01-14  7:02 ` [PATCH v2 15/17] octeontx2-pf: ethtool RSS config support sunil.kovvuri
2020-01-14 10:19   ` Michal Kubecek [this message]
2020-01-14 10:29     ` Sunil Kovvuri
2020-01-14  7:02 ` [PATCH v2 16/17] Documentation: net: octeontx2: Add RVU HW and drivers overview sunil.kovvuri
2020-01-14  7:02 ` [PATCH v2 17/17] MAINTAINERS: Add entry for Marvell OcteonTX2 Physical Function driver sunil.kovvuri

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=20200114101949.GB22304@unicorn.suse.cz \
    --to=mkubecek@suse.cz \
    --cc=bprakash@marvell.com \
    --cc=davem@davemloft.net \
    --cc=kubakici@wp.pl \
    --cc=netdev@vger.kernel.org \
    --cc=sgoutham@marvell.com \
    --cc=sunil.kovvuri@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).