[dpdk-dev,v2,1/4] net/af_packet: add iface name to internals

Message ID 1483624424-2806-1-git-send-email-ciwillia@brocade.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Chas Williams Jan. 5, 2017, 1:53 p.m. UTC
  This will be used by later changes to determine the underlying linux
interface.

Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Ferruh Yigit Jan. 5, 2017, 2:04 p.m. UTC | #1
On 1/5/2017 1:53 PM, Charles (Chas) Williams wrote:
> This will be used by later changes to determine the underlying linux
> interface.
> 
> Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>

Hi Charles,

Independent from the patch content,

it will be useful if you can send new patchset as reply to previous one,
this way all patches will be in same mail thread, this will help to
trace/review them, also it will be easier to find them in mail archive
in the future.

Another thing is, if you can add a version diff in the comment log,
after "---", that helps others to understand what has been changed in
this new version.

Thanks,
ferruh

<...>
  
Ferruh Yigit Jan. 16, 2017, 2:31 p.m. UTC | #2
On 1/5/2017 1:53 PM, Charles (Chas) Williams wrote:
> This will be used by later changes to determine the underlying linux
> interface.
> 
> Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>

Series Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Ferruh Yigit Jan. 16, 2017, 2:35 p.m. UTC | #3
On 1/16/2017 2:31 PM, Ferruh Yigit wrote:
> On 1/5/2017 1:53 PM, Charles (Chas) Williams wrote:
>> This will be used by later changes to determine the underlying linux
>> interface.
>>
>> Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
> 
> Series Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Series applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 17b4ffe..4ef61a2 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -99,6 +99,7 @@  struct pmd_internals {
 	unsigned nb_queues;
 
 	int if_index;
+	char *if_name;
 	struct ether_addr eth_addr;
 
 	struct tpacket_req req;
@@ -532,6 +533,7 @@  rte_pmd_init_internals(const char *name,
 		        name);
 		goto error_early;
 	}
+	(*internals)->if_name = strdup(pair->value);
 	(*internals)->if_index = ifr.ifr_ifindex;
 
 	if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) == -1) {
@@ -723,6 +725,7 @@  rte_pmd_init_internals(const char *name,
 			((*internals)->rx_queue[q].sockfd != qsockfd))
 			close((*internals)->rx_queue[q].sockfd);
 	}
+	free((*internals)->if_name);
 	rte_free(*internals);
 error_early:
 	rte_free(data);
@@ -891,6 +894,7 @@  rte_pmd_af_packet_remove(const char *name)
 		rte_free(internals->rx_queue[q].rd);
 		rte_free(internals->tx_queue[q].rd);
 	}
+	free(internals->if_name);
 
 	rte_free(eth_dev->data->dev_private);
 	rte_free(eth_dev->data);