netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <sameehj@amazon.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: Sameeh Jubran <sameehj@amazon.com>, <dwmw@amazon.com>,
	<zorik@amazon.com>, <matua@amazon.com>, <saeedb@amazon.com>,
	<msw@amazon.com>, <aliguori@amazon.com>, <nafea@amazon.com>,
	<gtzalik@amazon.com>, <netanel@amazon.com>, <alisaidi@amazon.com>,
	<benh@amazon.com>, <akiyano@amazon.com>
Subject: [PATCH V2 net 08/11] net: ena: add support for changing max_header_size in LLQ mode
Date: Mon, 3 Jun 2019 17:43:26 +0300	[thread overview]
Message-ID: <20190603144329.16366-9-sameehj@amazon.com> (raw)
In-Reply-To: <20190603144329.16366-1-sameehj@amazon.com>

From: Sameeh Jubran <sameehj@amazon.com>

Up until now the driver always used a single setting for the sizes
of the different parts of the llq entry - 128 for entry size, 2 for
descriptors before header and 96 for maximum header size.

The current code makes sure that the parts of the llq entry are
compatible with each other and with the initial llq entry size given
by the device.

This commit changes this code to support any llq entry size

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
---
 drivers/net/ethernet/amazon/ena/ena_com.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c
index 5e2abdda7..dbc12e383 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_com.c
@@ -2992,8 +2992,8 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_dev,
 			    struct ena_admin_feature_llq_desc *llq_features,
 			    struct ena_llq_configurations *llq_default_cfg)
 {
+	struct ena_com_llq_info *llq_info = &ena_dev->llq_info;
 	int rc;
-	int size;
 
 	if (!llq_features->max_llq_num) {
 		ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST;
@@ -3004,12 +3004,10 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_dev,
 	if (rc)
 		return rc;
 
-	/* Validate the descriptor is not too big */
-	size = ena_dev->tx_max_header_size;
-	size += ena_dev->llq_info.descs_num_before_header *
-		sizeof(struct ena_eth_io_tx_desc);
+	ena_dev->tx_max_header_size = llq_info->desc_list_entry_size -
+		(llq_info->descs_num_before_header * sizeof(struct ena_eth_io_tx_desc));
 
-	if (unlikely(ena_dev->llq_info.desc_list_entry_size < size)) {
+	if (unlikely(ena_dev->tx_max_header_size == 0)) {
 		pr_err("the size of the LLQ entry is smaller than needed\n");
 		return -EINVAL;
 	}
-- 
2.17.1


  parent reply	other threads:[~2019-06-03 14:44 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 14:43 [PATCH V2 net 00/11] Extending the ena driver to support new features and enhance performance sameehj
2019-06-03 14:43 ` [PATCH V2 net 01/11] net: ena: add handling of llq max tx burst size sameehj
2019-06-03 14:43 ` [PATCH V2 net 02/11] net: ena: ethtool: add extra properties retrieval via get_priv_flags sameehj
2019-06-03 14:43 ` [PATCH V2 net 03/11] net: ena: replace free_tx/rx_ids union with single free_ids field in ena_ring sameehj
2019-06-03 14:43 ` [PATCH V2 net 04/11] net: ena: arrange ena_probe() function variables in reverse christmas tree sameehj
2019-06-03 14:43 ` [PATCH V2 net 05/11] net: ena: add newline at the end of pr_err prints sameehj
2019-06-03 14:43 ` [PATCH V2 net 06/11] net: ena: documentation: update ena.txt sameehj
2019-06-03 14:43 ` [PATCH V2 net 07/11] net: ena: allow automatic fallback to polling mode sameehj
2019-06-03 14:43 ` sameehj [this message]
2019-06-03 14:43 ` [PATCH V2 net 09/11] net: ena: optimise calculations for CQ doorbell sameehj
2019-06-03 14:43 ` [PATCH V2 net 10/11] net: ena: add good checksum counter sameehj
2019-06-03 14:43 ` [PATCH V2 net 11/11] net: ena: use dev_info_once instead of static variable sameehj
2019-06-03 20:30 ` [PATCH V2 net 00/11] Extending the ena driver to support new features and enhance performance David Miller
2019-06-03 21:32 ` Jakub Kicinski
     [not found]   ` <9da931e72debc868efaac144082f40d379c50f3c.camel@amazon.co.uk>
2019-06-03 23:03     ` Jakub Kicinski
2019-06-04  1:50       ` Andrew Lunn
2019-06-04  2:15         ` Bshara, Nafea
2019-06-04  6:57           ` David Woodhouse
2019-06-04 17:24             ` Jakub Kicinski
2019-06-06 10:23               ` Jubran, Samih
2019-06-06 17:16                 ` Jakub Kicinski
2019-06-06 21:40                   ` Bshara, Nafea
2019-06-06 22:04                     ` Jakub Kicinski
2019-06-06 22:57                       ` Bshara, Nafea
2019-06-06 23:07                         ` Jakub Kicinski
2019-06-06 23:21                           ` Bshara, Nafea
2019-06-06 23:42                             ` Jakub Kicinski
2019-06-07  1:04                               ` Bshara, Nafea
2019-06-07  1:14                                 ` Jakub Kicinski
2019-06-07 21:27                                   ` Jakub Kicinski
2019-06-07 21:34                                     ` Bshara, Nafea
2019-06-07 21:54                                       ` 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=20190603144329.16366-9-sameehj@amazon.com \
    --to=sameehj@amazon.com \
    --cc=akiyano@amazon.com \
    --cc=aliguori@amazon.com \
    --cc=alisaidi@amazon.com \
    --cc=benh@amazon.com \
    --cc=davem@davemloft.net \
    --cc=dwmw@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=matua@amazon.com \
    --cc=msw@amazon.com \
    --cc=nafea@amazon.com \
    --cc=netanel@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedb@amazon.com \
    --cc=zorik@amazon.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).