aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igc/igc_main.c
diff options
context:
space:
mode:
authorSasha Neftin <sasha.neftin@intel.com>2019-02-06 02:48:37 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-03-19 17:42:02 -0400
commit2121c2712f8249e4d2555a4c989e4666aba34031 (patch)
tree063ed62dcb489c0b8940182ab1023082c3848334 /drivers/net/ethernet/intel/igc/igc_main.c
parent459d69c407f9ba122f12216555c3012284dc9fd7 (diff)
igc: Add multiple receive queues control supporting
Enable the multi queues to receive. Program the direction of packets to specified queues according to the mode selected in the MRQC register. Multiple receive queues defined by filters and RSS for 4 queues. Enable/disable RSS hashing and also to enable multiple receive queues. This patch will allow further ethtool support development. Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
-rw-r--r--drivers/net/ethernet/intel/igc/igc_main.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 87a11879bf2d..a6fe614820b6 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -620,6 +620,55 @@ static void igc_configure_tx(struct igc_adapter *adapter)
620 */ 620 */
621static void igc_setup_mrqc(struct igc_adapter *adapter) 621static void igc_setup_mrqc(struct igc_adapter *adapter)
622{ 622{
623 struct igc_hw *hw = &adapter->hw;
624 u32 j, num_rx_queues;
625 u32 mrqc, rxcsum;
626 u32 rss_key[10];
627
628 netdev_rss_key_fill(rss_key, sizeof(rss_key));
629 for (j = 0; j < 10; j++)
630 wr32(IGC_RSSRK(j), rss_key[j]);
631
632 num_rx_queues = adapter->rss_queues;
633
634 if (adapter->rss_indir_tbl_init != num_rx_queues) {
635 for (j = 0; j < IGC_RETA_SIZE; j++)
636 adapter->rss_indir_tbl[j] =
637 (j * num_rx_queues) / IGC_RETA_SIZE;
638 adapter->rss_indir_tbl_init = num_rx_queues;
639 }
640 igc_write_rss_indir_tbl(adapter);
641
642 /* Disable raw packet checksumming so that RSS hash is placed in
643 * descriptor on writeback. No need to enable TCP/UDP/IP checksum
644 * offloads as they are enabled by default
645 */
646 rxcsum = rd32(IGC_RXCSUM);
647 rxcsum |= IGC_RXCSUM_PCSD;
648
649 /* Enable Receive Checksum Offload for SCTP */
650 rxcsum |= IGC_RXCSUM_CRCOFL;
651
652 /* Don't need to set TUOFL or IPOFL, they default to 1 */
653 wr32(IGC_RXCSUM, rxcsum);
654
655 /* Generate RSS hash based on packet types, TCP/UDP
656 * port numbers and/or IPv4/v6 src and dst addresses
657 */
658 mrqc = IGC_MRQC_RSS_FIELD_IPV4 |
659 IGC_MRQC_RSS_FIELD_IPV4_TCP |
660 IGC_MRQC_RSS_FIELD_IPV6 |
661 IGC_MRQC_RSS_FIELD_IPV6_TCP |
662 IGC_MRQC_RSS_FIELD_IPV6_TCP_EX;
663
664 if (adapter->flags & IGC_FLAG_RSS_FIELD_IPV4_UDP)
665 mrqc |= IGC_MRQC_RSS_FIELD_IPV4_UDP;
666 if (adapter->flags & IGC_FLAG_RSS_FIELD_IPV6_UDP)
667 mrqc |= IGC_MRQC_RSS_FIELD_IPV6_UDP;
668
669 mrqc |= IGC_MRQC_ENABLE_RSS_MQ;
670
671 wr32(IGC_MRQC, mrqc);
623} 672}
624 673
625/** 674/**