DPDK patches and discussions
 help / color / mirror / Atom feed
From: Long Li <longli@microsoft.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	Long Li <longli@linuxonhyperv.com>,
	 Stephen Hemminger <sthemmin@microsoft.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] net/netvsc: allow setting rx and tx copy break
Date: Fri, 23 Oct 2020 19:49:33 +0000
Message-ID: <BN8PR21MB1155D567C66FE0F0BB2FCCE6CE1A0@BN8PR21MB1155.namprd21.prod.outlook.com> (raw)
In-Reply-To: <53ea0071-6a22-6efd-f209-f599e1dc1a4d@intel.com>

> Subject: Re: [dpdk-dev] [PATCH 1/2] net/netvsc: allow setting rx and tx copy
> break
> 
> On 10/22/2020 8:46 PM, Long Li wrote:
> > From: Stephen Hemminger <stephen@networkplumber.org>
> >
> > The values for Rx and Tx copy break should be tunable rather than hard
> > coded constants.
> >
> > The rx_copybreak sets the threshold where the driver uses an external
> > mbuf to avoid having to copy data. Setting 0 for copybreak will cause
> > driver to always create an external mbuf. Setting a value greater than
> > the MTU would prevent it from ever making an external mbuf and always
> > copy. The default value is 256 (bytes).
> >
> > Likewise the tx_copybreak sets the threshold where the driver
> > aggregates multiple small packets into one request. If tx_copybreak is
> > 0 then each packet goes as a VMBus request (no copying).
> > If tx_copybreak is set larger than the MTU, then all packets smaller
> > than the chunk size of the VMBus send buffer will be copied; larger
> > packets always have to go as a single direct request. The default
> > value is 512 (bytes).
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > Signed-off-by: Long Li <longli@microsoft.com>
> 
> <...>
> 
> > @@ -45,6 +45,10 @@
> >   			    DEV_RX_OFFLOAD_VLAN_STRIP | \
> >   			    DEV_RX_OFFLOAD_RSS_HASH)
> >
> > +#define NETVSC_ARG_LATENCY "latency"
> > +#define NETVSC_ARG_RXBREAK "rx_copybreak"
> > +#define NETVSC_ARG_TXBREAK "tx_copybreak"
> > +
> 
> Can you please document new devargs in the driver documentation?
> 
> <...>
> 
> > @@ -181,12 +167,32 @@ static int hn_parse_args(const struct rte_eth_dev
> *dev)
> >   		return -EINVAL;
> >   	}
> >
> > -	ret = rte_kvargs_process(kvlist, "latency", hn_set_latency, hv);
> > -	if (ret)
> > -		PMD_DRV_LOG(ERR, "Unable to process latency arg\n");
> > +	for (i = 0; i != kvlist->count; ++i) {
> > +		const struct rte_kvargs_pair *pair = &kvlist->pairs[i];
> > +
> > +		if (!strcmp(pair->key, NETVSC_ARG_LATENCY))
> > +			latency = atoi(pair->value);
> > +		else if (!strcmp(pair->key, NETVSC_ARG_RXBREAK))
> > +			rx_break = atoi(pair->value);
> > +		else if (!strcmp(pair->key, NETVSC_ARG_TXBREAK))
> > +			tx_break = atoi(pair->value);
> > +	}
> > +
> 
> Instead of accessing to the kvlist internals, I think better to use
> 'rte_kvargs_process()' as done previously.
> If the reason to remove callback is to not create a callback for each argument, a
> generic one can be used for all.
> 
> > +	if (latency >= 0) {
> > +		PMD_DRV_LOG(DEBUG, "set latency %d usec", latency);
> > +		hv->latency = latency * 1000;	/* usec to nsec */
> > +	}
> > +	if (rx_break >= 0) {
> > +		PMD_DRV_LOG(DEBUG, "rx copy break set to %d", rx_break);
> > +		hv->rx_copybreak = rx_break;
> > +	}
> > +	if (tx_break >= 0) {
> > +		PMD_DRV_LOG(DEBUG, "tx copy break set to %d", tx_break);
> > +		hv->tx_copybreak = tx_break;
> > +	}
> >
> 
> When 'rte_kvargs_process()' used, the valued can be assigned directly to 'hv-
> >tx_copybreak', if the argument is not available, it won't be updated, so above
> check can be dropped.

Thanks Ferruh, I will send V2 to address comments.

Long

      reply	other threads:[~2020-10-23 19:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 19:46 Long Li
2020-10-22 19:46 ` [dpdk-dev] [PATCH 2/2] net/netvsc: introduce driver parameter to control the use of external mbuf on receiving data Long Li
2020-10-23 16:23   ` Ferruh Yigit
2020-10-23 16:21 ` [dpdk-dev] [PATCH 1/2] net/netvsc: allow setting rx and tx copy break Ferruh Yigit
2020-10-23 19:49   ` Long Li [this message]

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=BN8PR21MB1155D567C66FE0F0BB2FCCE6CE1A0@BN8PR21MB1155.namprd21.prod.outlook.com \
    --to=longli@microsoft.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=longli@linuxonhyperv.com \
    --cc=stephen@networkplumber.org \
    --cc=sthemmin@microsoft.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git