DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: vanshika.shukla@nxp.com
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>,
	Wathsala Vithanage <wathsala.vithanage@arm.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Gagandeep Singh <g.singh@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Apeksha Gupta <apeksha.gupta@nxp.com>
Subject: Re: [v1 01/12] net/enetc: Add initial ENETC4 PMD driver support
Date: Sun, 20 Oct 2024 16:52:57 -0700	[thread overview]
Message-ID: <20241020165257.613367c1@hermes.local> (raw)
In-Reply-To: <20241018072644.2379012-2-vanshika.shukla@nxp.com>

On Fri, 18 Oct 2024 12:56:33 +0530
vanshika.shukla@nxp.com wrote:

> +	/* Allocate memory for storing MAC addresses */
> +	snprintf(eth_name, sizeof(eth_name), "enetc4_eth_%d", eth_dev->data->port_id);
> +	eth_dev->data->mac_addrs = rte_zmalloc(eth_name,
> +					RTE_ETHER_ADDR_LEN, 0);
> +	if (!eth_dev->data->mac_addrs) {

The first argument of rte_malloc routines is hardly used. It does show up in
trace but that is about all. Ok to keep it this as is, but wasted effort.

> +	if ((high_mac | low_mac) == 0) {
> +		char *first_byte;
> +
> +		ENETC_PMD_NOTICE("MAC is not available for this SI, "
> +				"set random MAC");
> +		mac = (uint32_t *)hw->mac.addr;
> +		*mac = (uint32_t)rte_rand();
> +		first_byte = (char *)mac;
> +		*first_byte &= 0xfe;	/* clear multicast bit */
> +		*first_byte |= 0x02;	/* set local assignment bit (IEEE802) */
> +
> +		enetc4_port_wr(enetc_hw, ENETC4_PMAR0, *mac);
> +		mac++;
> +		*mac = (uint16_t)rte_rand();
> +		enetc4_port_wr(enetc_hw, ENETC4_PMAR1, *mac);
> +		print_ethaddr("New address: ",
> +			      (const struct rte_ether_addr *)hw->mac.addr);

Please use existing rte_eth_random_addr() for this.

  parent reply	other threads:[~2024-10-21  0:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  7:26 [v1 00/12] ENETC4 PMD support vanshika.shukla
2024-10-18  7:26 ` [v1 01/12] net/enetc: Add initial ENETC4 PMD driver support vanshika.shukla
2024-10-20 23:39   ` Stephen Hemminger
2024-10-20 23:52   ` Stephen Hemminger [this message]
2024-10-18  7:26 ` [v1 02/12] net/enetc: Add RX and TX queue APIs for ENETC4 PMD vanshika.shukla
2024-10-20 23:40   ` Stephen Hemminger
2024-10-18  7:26 ` [v1 03/12] net/enetc: Optimize ENETC4 data path vanshika.shukla
2024-10-21  0:06   ` Stephen Hemminger
2024-10-18  7:26 ` [v1 04/12] net/enetc: Add TX checksum offload and RX checksum validation vanshika.shukla
2024-10-18  7:26 ` [v1 05/12] net/enetc: Add basic statistics vanshika.shukla
2024-10-18  7:26 ` [v1 06/12] net/enetc: Add packet type parsing support vanshika.shukla
2024-10-18  7:26 ` [v1 07/12] net/enetc: Add support for multiple queues with RSS vanshika.shukla
2024-10-18  7:26 ` [v1 08/12] net/enetc: Add VF to PF messaging support and primary MAC setup vanshika.shukla
2024-10-18  7:26 ` [v1 09/12] net/enetc: Add multicast and promiscuous mode support vanshika.shukla
2024-10-18  7:26 ` [v1 10/12] net/enetc: Add link speed and status support vanshika.shukla
2024-10-18  7:26 ` [v1 11/12] net/enetc: Add link status notification support vanshika.shukla
2024-10-18  7:26 ` [v1 12/12] net/enetc: Add MAC and VLAN filter support vanshika.shukla
2024-10-23  6:24 ` [v2 00/12] ENETC4 PMD support vanshika.shukla
2024-10-23  6:24   ` [v2 01/12] net/enetc: Add initial ENETC4 PMD driver support vanshika.shukla
2024-10-23  6:24   ` [v2 02/12] net/enetc: Add RX and TX queue APIs for ENETC4 PMD vanshika.shukla
2024-10-23  6:24   ` [v2 03/12] net/enetc: Optimize ENETC4 data path vanshika.shukla
2024-10-23  6:24   ` [v2 04/12] net/enetc: Add TX checksum offload and RX checksum validation vanshika.shukla
2024-10-23  6:24   ` [v2 05/12] net/enetc: Add basic statistics vanshika.shukla
2024-10-23  6:24   ` [v2 06/12] net/enetc: Add packet type parsing support vanshika.shukla
2024-10-23  6:24   ` [v2 07/12] net/enetc: Add support for multiple queues with RSS vanshika.shukla
2024-10-23  6:24   ` [v2 08/12] net/enetc: Add VF to PF messaging support and primary MAC setup vanshika.shukla
2024-10-23  6:24   ` [v2 09/12] net/enetc: Add multicast and promiscuous mode support vanshika.shukla
2024-10-23  6:24   ` [v2 10/12] net/enetc: Add link speed and status support vanshika.shukla
2024-10-23  6:24   ` [v2 11/12] net/enetc: Add link status notification support vanshika.shukla
2024-10-23  6:24   ` [v2 12/12] net/enetc: Add MAC and VLAN filter support vanshika.shukla

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=20241020165257.613367c1@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=anatoly.burakov@intel.com \
    --cc=apeksha.gupta@nxp.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=sachin.saxena@nxp.com \
    --cc=thomas@monjalon.net \
    --cc=vanshika.shukla@nxp.com \
    --cc=wathsala.vithanage@arm.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).